Skip to content

docs(release): fix release procedure — 5 functions, missing params, DefaultAMI bump#85

Merged
kaio6fellipe merged 1 commit into
mainfrom
docs/release-5-functions-defaultami
Jun 8, 2026
Merged

docs(release): fix release procedure — 5 functions, missing params, DefaultAMI bump#85
kaio6fellipe merged 1 commit into
mainfrom
docs/release-5-functions-defaultami

Conversation

@kaio6fellipe

@kaio6fellipe kaio6fellipe commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Why

While running the v1.0.0-rc.5 release + prod rollout, docs/release.md was found to be out of date with the live jit-runners CloudFormation stack:

  1. 5 functions, not 4 — the stack now includes rebalancer (5 Lambdas, 5 S3 keys). The doc documented only webhook/scaleup/scaledown/lifecycle.
  2. Missing parameters — the documented update-stack omitted RebalancerLambdaS3Key, RunnerVersion, and DefaultInstanceType. With --use-previous-template, CloudFormation requires every parameter, so the documented command would fail on the current 19-parameter stack.
  3. No DefaultAMI bump — the AMI build (ami-build.yml) auto-runs on the release tag, but the procedure never captured the new AMI or rolled it into the stack.

What changed

  • Scope note → 5 functions.
  • Pre-flight + verify loops include jit-runners-rebalancer.
  • Asset rename + S3 upload include rebalancer.zip.
  • New step 2b — capture the tag-built AMI ID (NEW_AMI) from us-east-2.
  • step 5 update-stack now lists all 19 parameters: adds RebalancerLambdaS3Key, RunnerVersion, DefaultInstanceType; sets DefaultAMI=${NEW_AMI} (with a note to use UsePreviousValue if not rolling the image); MaxReEnqueueAttemptsUsePreviousValue (was a one-time =3).
  • Rollback block updated to match (adds the 3 params; notes reverting DefaultAMI).
  • Refreshed vPREV reference to v1.0.0-rc.4.

Verified against the live stack during the rc.5 rollout (the corrected 19-param command is exactly what succeeded).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated release procedure documentation with expanded deployment steps and improved verification and rollback guidance.

…DefaultInstanceType params and DefaultAMI bump step

The live jit-runners stack has 5 Lambda functions (rebalancer added) and 19
parameters; the documented update-stack omitted RebalancerLambdaS3Key,
RunnerVersion, and DefaultInstanceType, so it would fail on the current stack.
Also documents bumping DefaultAMI to the tag-built AMI (new step 2b + step 5).

Signed-off-by: Kaio Fellipe <kaio6fellipe@gmail.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation jit-runners labels Jun 8, 2026
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Updated release procedure documentation in docs/release.md to integrate a new jit-runners-rebalancer Lambda function and add AMI capture workflow. Changes expand scope definitions, pre-flight checks, S3 asset uploads, CloudFormation parameters, post-deploy verification, and rollback instructions to handle both the rebalancer Lambda and runner image AMI updates.

Changes

Release Procedure Documentation Update

Layer / File(s) Summary
Release scope and pre-flight preparation
docs/release.md
Expanded scope to include jit-runners-rebalancer as fifth Lambda function, updated pre-flight CodeSha256 capture loop to cover all five Lambdas, added rebalancer zip asset renaming and S3 upload, and inserted new "2b. Capture the new AMI ID" step that waits for tag-triggered AMI build and captures public AMI ID from EC2.
Deployment, verification, and rollback procedures
docs/release.md
Updated CloudFormation update-stack parameters to pass RebalancerLambdaS3Key and set DefaultAMI to newly captured AMI value (or UsePreviousValue when skipping runner image rollout); expanded post-deploy verification loop to cover all five Lambdas; updated rollback instructions to optionally roll back runner image by setting DefaultAMI to previous AMI value and included rebalancer parameter overrides in rollback command.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • devopsfactory-io/jit-runners#42: Both PRs modify the release procedure in docs/release.md to document Lambda deployment workflows including CodeSha256 capture, S3 asset versioning, CloudFormation parameter handling, and rollback via previous S3 keys.

Suggested labels

documentation, jit-runners

Poem

🐰 A rebalancer hop-hops into the fold,
With AMI capture, both new and bold.
Five Lambdas dance, verified with care,
Release procedure updated with flair—
Rollback paths clear, no need to despair! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and specifically describes the main changes: fixing the release procedure documentation with updates for 5 functions, missing CloudFormation parameters, and DefaultAMI handling.
Description check ✅ Passed The description includes detailed context (Why section), comprehensive change summary (What changed section), and verification notes, though it does not follow the template structure with required sections like 'What is this feature?' and formal checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/release-5-functions-defaultami

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.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

OpenSSF Scorecard — 8.3/10 ✅

Check Score Details
Binary-Artifacts 10/10 no binaries found in the repo
CI-Tests 10/10 24 out of 24 merged PRs checked by a CI test -- score normalized to 10
Code-Review 0/10 Found 0/30 approved changesets -- score normalized to 0
Dangerous-Workflow 10/10 no dangerous workflow patterns detected
License 10/10 license file detected
Pinned-Dependencies 6/10 dependency not pinned by hash detected -- score normalized to 6
Security-Policy 10/10 security policy file detected
Token-Permissions 10/10 GitHub workflow tokens follow principle of least privilege
Vulnerabilities 10/10 0 existing vulnerabilities detected

Threshold: 7 | Full report

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/release.md`:
- Around line 62-63: The docs are inconsistent: step 2b instructs to set
DefaultAMI to UsePreviousValue when not rolling the runner image, but step 5
hardcodes ${NEW_AMI}, which breaks the non-rolling path; update the text in step
5 (and the similar occurrence around line 107) to conditionally show the
CloudFormation/CLI snippet that uses DefaultAMI: UsePreviousValue when NEW_AMI
is unset or to ${NEW_AMI} when provided, and add a short note showing the exact
replacement (i.e., show both variants or an if/otherwise sentence) so references
to DefaultAMI, UsePreviousValue, and ${NEW_AMI} are consistent across the
document.
- Around line 56-60: After capturing NEW_AMI from the AWS query (the aws ec2
describe-images invocation that sets NEW_AMI), add a fail-fast guard that checks
if NEW_AMI is empty or "None" and, if so, prints a clear error to stderr and
exits non-zero so you don't proceed to Step 5 with an invalid DefaultAMI; ensure
the message references the original query and suggests retrying or checking
filters to aid troubleshooting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 47c338a4-c296-458d-a60d-9ea272d7bec8

📥 Commits

Reviewing files that changed from the base of the PR and between d01cd80 and eced006.

📒 Files selected for processing (1)
  • docs/release.md

Comment thread docs/release.md
Comment on lines +56 to +60
NEW_AMI=$(aws ec2 describe-images --owners self --region us-east-2 \
--filters "Name=name,Values=jit-runner-vX.Y.Z*" "Name=is-public,Values=true" \
--query 'reverse(sort_by(Images,&CreationDate))[0].ImageId' --output text)
echo "New AMI: ${NEW_AMI}"
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add a fail-fast guard after AMI lookup

If the AMI query returns None/empty (build delay, filter miss), Step 5 will pass an invalid DefaultAMI value. Add a guard immediately after capture.

Suggested doc fix
 NEW_AMI=$(aws ec2 describe-images --owners self --region us-east-2 \
   --filters "Name=name,Values=jit-runner-vX.Y.Z*" "Name=is-public,Values=true" \
   --query 'reverse(sort_by(Images,&CreationDate))[0].ImageId' --output text)
+if [ -z "${NEW_AMI}" ] || [ "${NEW_AMI}" = "None" ]; then
+  echo "Failed to resolve NEW_AMI for vX.Y.Z in us-east-2" >&2
+  exit 1
+fi
 echo "New AMI: ${NEW_AMI}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
NEW_AMI=$(aws ec2 describe-images --owners self --region us-east-2 \
--filters "Name=name,Values=jit-runner-vX.Y.Z*" "Name=is-public,Values=true" \
--query 'reverse(sort_by(Images,&CreationDate))[0].ImageId' --output text)
echo "New AMI: ${NEW_AMI}"
```
NEW_AMI=$(aws ec2 describe-images --owners self --region us-east-2 \
--filters "Name=name,Values=jit-runner-vX.Y.Z*" "Name=is-public,Values=true" \
--query 'reverse(sort_by(Images,&CreationDate))[0].ImageId' --output text)
if [ -z "${NEW_AMI}" ] || [ "${NEW_AMI}" = "None" ]; then
echo "Failed to resolve NEW_AMI for vX.Y.Z in us-east-2" >&2
exit 1
fi
echo "New AMI: ${NEW_AMI}"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/release.md` around lines 56 - 60, After capturing NEW_AMI from the AWS
query (the aws ec2 describe-images invocation that sets NEW_AMI), add a
fail-fast guard that checks if NEW_AMI is empty or "None" and, if so, prints a
clear error to stderr and exits non-zero so you don't proceed to Step 5 with an
invalid DefaultAMI; ensure the message references the original query and
suggests retrying or checking filters to aid troubleshooting.

Comment thread docs/release.md
Comment on lines +62 to +63
If you are not rolling the runner image this release, skip this and leave
`DefaultAMI` as `UsePreviousValue` in step 5.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Inconsistent DefaultAMI instructions vs command block

Step 2b says to use UsePreviousValue when not rolling the image, but Step 5 hardcodes ${NEW_AMI}. This can break the documented path when NEW_AMI is unset.

Suggested doc fix
-    ParameterKey=DefaultAMI,ParameterValue=${NEW_AMI} \
+    # If rolling AMI:
+    # ParameterKey=DefaultAMI,ParameterValue=${NEW_AMI} \
+    # If NOT rolling AMI:
+    ParameterKey=DefaultAMI,UsePreviousValue=true \

Also applies to: 107-107

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/release.md` around lines 62 - 63, The docs are inconsistent: step 2b
instructs to set DefaultAMI to UsePreviousValue when not rolling the runner
image, but step 5 hardcodes ${NEW_AMI}, which breaks the non-rolling path;
update the text in step 5 (and the similar occurrence around line 107) to
conditionally show the CloudFormation/CLI snippet that uses DefaultAMI:
UsePreviousValue when NEW_AMI is unset or to ${NEW_AMI} when provided, and add a
short note showing the exact replacement (i.e., show both variants or an
if/otherwise sentence) so references to DefaultAMI, UsePreviousValue, and
${NEW_AMI} are consistent across the document.

@kaio6fellipe kaio6fellipe merged commit 99f5e16 into main Jun 8, 2026
10 checks passed
@kaio6fellipe kaio6fellipe deleted the docs/release-5-functions-defaultami branch June 8, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation jit-runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant