Skip to content

fix(manifest): apply per-package snapshot-label from config#2780

Open
LudovicTOURMAN wants to merge 1 commit into
googleapis:mainfrom
LudovicTOURMAN:fix/extract-snapshot-label
Open

fix(manifest): apply per-package snapshot-label from config#2780
LudovicTOURMAN wants to merge 1 commit into
googleapis:mainfrom
LudovicTOURMAN:fix/extract-snapshot-label

Conversation

@LudovicTOURMAN
Copy link
Copy Markdown

Summary

extractReleaserConfig did not map per-package snapshot-label, and
mergeReleaserConfig did not propagate 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.

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:

  1. extractReleaserConfig maps label, release-label, extra-label
    but omitted snapshot-label.
  2. mergeReleaserConfig propagated extraLabels from the default into
    per-package configs but not snapshotLabels, so root-level values
    never reached per-package strategies.

The schema (schemas/config.json) and the TypeScript interface already
accepted snapshot-label — only the runtime wiring was missing.

Why moving config to root does not fix it on its own

Root-level snapshot-label flows through parseConfig into
manifestOptions.snapshotLabels and is assigned to
Manifest.snapshotLabels, but that field is only used (in
manifest.ts) as a matcher when scanning existing open PRs. It does
not flow back to the strategy that labels new snapshot PRs. Both fixes
are required.

Changes

  • src/manifest.ts — map snapshot-label in extractReleaserConfig;
    propagate snapshotLabels in mergeReleaserConfig.
  • test/fixtures/manifest/config/snapshot-labels.json — new fixture
    mirroring extra-labels.json.
  • test/manifest.ts — new test covering both the root-level matcher
    and the per-package merge/override.

Compatibility

  • No API or schema change. The TS type was already in place.
  • Configs that did not declare snapshot-label are unaffected.
  • Configs that declared it expecting the (buggy) no-op behavior now
    get the documented behavior.

@LudovicTOURMAN LudovicTOURMAN requested review from a team as code owners May 20, 2026 13:47
@product-auto-label product-auto-label Bot added the size: s Pull request size is small. label May 20, 2026
@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 20, 2026

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.
@LudovicTOURMAN LudovicTOURMAN force-pushed the fix/extract-snapshot-label branch from 1cde11c to 64ab90d Compare May 20, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java snapshot PRs ignore configured snapshot-label (per-package and root)

2 participants