Skip to content

Conversation

@samrose
Copy link
Collaborator

@samrose samrose commented Jan 31, 2026

  1. After stage 1 completes, a new "Find stage 1 AMI" step queries AWS for the AMI by:
    • postgresVersion tag = ${version}-stage1
    • sourceSha tag = ${GIT_SHA} (unique to this build)
  2. Exports STAGE1_AMI_ID to the environment for the next step
  3. Stage 2 now receives -var "source_ami=${STAGE1_AMI_ID}"

Summary by CodeRabbit

  • Chores
    • Pipeline now automatically discovers and validates the appropriate base image for stage 2 builds, reducing manual configuration and improving build reliability.
    • Postgres platform mappings updated to newer patch releases for 17 and 15 series (including the OrioleDB variant), ensuring deployments use up-to-date minor/patch versions.

✏️ Tip: You can customize this high-level summary in your review settings.

@samrose samrose requested review from a team as code owners January 31, 2026 03:33
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

The 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 source_ami variable. Separately, ansible/vars.yml bumps three Postgres release strings (postgresorioledb-17, postgres17, postgres15) to new patch versions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

ci, infrastructure, ami

Suggested reviewers

  • hunleyd
  • LGUG2Z
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: look up and pass stage 1 name' is vague and doesn't clearly convey what is being looked up or passed. The phrase 'stage 1 name' is ambiguous—it could refer to an AMI ID, a name, or other identifiers. Revise the title to be more specific, such as 'fix: look up and pass stage 1 AMI ID to stage 2 build' to clearly indicate the primary change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly outlines the three key changes: querying AWS for stage 1 AMI using specific tags, exporting STAGE1_AMI_ID, and passing it to stage 2. It provides sufficient detail about the implementation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sam/source-ami-fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.

@samrose samrose enabled auto-merge January 31, 2026 04:53
@samrose samrose added this pull request to the merge queue Jan 31, 2026
Merged via the queue into develop with commit 28fe8c1 Jan 31, 2026
22 checks passed
@samrose samrose deleted the sam/source-ami-fix branch January 31, 2026 06:21
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.

3 participants