-
Notifications
You must be signed in to change notification settings - Fork 9
W-16286213 feat: make project optional #771
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
Conversation
| public async run(): Promise<PackageVersionListCommandResult> { | ||
| const { flags } = await this.parse(PackageVersionListCommand); | ||
| const connection = flags['target-dev-hub'].getConnection(flags['api-version']); | ||
| const project = SfProject.getInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this command didn't have requiresProject = true but this line was enforcing it anyway.
| import Package2VersionStatus = PackagingSObjects.Package2VersionStatus; | ||
|
|
||
| const pkgVersionCreateErrorResult: Partial<PackageVersionCreateRequestResult> = { | ||
| const pkgVersionCreateErrorResult: PackageVersionCreateRequestResult = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this type changed here:
forcedotcom/packaging#627
mshanemc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does package:version:update need a Project? It doesn't look like it's reading the project (flags for tag, branch, etc passed as inputs to the method).
I'm going to ask Vivek about the sfdx-projecet modification commetns.
| public static readonly examples = messages.getMessages('examples'); | ||
| public static readonly deprecateAliases = true; | ||
| public static readonly aliases = ['force:package:version:delete']; | ||
| public static readonly requiresProject = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm...[unrelated to this PR] I would have expected the delete command to remove the packageVersion from my project.
I guess it never has (and this was that whole "delete doesn't really delete, just deprecates" so maybe that's correct?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so maybe that should happen if there's a project, but it's not required?
| public static readonly examples = messages.getMessages('examples'); | ||
| public static readonly deprecateAliases = true; | ||
| public static readonly aliases = ['force:package:delete']; | ||
| public static readonly requiresProject = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also would have expected this to modify sfdx-project after deleting the pkg
| public static readonly examples = messages.getMessages('examples'); | ||
| public static readonly deprecateAliases = true; | ||
| public static readonly aliases = ['force:package:update']; | ||
| public static readonly requiresProject = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same (I'd expect it to update the packageDirectories description/etc with my changes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mshanemc - I tested something similar with package version update.
I updated the --version-name and --version-description. Both were updated in the DevHub, but neither impacted sfdx-project.json
src/utils/getProject.ts
Outdated
| } catch (err) { | ||
| if (err instanceof Error && err.name === 'InvalidProjectWorkspaceError') { | ||
| return undefined; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any swallow all other errors?
What's the logic of checking the error name then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the logic of checking the error name then?
none, I think I was just following the error msg from SfProject.resolve's jsdoc.
Changed to make it swallow all errors that could come from trying to resolve a project.
@mshanemc - Perhaps This would only happen if the I've tested this from inside a project. I updated the |
|
QA cont ✅ |

DEPENDS ON https://github.com/forcedotcom/packaging/pull/638/files
What does this PR do?
forcedotcom/cli#2932
Allow the following commands to be run outside an sfdx project:
package deletepackage updatepackage version deletepackage version displayancestrypackage version listpackage version promotepackage version reportWhat issues does this PR fix or reference?
@W-16286213@