Skip to content

ci: add gate, preflight and verification to testing image release - #718

Open
nvasiu wants to merge 2 commits into
mainfrom
gate-ecr-release
Open

nvasiu wants to merge 2 commits into
mainfrom
gate-ecr-release

Conversation

@nvasiu

@nvasiu nvasiu commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

Related to #716

Description of changes:

The ecr-release.yml action would previously run for every monorepo release, regardless if the release included a new version for the testing package or not. So it was possible for this action to publish the latest changes of the testing package before they were released. This PR updates the action to be safer.

.github/workflows/ecr-release.yml

  • Add a preflight job to parse the release tag, verify the tag matches the source, check if the version already exists in public ECR, and emit a plan.
  • Gates the build on the above preflight checks.
  • Add a post-publish verification that polls public ECR (polls 10 times with 15s wait = 150s total) and confirms that the new version was published.

.github/scripts/parse_testing_version.py

  • Separate script for parsing the testing version from a release tag.

.github/scripts/tests/test_parse_testing_version.py

  • Unit testing for the parsing script.

.github/workflows/test-parser.yml

  • Wire the new script and test into the script-test workflow.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@nvasiu
nvasiu deployed to ai-pr-review-runtime September 10, 2026 23:21 — with GitHub Actions Active
@nvasiu
nvasiu deployed to ai-pr-review-runtime September 10, 2026 23:29 — with GitHub Actions Active
Comment thread .github/workflows/ecr-release.yml Outdated
@github-actions

This comment has been minimized.

@nvasiu nvasiu changed the title ci: gate testing image publish on testing release ci: add gate, preflight and verification to testing image release Sep 11, 2026
@nvasiu
nvasiu deployed to ai-pr-review-runtime September 11, 2026 18:35 — with GitHub Actions Active
Comment thread .github/workflows/ecr-release.yml Outdated
Comment thread .github/workflows/ecr-release.yml Outdated
Comment thread .github/workflows/ecr-release.yml Outdated
Comment thread .github/scripts/parse_testing_version.py Outdated
@github-actions

This comment has been minimized.

@yaythomas yaythomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The preflight and verification confirm that an image tag exists. They do not confirm the image contains what the release names. The Dockerfile installs aws-durable-execution-sdk-python>=1.0.0, resolved at build time and unbounded, so two builds of one testing version can produce different images, and skip-if-exists assumes a version identifies one artifact.

(The other three points are on the relevant lines.)

Comment thread .github/workflows/ecr-release.yml Outdated
Comment thread .github/scripts/parse_testing_version.py Outdated
Comment thread .github/workflows/ecr-release.yml Outdated
@nvasiu
nvasiu deployed to ai-pr-review-runtime September 11, 2026 22:48 — with GitHub Actions Active
Comment thread .github/workflows/ecr-release.yml
Comment thread .github/workflows/ecr-release.yml Outdated
Comment thread .github/workflows/ecr-release.yml Outdated
Comment thread .github/workflows/ecr-release.yml Outdated
@github-actions

This comment has been minimized.

@nvasiu
nvasiu deployed to ai-pr-review-runtime September 14, 2026 20:51 — with GitHub Actions Active
Comment thread .github/workflows/ecr-release.yml Outdated
@github-actions

This comment has been minimized.

@nvasiu

nvasiu commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@yaythomas
Re: #718 (review)

Yes, the preflight confirms that a tag exists, but it's not guaranteed that the image matches the release. And skip-if-exists assumes a version maps to one image, which is not true while we have an unbounded SDK dependency.

But this workflow's current policy is that if a version is already published to ECR, we won't ever overwrite it. So it shouldn't ever be a concern that the user will get different SDK versions from the same image version.

But for the sake of reproducing the image on the ECR in the future / visiblity into what SDK version the image is using, we could:

  • Pin the SDK dependency in the Dockerfile.
  • Or label images with which SDK version they are using (doesn't prevent different images per version, but lets us detect them).

I think either of these option would need some more discussion, and are out of scope for this PR. But if we want to implement either of those, they would be compatible with this PR.

@nvasiu
nvasiu force-pushed the gate-ecr-release branch 2 times, most recently from 5d8d07a to a4e387c Compare September 14, 2026 21:38
@nvasiu
nvasiu deployed to ai-pr-review-runtime September 14, 2026 21:45 — with GitHub Actions Active
@nvasiu
nvasiu deployed to ai-pr-review-runtime September 14, 2026 21:59 — with GitHub Actions Active
Comment on lines +266 to +268
concurrency:
group: ecr-release-latest
cancel-in-progress: false

This comment was marked as outdated.

Comment thread .github/workflows/ecr-release.yml Outdated
echo "::error::Could not list existing tags in public ECR to decide the latest check."
exit 1
}
newest="$(python .github/scripts/is_newest_testing_version.py --candidate "$VERSION" $existing_tags)"

This comment was marked as outdated.

Comment thread .github/workflows/ecr-release.yml Outdated
Comment on lines +27 to +34
- name: Require the ECR upload role secret
env:
ECR_UPLOAD_IAM_ROLE_ARN: ${{ secrets.ECR_UPLOAD_IAM_ROLE_ARN }}
run: |
if [[ -z "$ECR_UPLOAD_IAM_ROLE_ARN" ]]; then
echo "::error::Secret ECR_UPLOAD_IAM_ROLE_ARN is not set. Restore it before releasing."
exit 1
fi

This comment was marked as outdated.

@github-actions

This comment has been minimized.

@nvasiu
nvasiu deployed to ai-pr-review-runtime September 18, 2026 20:31 — with GitHub Actions Active
Comment on lines +301 to +304
if ! existing_tags="$(aws ecr-public describe-images \
--region "${{ env.aws_region }}" \
--repository-name "$repo_name" \
--query 'imageDetails[].imageTags[]' --output text)"; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codex AI review · Finding arf_v1_otspk2nucjnfic2v5zdpbwiemx

[P1] This first registry read after pushing v$VERSION is performed only once. A successful but stale response can omit the new tag; the first release then fails, while later releases can repoint latest to an older image. Poll until the just-pushed version is visible, then compute the maximum from that successful snapshot before creating latest.

continue
if highest is None or version > highest:
highest = version
return f"v{highest}" if highest is not None else ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codex AI review · Finding arf_v1_lyc34vjl7rp77kru74lga6sulz

[P2] Converting Version back to text normalizes the original tag. For the explicitly accepted v2.0.0-beta, this returns v2.0.0b0, so the workflow searches for architecture tags it never published and the release fails. Track and return the original highest tag, and add a -beta regression case.

Comment on lines +351 to +356
digest_for() {
aws ecr-public describe-images \
--region "${{ env.aws_region }}" \
--repository-name "$repo_name" \
--image-ids imageTag="$1" \
--query 'imageDetails[0].imageDigest' --output text 2>/dev/null || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codex AI review · Finding arf_v1_rrlqy3ac6xtucifop56pikyykn

[P2] digest_for converts every lookup failure into an empty value, and the later equality considers two empty values equal. Concurrent transient failures for latest and the newest version can therefore make verification pass without proving either digest exists. Propagate lookup failures and explicitly reject empty or None digests before comparing them.

@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

Found three actionable release-path issues, including a race that can leave latest stale during normal registry propagation. The new tests do not cover these workflow-level failure modes.

Reviewed commit edaee67dd29442aca338074a3b3a7b6632e1d959. Workflow run

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