Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create new package push upgrade class #690

Conversation

btrn11
Copy link
Collaborator

@btrn11 btrn11 commented Dec 12, 2024

No description provided.

@@ -303,8 +303,8 @@ export class Package {
*
* @param force force a refresh of the package data
*/
public async getPackageData(force = false): Promise<PackagingSObjects.Package2 | undefined> {
if (!this.packageData ?? force) {
public async getPackageData(): Promise<PackagingSObjects.Package2 | undefined> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not change this method since we don't own it. I'd make the change necessary for this to compile on your local but then not include it in the PR. If it gives us issues when attempting to submit we will have to fix it. Also, if you reverse the order in the if it should stop complaining and you it won't change the functionality

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this gave me issue when I tried to push my code, let me check again if we need to include this in PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I flipped the order, a lot of tests failed. And keeping it as it's would not allow me to push code.
Also I think removing force is similar since it's always false and those calling this method is not changing force param (always calling getPackageData() without param)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing this method, since it's public is a breaking change, which requires a major version bump

}

// eslint-disable-next-line @typescript-eslint/no-shadow
async function query(query: string, connection: Connection): Promise<PackagePushRequestListResult[]> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change this name to listQuery or queryList. Since we will have other queries in here for report

@btrn11 btrn11 marked this pull request as ready for review December 16, 2024 18:10
@@ -303,8 +303,8 @@ export class Package {
*
* @param force force a refresh of the package data
*/
public async getPackageData(force = false): Promise<PackagingSObjects.Package2 | undefined> {
if (!this.packageData ?? force) {
public async getPackageData(): Promise<PackagingSObjects.Package2 | undefined> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing this method, since it's public is a breaking change, which requires a major version bump

}

function getListQuery(): string {
const QUERY = 'SELECT Id, PackageVersion, Status' + 'FROM PackagePushRequest ' + '%s'; // WHERE, if applicable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: can make this inline... return 'SELECT Id...

@btrn11 btrn11 marked this pull request as draft December 16, 2024 21:31
@btrn11 btrn11 closed this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants