Skip to content

test(ci): require full-commit Action pins instead of exact commits - #5

Merged
zoeyrose merged 2 commits into
mainfrom
claude/amazing-volta-f6viaz
Oct 16, 2026
Merged

zoeyrose merged 2 commits into
mainfrom
claude/amazing-volta-f6viaz

Conversation

@zoeyrose

@zoeyrose zoeyrose commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

tests/test_dependency_report_retention.py asserted the exact upload-artifact and dependency-review-action commits in the dependency review workflow. That makes every Dependabot Action update fail this test until someone edits it by hand. The test now requires a full 40-character commit pin for both Actions instead.

Implementation / behavior

Two assertions change from assertIn with a fixed commit to assertRegex with @[0-9a-f]{40}(?=\s|$). The workflow and its pins are unchanged. Because whitespace or the end of the value must follow the commit, the test still fails if either Action is pinned to a tag or branch, including a ref that only starts with 40 hex characters, such as <sha>-moving.

This matches the change to the same test in atrinik/atrinik#653, which is already merged.

Validation

  • python3 -m unittest tests.test_dependency_report_retention passes locally.
  • I checked the regex against commented, uncommented and end-of-line pins, which pass, and against <sha>-moving, <sha>x and @v7, which fail.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U2FYdqSaYi8WtMzzgseAMh

The retention policy test asserted the exact upload-artifact and
dependency-review-action commits, so every Dependabot Action update
failed it. Require a full 40-character commit pin instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U2FYdqSaYi8WtMzzgseAMh
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T16:31:38.269710Z dc4f408 PR opened
🔒 Security Review ✅ Completed 2026-10-16T16:33:22.891559Z dc4f408 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc4f408c64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Anchor the pin regex after the 40-hex commit so a movable ref such as
<sha>-moving no longer satisfies the full-commit assertion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U2FYdqSaYi8WtMzzgseAMh
@zoeyrose
zoeyrose merged commit ca6627f into main Oct 16, 2026
10 checks passed
@zoeyrose
zoeyrose deleted the claude/amazing-volta-f6viaz branch October 16, 2026 16:38
zoeyrose added a commit to atrinik/atrinik that referenced this pull request Oct 16, 2026
## Summary

Follow-up to #653. That PR
changed `tests/test_dependency_report_retention.py` to require a
full-commit pin with `@[0-9a-f]{40}\b`. Because `\b` matches before a
hyphen, a movable ref that merely starts with 40 hex characters, such as
`actions/upload-artifact@<sha>-moving`, still passed. Codex found the
same gap in the copy of this test in
atrinik/agent-integrations#5.

## Implementation / behavior

Both assertions now use `@[0-9a-f]{40}(?=[ \t\r\n]|$)`, so only a space,
tab, CR, LF or the end of the value may follow the commit. An earlier
version of this PR used `\s`, which in Python also matches Unicode
whitespace such as U+00A0. YAML keeps that character inside the scalar,
so `<sha><U+00A0>moving` would have passed. The workflow and its pins
are unchanged.

The supply-chain audit already full-matches each workflow ref against
`^[0-9a-f]{40}$`, so it isn't affected.

## Validation

- `python3 -m unittest tests.test_dependency_report_retention`: 15 tests
pass.
- These pass the new pattern: the current `dependency-review.yml`, a pin
followed by a space or tab comment, LF, CRLF or the end of the file.
- These are rejected: `<sha>-moving`, `<sha>` followed by U+00A0 or
U+2003, `<sha>#x`, and `@v7`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01U2FYdqSaYi8WtMzzgseAMh

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants