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

fix: allow some cmds to run outside a project #733

Merged
merged 4 commits into from
Jul 22, 2024
Merged

Conversation

cristiand391
Copy link
Member

@cristiand391 cristiand391 commented Jul 17, 2024

What does this PR do?

Allow the following commands to be run outside an sfdx project:

  • package installed list
  • package list
  • package1 version create

the following ones still require an sfdx project:

  • package delete
  • package update
  • package version displayancestry
  • package version report
  • package version delete
  • package version promote

mostly because the packaging lib expects an SfProject instance to be able to resolve --package being an alias defined in sfdx-project.json.
internal doc: https://salesforce.quip.com/gnuNAtZkcOCP

we haven't decided on this work yet ⬆️

What issues does this PR fix or reference?

forcedotcom/cli#2932
@W-16189175@

@cristiand391 cristiand391 marked this pull request as draft July 17, 2024 20:17
@cristiand391 cristiand391 marked this pull request as ready for review July 19, 2024 17:38
@cristiand391 cristiand391 requested a review from mshanemc July 19, 2024 17:38
@@ -88,7 +87,7 @@ export class PackageListCommand extends SfCommand<PackageListCommandResult> {
NamespacePrefix,
ContainerOptions,
ConvertedFromPackageId,
Alias: this.project!.getAliasesFromPackageId(Id).join(),
Copy link
Member Author

Choose a reason for hiding this comment

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

so this alias info could be different depending on wether this runs inside an sfdx project or not.

@@ -25,7 +25,6 @@ export class Package1VersionCreateCommand extends SfCommand<PackageUploadRequest
public static readonly summary = messages.getMessage('summary');
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static readonly requiresProject = true;
Copy link
Member Author

Choose a reason for hiding this comment

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

didn't see any usage of this.project in the command, probably a leftover from toolbelt migration

@cristiand391
Copy link
Member Author

packag1 NUT failures are unrelated to these changes, you can see the same errors here:
#737

Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

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

ok as is, saw a few things I'd like to be different so #738

mshanemc added 2 commits July 19, 2024 18:14
* refactor: pr comments as code

* test: nut update for column order change, apiversion as number
@mshanemc
Copy link
Contributor

mshanemc commented Jul 22, 2024

QA:

package list
✅ run outside a project
✅ json match
✅ human match

package installed list
✅ run outside a project
✅ json match
✅ human match

package1:version:create
✅ runs, talks to orgs. I was getting a Error (1): Package upload operation via API failed. Package not owned by this organization. for all package1 creates

I don't know which 033 I should be using.

@mshanemc mshanemc merged commit 7d22617 into main Jul 22, 2024
12 of 14 checks passed
@mshanemc mshanemc deleted the cd/no-proj-required branch July 22, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants