Skip to content

@W-21768097 Block sf package convert calls outside of sfdx project directory#1160

Merged
iowillhoit merged 3 commits intomainfrom
t/2gp-readiness/w-21768097/block-conversion-not-in-project
Apr 9, 2026
Merged

@W-21768097 Block sf package convert calls outside of sfdx project directory#1160
iowillhoit merged 3 commits intomainfrom
t/2gp-readiness/w-21768097/block-conversion-not-in-project

Conversation

@ravipanguluri
Copy link
Copy Markdown
Collaborator

What does this PR do?

This PR sets the requiresProject field to true for the convert command via the CLI so that users fail fast when trying to convert outside of a sfdx-project directory. Before customers were receiving an ambiguous error that was not indicative of the true nature of the issue.

What issues does this PR fix or reference?

See @W-21768097@

@ravipanguluri ravipanguluri force-pushed the t/2gp-readiness/w-21768097/block-conversion-not-in-project branch from 66e4c78 to 83ccd8d Compare April 9, 2026 17:33
public static readonly examples = messages.getMessages('examples');
public static readonly deprecateAliases = true;
public static readonly aliases = ['force:package:convert'];
public static readonly requiresProject = true;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this boolean actually doing anything? I don't see it referenced in your PR besides the unit test

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's used within logic that's in the sf-plugins-core. When the parameter is true, then during the command initialization we attempt to resolve an sf project directory from the current working directory. If it doesn't exist then an error is thrown. This does bring up that the point that the unit test is not particularly useful.

@iowillhoit iowillhoit merged commit 987f647 into main Apr 9, 2026
15 checks passed
@iowillhoit iowillhoit deleted the t/2gp-readiness/w-21768097/block-conversion-not-in-project branch April 9, 2026 20:17
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