Skip to content

Share commit artifact handling across automations - #766

Draft
zaniebot wants to merge 1 commit into
mainfrom
zb/reusable-commit-artifacts
Draft

zaniebot wants to merge 1 commit into
mainfrom
zb/reusable-commit-artifacts

Conversation

@zaniebot

Copy link
Copy Markdown
Collaborator

The rebase, regression-test, and bug-fix automations each package and import Git bundles. Add shared persist-commit and load-commit actions that pass an immutable artifact ID and expected commit SHA, require exactly the expected bundle ref, and verify ancestry without checking out the received code. Keep workflow-specific publication checks and credential gates in the callers, and restore the trusted workflow revision before invoking the local actions.

@astral-automations-bot astral-automations-bot Bot added internal:automations Related to internal automations security labels Aug 28, 2026
@zaniebot zaniebot added priority:3 Normal: useful features, documentation, usability, or routine efficiency improvements. size:4 Complex: architectural or security-sensitive work requiring broad or cross-repository context. risk:1 Negligible risk of localized mistakes that are obvious and easy to correct. labels Sep 9, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/reusable-commit-artifacts branch from 0cb6d3e to ff425eb Compare October 23, 2026 00:20
FIXED_HEAD_SHA: ${{ steps.load-fix.outputs.head-sha }}
GIT_CONFIG_GLOBAL: /dev/null
GIT_CONFIG_NOSYSTEM: "1"
PARENT_HEAD_SHA: ${{ inputs.parent-head-sha }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P2] Use the resolved parent SHA in the split verifier

When the regression-test branch advances beyond inputs.parent-head-sha, preparation deliberately resolves and validates the newer head, then creates or reuses the fix on that revision. This new step instead compares the fix’s parent with the original input, rejecting a valid fix. I reproduced that failure with the extracted verification step; supplying the resolved parent succeeds. Use needs.fix.outputs.parent-head-sha here, and consistently pass the resolved parent to the persist/load actions.


def test_reject_invalid_revisions(self):
for base, head in [
("main", self.head),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P3] Test SHA-only validation with a resolvable branch

The fixture does not create main, so this case fails on a missing object even without the full-SHA validation. Removing both SHA regex guards in a temporary copy left this test passing, while a branch pointing to self.base was accepted. Create an explicit branch at self.base and reject that name in a focused named test, so the test protects the full-SHA requirement rather than missing-object handling.

This branch has not been deployed

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

Labels

internal:automations Related to internal automations priority:3 Normal: useful features, documentation, usability, or routine efficiency improvements. risk:1 Negligible risk of localized mistakes that are obvious and easy to correct. security size:4 Complex: architectural or security-sensitive work requiring broad or cross-repository context.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants