fix(manifest): apply per-package snapshot-label from config#2780
Open
LudovicTOURMAN wants to merge 1 commit into
Open
fix(manifest): apply per-package snapshot-label from config#2780LudovicTOURMAN wants to merge 1 commit into
LudovicTOURMAN wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
`extractReleaserConfig` was not mapping the `snapshot-label` key from per-package `release-please-config.json` blocks, and `mergeReleaserConfig` was not propagating it from the root default into per-package configs. As a result, Java/Maven snapshot PRs fell back to `DEFAULT_SNAPSHOT_LABELS` (`['autorelease: snapshot']`) regardless of configuration.
1cde11c to
64ab90d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extractReleaserConfigdid not map per-packagesnapshot-label, andmergeReleaserConfigdid not propagate it from the root default intoper-package configs. As a result, Java/Maven snapshot PRs fell back to
DEFAULT_SNAPSHOT_LABELS(['autorelease: snapshot']) regardless ofconfiguration.
This PR adds the missing mappings and a regression test.
Fixes #2779.
Reproduction (before this PR)
{ "release-type": "maven", "snapshot-label": "team-a", "packages": { ".": { "snapshot-label": "team-a,team-b" } } }Expected: snapshot PRs carry the configured labels.
Observed: snapshot PRs carry only
autorelease: snapshot.Root cause
Two missing wirings in
src/manifest.ts:extractReleaserConfigmapslabel,release-label,extra-labelbut omitted
snapshot-label.mergeReleaserConfigpropagatedextraLabelsfrom the default intoper-package configs but not
snapshotLabels, so root-level valuesnever reached per-package strategies.
The schema (
schemas/config.json) and the TypeScript interface alreadyaccepted
snapshot-label— only the runtime wiring was missing.Why moving config to root does not fix it on its own
Root-level
snapshot-labelflows throughparseConfigintomanifestOptions.snapshotLabelsand is assigned toManifest.snapshotLabels, but that field is only used (inmanifest.ts) as a matcher when scanning existing open PRs. It doesnot flow back to the strategy that labels new snapshot PRs. Both fixes
are required.
Changes
src/manifest.ts— mapsnapshot-labelinextractReleaserConfig;propagate
snapshotLabelsinmergeReleaserConfig.test/fixtures/manifest/config/snapshot-labels.json— new fixturemirroring
extra-labels.json.test/manifest.ts— new test covering both the root-level matcherand the per-package merge/override.
Compatibility
snapshot-labelare unaffected.get the documented behavior.