Skip to content

chore: release-infra hardening — sigstore attach on dispatch, wildcard langchain ignore, codeql name#40

Merged
alphacrack merged 1 commit into
mainfrom
chore/release-infra-hardening
Jul 23, 2026
Merged

chore: release-infra hardening — sigstore attach on dispatch, wildcard langchain ignore, codeql name#40
alphacrack merged 1 commit into
mainfrom
chore/release-infra-hardening

Conversation

@alphacrack

Copy link
Copy Markdown
Owner

What

Four small fixes that surfaced from the v0.5.0 release cycle, packaged together because each is a single-file change with the same 'invisible to users, matters for maintainers' shape.

Fixes

# File Change
1 publish-pypi.yml Attach step now runs on workflow_dispatch against a v* tag too
2 dependabot.yml Wildcard langchain* ignore for major bumps
3 codeql.yml Drop redundant single-element matrix; check name becomes Analyze (python) (was Analyze (python) (python))
4 apply_branch_protection.sh Update required check to the normalized Analyze (python) name

Why each

(1) sigstore attach on workflow_dispatch. v0.5.0 was published via manual dispatch (gh workflow run publish-pypi.yml --ref v0.5.0) because the first tag-triggered run failed at SBOM generation and had to be re-run after that fix landed. The manual dispatch skipped the "Attach signed artifacts + SBOM" step because it was gated if: github.event_name == 'release' only. Result: the sigstore .sigstore bundles never reached the v0.5.0 Release page; wheel/sdist/SBOM had to be uploaded by hand.

New gate:

if: >-
  github.event_name == 'release' ||
  (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/tags/'))
env:
  TAG_NAME: ${{ github.event.release.tag_name || github.ref_name }}

(2) wildcard langchain ignore. The previous ignore list enumerated 5 packages. v0.5.0 had to close #23 (langchain-ollama 0.2 → 1.1) because it wasn't in that list, and #10 (a grouped langchain PR) because grouped updates bypass per-package ignores. Wildcard langchain* covers current + future family members (langchain-google-*, langchain-xai, etc.) without hand-maintaining the list.

(3) codeql name normalization. With strategy.matrix.language: ["python"], GitHub renders the check as Analyze (python) (python) — the job's literal name: Analyze (python) plus the matrix value appended. Branch protection had to be configured with the redundant name. Removing the matrix (only one language today) gives the cleaner Analyze (python).

(4) apply_branch_protection.sh follow-through. Same-PR update to the required-check name + a comment above the JSON payload documenting the transition, so anyone re-running the script after this lands knows why the required-check name changed.

Verification

  • YAML: publish-pypi.yml, codeql.yml, dependabot.yml parse.
  • JSON in apply_branch_protection.sh still parses (python -c 'import json; json.loads(...)' on extracted heredoc content).
  • codeql.yml no longer references ${{ matrix.language }} (replaced with literal python in both languages: and category:).

Post-merge

  • Re-run ./scripts/apply_branch_protection.sh after this merges — the required-check name changes from Analyze (python) (python) to Analyze (python). Until then, new PRs will show BLOCKED waiting on the old check name that no longer exists.
  • Ready to be included in the next release; no user-facing CHANGELOG entry needed (release infra only).

Related

Checklist

  • YAML/JSON validated
  • No runtime code changes
  • DCO sign-off
  • Small, reviewable diff (4 files, ~35 lines net)

…d langchain ignore, codeql name normalization

Four small fixes that came out of the v0.5.0 release, packaged together
because each is a one-file change with the same "invisible to users,
matters for maintainers" shape.

1) publish-pypi.yml: sigstore attach step now fires on workflow_dispatch too

  Previously the "Attach signed artifacts + SBOM to the GitHub Release"
  step was gated on `event_name == 'release'` only. v0.5.0 was
  dispatched manually via `gh workflow run publish-pypi.yml --ref v0.5.0`
  (because the first tag-triggered run had failed at SBOM generation),
  so the attach step was skipped and the sigstore .sigstore bundles
  never reached the Release page. The wheel/sdist/SBOM had to be
  attached by hand after the fact.

  Fix: broaden the gate to also match `workflow_dispatch` against a v*
  tag ref, and derive TAG_NAME from either github.event.release.tag_name
  (release event) or github.ref_name (dispatch against tag ref).

2) dependabot.yml: wildcard `langchain*` ignore for major bumps

  The previous ignore list enumerated langchain, langchain-core,
  langchain-openai, langchain-anthropic, langchain-community — five
  entries, easy to miss a family member. v0.5.0 had to close #23
  (langchain-ollama 0.2 → 1.1) because langchain-ollama was NOT in
  that list, and #10 (a langchain group PR) because grouped updates
  bypass per-package ignores.

  Fix: `- dependency-name: "langchain*"` covers the whole family
  including future additions (langchain-google-*, langchain-xai, etc.).

3) codeql.yml: drop the redundant single-element matrix

  With `strategy.matrix.language: ["python"]` GitHub rendered the check
  as "Analyze (python) (python)" — the job's `name: Analyze (python)`
  plus the matrix value appended. Branch protection had to encode the
  redundant name to work. Removing the matrix (only one language today)
  gives the cleaner "Analyze (python)".

  If a second language is added later, re-introduce the matrix and
  change `name:` to just "Analyze" so the render becomes `Analyze (foo)`
  without doubling.

4) scripts/apply_branch_protection.sh: update required check to match

  Follows from (3). Now requires "Analyze (python)" (without the
  redundant appendix). A comment above the JSON payload documents the
  transition so anyone re-running this script understands why the
  required-check name changed.

Verified locally:
- publish-pypi.yml YAML parses; if: expression is well-formed.
- codeql.yml YAML parses; ${{ matrix.language }} references removed.
- dependabot.yml YAML parses; wildcard pattern matches langchain-ollama
  and any future langchain-* additions.
- apply_branch_protection.sh JSON payload still parses (checked with
  python's json.loads on the extracted heredoc content).

Signed-off-by: alphacrack <18480504+alphacrack@users.noreply.github.com>
@github-actions github-actions Bot added area:release release.py, publish-pypi.yml, tag flow, PyPI area:ci .github/workflows, pre-commit, release automation labels Jul 23, 2026
@alphacrack
alphacrack merged commit 8cd15b9 into main Jul 23, 2026
20 checks passed
@alphacrack
alphacrack deleted the chore/release-infra-hardening branch July 23, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci .github/workflows, pre-commit, release automation area:release release.py, publish-pypi.yml, tag flow, PyPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant