-
-
Notifications
You must be signed in to change notification settings - Fork 228
fix: look up and pass stage 1 name #2032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThe PR adds a step to the AMI release GitHub Actions workflow that discovers a stage 1 AMI ID by querying AWS for an image tagged with postgresVersion and sourceSha in the region derived from the Packer config, validates it, and exposes it as STAGE1_AMI_ID. The stage 2 Packer build step is updated to pass that AMI ID as the Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/workflows/ami-release-nix.yml:
- Around line 97-99: The REGION extraction using grep '^region=' is brittle and
can yield an empty value; update the REGION assignment (where PG_VERSION and
REGION are set) to use a more flexible pattern that accepts optional spaces and
quotes (e.g., match lines like region = "us-east-1") and trim surrounding
quotes/whitespace, then add a guard after REGION is computed to validate it is
non-empty and exit with a clear error message if missing so the workflow fails
fast with a helpful diagnostic.
- Around line 102-110: The describe-images query that sets STAGE1_AMI_ID
currently uses Images[0] which is unordered; update the AWS CLI --query to sort
images by CreationDate and select the newest one deterministically (e.g. use
sort_by(Images,&CreationDate)[-1].ImageId or equivalent) so STAGE1_AMI_ID always
picks the most recently created AMI matching the filters; modify the command
that sets STAGE1_AMI_ID accordingly.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.