chore: release-infra hardening — sigstore attach on dispatch, wildcard langchain ignore, codeql name#40
Merged
Conversation
…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>
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.
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
publish-pypi.ymlworkflow_dispatchagainst a v* tag toodependabot.ymllangchain*ignore for major bumpscodeql.ymlAnalyze (python)(wasAnalyze (python) (python))apply_branch_protection.shAnalyze (python)nameWhy 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 gatedif: github.event_name == 'release'only. Result: the sigstore.sigstorebundles never reached the v0.5.0 Release page; wheel/sdist/SBOM had to be uploaded by hand.New gate:
(2) wildcard langchain ignore. The previous ignore list enumerated 5 packages. v0.5.0 had to close #23 (
langchain-ollama0.2 → 1.1) because it wasn't in that list, and #10 (a grouped langchain PR) because grouped updates bypass per-package ignores. Wildcardlangchain*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 asAnalyze (python) (python)— the job's literalname: 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 cleanerAnalyze (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
publish-pypi.yml,codeql.yml,dependabot.ymlparse.apply_branch_protection.shstill parses (python -c 'import json; json.loads(...)'on extracted heredoc content).codeql.ymlno longer references${{ matrix.language }}(replaced with literalpythonin bothlanguages:andcategory:).Post-merge
./scripts/apply_branch_protection.shafter this merges — the required-check name changes fromAnalyze (python) (python)toAnalyze (python). Until then, new PRs will show BLOCKED waiting on the old check name that no longer exists.Related
Checklist