Skip to content

fix(release): resolve the release base branch instead of hardcoding master - #193

Merged
Shinrai merged 3 commits into
nextfrom
fix/release-base-branch-detection
Aug 3, 2026
Merged

Shinrai merged 3 commits into
nextfrom
fix/release-base-branch-detection

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

No other changes

👥 Contributors

…aster

main-default repos (no `master` branch) couldn't cut a release: the next/hotfixes
release workflows failed at `git fetch origin master`, so the persistent
`next → <default>` release PR was never created (CLDMV/polyfillme, CLDMV/cpm).

Add a dedicated `git/utilities/resolve-release-base` action that resolves the
base in priority order: the `CLDMV_RELEASE_BASE` Actions variable → the reusable
workflow's `default_branch` input → the API `repository.default_branch` →
`master`. Thread it through the release path:
- workflow-next-release.yml / workflow-hotfixes-release.yml resolve once in the
  plan job and use it for fetch / rev-list / `gh pr list --base`, passing it to
  create/update-release-pr.
- create-release-pr / update-release-pr fetch the resolved base and feed it to
  divergence.mjs / find-divergence (which use it when set, else keep the
  master→main heuristic) and to the changelog's release-PR filter.
- pending-release-reminder queries the resolved base instead of `master`.

Backward compatible: master-default repos resolve to `master` and every step
behaves exactly as before. New action ships via @v4.

Known follow-ups (non-blocking): the `! release → master` flow label stays a
fixed marker (changing it risks label-keyed release-PR detection); the reminder
honors the var + API default but not a yaml-input-only base config.

Fixes #192
@cldmv-bot cldmv-bot Bot added ! fix → next v4 flow: fix contributor PR targeting the next integration branch area: core Touches core library / runtime source code type: ci Changes to CI workflows, actions, or build pipelines labels Aug 3, 2026
The `! release → <base>` / `! hotfix release → <base>` flow labels were still
hardcoded to `master`, so a main-default repo's release PR was mislabeled
"→ master" even though its base was correct. Derive the base from the same
resolved value as the PR's base branch so the label reflects the actual target.

The managed-labels allowlist now includes the master/main (and, when custom, the
resolved-base) flow-label variants so a stale lane label prunes across a
default-branch change — and update-release-pr re-derives the label on every
refresh, so the no-var + default-changed case self-heals. Added the
`! release → main` / `! hotfix release → main` entries to data/github-labels.json
so they're defined + styled rather than auto-created gray.
@cldmv-bot cldmv-bot Bot added the type: config Changes to repository or project configuration files label Aug 3, 2026
Shinrai
Shinrai previously approved these changes Aug 3, 2026
…eQL)

The #192 change interpolated the resolved DEFAULT_BRANCH into the git command
STRING passed to tryGit → execSync (a shell), which CodeQL flags as
js/indirect-command-line-injection (the two alerts blocking PR #193). The base
is repo config (a variable / workflow input / API default_branch), never PR
content, so it is effectively a false positive — but the correct, gate-clearing
fix is real: add an argv-based tryGitArgs (execFileSync, no shell) and route the
base-interpolated merge-base + `git show <base>:package.json` calls through it.
The literal master/main heuristic calls stay on the shell path unchanged.
@Shinrai
Shinrai merged commit 16e99bf into next Aug 3, 2026
14 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/release-base-branch-detection branch August 3, 2026 04:45
Shinrai added a commit that referenced this pull request Aug 3, 2026
…elease opener

resolve-release-base (added in #193) isn't on the @v4 tag yet, and .github runs
its own release from next's copy of workflow-next-release.yml, which referenced
the action @v4 — so the Plan job failed at action-download and no release PR
opened. Pin the resolver step in both release workflows to a next commit that
has the action; a follow-up flips the pin back to @v4 once it ships to the tag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code ! fix → next v4 flow: fix contributor PR targeting the next integration branch type: ci Changes to CI workflows, actions, or build pipelines type: config Changes to repository or project configuration files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant