Skip to content

Fix: declare secrets in compose-maven-merge - #897

Merged
ModeSevenIndustrialSolutions merged 1 commit into
lfit:mainfrom
askb:fix/compose-maven-merge-declare-secrets
Sep 1, 2026
Merged

ModeSevenIndustrialSolutions merged 1 commit into
lfit:mainfrom
askb:fix/compose-maven-merge-declare-secrets

Conversation

@askb

@askb askb commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

compose-maven-merge reads secrets.NEXUS_*, secrets.CENTRAL_*, secrets.ARTIFACTORY_ACCESS_TOKEN and secrets.SIGUL_* but declares no secrets: block, so callers had to rely on secrets: inherit.

inherit only propagates secrets to a reusable workflow in the same organisation or enterprise. A caller in another organisation inherits nothing and every secret arrives empty.

Observed failure

opendaylight/infrautils (org opendaylight) calling this workflow (org lfit) — run 33520727430:

Validating inputs...
Error: nexus_password is required ❌

The vars.* lookups resolved fine in the same run (nexus_server=https://nexus.opendaylight.org, repository_name=opendaylight.snapshot) because vars are not subject to that restriction — only secrets are. That contrast is what pinpoints the cause.

The sibling gerrit-ci-management-merge.yaml already avoids this: it declares its secrets, and opendaylight/releng-builder passes them by name.

Change

Declare all twelve secrets the workflow consumes. Every one is required: false, so:

  • a caller supplies only the secrets its enabled PUSH_* / SIGUL_SIGN paths actually consume;
  • same-organisation callers using secrets: inherit are unaffected.

Verification

Declared set matches referenced set exactly (12 names, no undeclared uses, no dead declarations):

import re, yaml
raw = open(".github/workflows/compose-maven-merge.yaml").read()
d = yaml.safe_load(raw)
on = d.get("on", d.get(True))       # YAML 1.1 parses bare `on:` as True
declared = set((on["workflow_call"].get("secrets") or {}).keys())
used = set(re.findall(r"secrets\.([A-Za-z_][A-Za-z0-9_]*)", raw))
assert used == declared, (used ^ declared)

pre-commit run --files .github/workflows/compose-maven-merge.yaml passes (yamllint, actionlint, workflow validators).

@github-actions github-actions Bot added the bug Something isn't working label Sep 1, 2026
compose-maven-merge reads secrets.NEXUS_*, secrets.CENTRAL_*,
secrets.ARTIFACTORY_ACCESS_TOKEN and secrets.SIGUL_* but declared no
secrets block, so callers had to rely on "secrets: inherit".

That keyword only propagates secrets to a reusable workflow in the same
organisation or enterprise. A caller in another organisation inherits
nothing, and every secret arrives empty.

opendaylight/infrautils hit exactly this: the shared workflow resolved
vars.NEXUS_SERVER and vars.NEXUS_REPO correctly, because vars are not
subject to that restriction, while nexus-publish-action aborted with
"Error: nexus_password is required". The sibling
gerrit-ci-management-merge workflow already avoids the problem by
declaring its secrets and having callers pass them by name.

Declare all twelve secrets the workflow consumes. Each is optional, so a
caller supplies only the ones its enabled PUSH_*/SIGUL_SIGN paths need,
and same-organisation callers using "secrets: inherit" keep working.

Verified the declared set matches the referenced set exactly, twelve
names, with no undeclared uses and no dead declarations:

  python3 - <<'PY'
  import re, yaml
  raw = open(".github/workflows/compose-maven-merge.yaml").read()
  d = yaml.safe_load(raw)
  on = d.get("on", d.get(True))
  declared = set((on["workflow_call"].get("secrets") or {}).keys())
  used = set(re.findall(r"secrets\.([A-Za-z_][A-Za-z0-9_]*)", raw))
  assert used == declared, (used ^ declared)
  PY

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
@askb askb changed the title fix: declare secrets in compose-maven-merge Fix: declare secrets in compose-maven-merge Sep 1, 2026
@askb
askb force-pushed the fix/compose-maven-merge-declare-secrets branch from 93b11c1 to 94c1e05 Compare September 1, 2026 15:05
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit d687ef6 into lfit:main Sep 1, 2026
12 checks passed
@askb

askb commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Flagging this as review-blocking rather than routine.

opendaylight/infrautils has already migrated its maven-merge job to call this workflow (opendaylight/infrautils@6e933bc6), and the corresponding Jenkins job is now disabled. Because secrets: inherit does not cross organisations, the shared workflow currently receives an empty nexus_password and publish-nexus aborts:

Validating inputs...
Error: nexus_password is required ❌

Net effect: infrautils SNAPSHOTs are not being published at all right now — Jenkins is off, and the GHA path cannot authenticate. Nexus still shows buildNumber=7 from the pre-migration workflow. Downstream ODL projects consuming those SNAPSHOTs will go stale.

This PR is the fix, and the dependent caller change is staged at infrautils 125669 (held WIP until this merges).

The change is additive and low risk:

  • all twelve secrets are required: false, so no existing caller signature changes;
  • same-organisation callers using secrets: inherit keep working exactly as before;
  • it mirrors what gerrit-ci-management-merge.yaml in this repo already does, which is how opendaylight/releng-builder passes its Jenkins credentials successfully today.

All 12 checks are green. A review whenever someone has a moment would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants