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: set 'version' of composer.json in RootComposerUpdatePackages #2201

Merged
merged 8 commits into from
Jan 26, 2024

Conversation

bshaffer
Copy link
Contributor

addresses #2198

Marked as a feat since it changes the behavior of RootComposerUpdatePackage by always updating version in composer.json.

IMPORTANT: The behavior of the php strategy (src/strategies/php.ts) will not change, as version was already being set in the versionsMap. The only difference in the php strategy is in the case where composer.json includes a replace section: the "version" key will no longer be added to it. This is the desired behavior, as adding such a string to replace results in a composer exception.

@bshaffer bshaffer requested review from a team as code owners January 26, 2024 17:01
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Jan 26, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Jan 26, 2024
Comment on lines +34 to +39
if (parsed['version']) {
const fromVersion: string = parsed['version'];
const toVersion = this.version.toString() || '1.0.0';
parsed['version'] = toVersion;
logger.info(`updating "version" from ${fromVersion} to ${toVersion}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add tests for setting this root version entry (with the value set and unset)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this is the kind of test you're looking for? 5093438

@chingor13 chingor13 merged commit 00ae8d1 into main Jan 26, 2024
17 checks passed
@chingor13 chingor13 deleted the fix-root-composer-package-updater branch January 26, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants