7.3 KiB
description, argument-hint
| description | argument-hint | |
|---|---|---|
| Trigger a pre-merge release readiness review on a GitHub PR, GitLab MR, or local branch |
|
Read and follow the analyzing-release-readiness skill for full execution details.
IMPORTANT: NEVER use gh CLI, glab CLI, curl, or any external tool to fetch PR/MR details. All required fields (repository, prNumber/mergeRequestIid, hostname) MUST be parsed directly from the URL string. The DevOps Agent fetches the content itself.
Step 0 — Choose your execution path (DO THIS FIRST)
Check your available tools. Do you have ALL of these tools?
aws_devops_agent__create_release_readiness_reviewaws_devops_agent__get_taskaws_devops_agent__list_journal_recordsaws_devops_agent__get_release_readiness_report
These tools are NOT deferred/lazy-loaded — if they do not appear in your tool list, they are unavailable. Do NOT search for them via ToolSearch.
- YES (all present) → Use the "Remote Server" path below
- NO → Tell the user: "Remote server not configured." Then prompt the user with instructions from the
setup-devops-agentskill if they intend to set up the connection. If not, mention that you are "proceeding with the AWS CLI fallback." Then use the Fallback (CLI) path below.
Common to both paths (see skill: "Gathering execution parameters")
- If
$ARGUMENTScontains a URL (github.com or gitlab.com), parse the PR/MR details directly from the URL string — do NOT fetch or inspect the PR via any tool. - If
$ARGUMENTSis a repo name or path, use the "Local GitHub/GitLab repo" flow below. - If
$ARGUMENTSis empty, check the current git repository and use the local flow. - Build the
contentobject following the skill's "Gathering execution parameters" section. - Ask the user about automated testing (static-only vs full analysis). Do NOT proceed until the user answers.
Remote Server path (see skill: "Core workflow")
- Call
aws_devops_agent__create_release_readiness_review(content={...}, skip_automated_testing=...). - Poll
aws_devops_agent__get_task(task_id=TASK_ID)every 30s. - Stream progress via
aws_devops_agent__list_journal_records(execution_id=EXEC_ID, order="ASC"). - On
COMPLETED: callaws_devops_agent__get_release_readiness_report(execution_id=EXEC_ID), save to file, and run the auto-fix flow from the skill.
Fallback (CLI) path
Use this path when the remote server tools are unavailable.
-
List agent spaces with
aws devops-agent list-agent-spaces --region us-east-1and ask the user which one to use. Do NOT proceed until the user has selected one. -
Build the
contentobject using the guidance from theanalyzing-release-readinessskill's "Gathering execution parameters" section. Key rules:githubPrContent/gitlabMrContentMUST be an array,prNumber/mergeRequestIidMUST be strings. -
Start the job (CRITICAL:
contentmust be a single object, NOT wrapped in a list. Correct:{"githubPrContent": [...]}. Wrong:[{"githubPrContent": [...]}]):aws devops-agent create-backlog-task \ --agent-space-id SPACE_ID \ --task-type RELEASE_READINESS_REVIEW \ --title 'Release Readiness Review' \ --priority MEDIUM \ --description '{"agentInput": {"content": <CONTENT_JSON>, "metadata": {"skipAutomatedTesting": true/false}}}' \ --region us-east-1 -
Poll for status every 30s:
aws devops-agent get-backlog-task \ --agent-space-id SPACE_ID \ --task-id TASK_ID \ --region us-east-1 -
Stream progress — once
IN_PROGRESS, poll journal records and present updates to the user:aws devops-agent list-journal-records \ --agent-space-id SPACE_ID \ --execution-id EXEC_ID \ --order ASC \ --region us-east-1Use
next_tokenfrom the response to fetch only new records on subsequent polls. Wait 15 seconds between each poll iteration. Keep polling until the task reaches a terminal status (COMPLETED,FAILED,CANCELED,TIMED_OUT). -
On
COMPLETED, retrieve the report:aws devops-agent list-journal-records \ --agent-space-id SPACE_ID \ --execution-id EXEC_ID \ --record-type release_analysis_report \ --order ASC \ --region us-east-1Save the report to
release-readiness-review-<YYYY-MM-DD-HHmmss>.mdand run the auto-fix flow from the skill.On
FAILEDorTIMED_OUT: present the error and suggest next steps. OnCANCELED: inform the user no report is available. -
After analysis completes, clean up the review branch (if local flow was used — see below).
-
To cancel a running job:
aws devops-agent update-backlog-task \ --agent-space-id SPACE_ID \ --task-id TASK_ID \ --task-status CANCELED \ --region us-east-1
Local GitHub/GitLab repo flow (no PR/MR URL provided)
When $ARGUMENTS is a repo name/path or empty (steps 2-3 above), execute this flow to prepare the content object. The review agent needs a pushed branch to read from — do NOT shortcut.
-
Navigate to the repository directory:
cdto the repo root. Ask the user if needed. -
Determine the base branch: Use
mainunless the user specifies otherwise. Verify:BASE_BRANCH="main" if ! git show-ref --verify --quiet refs/remotes/origin/$BASE_BRANCH; then git fetch origin $BASE_BRANCH fiIf fetch fails, ask the user to specify the base branch and stop.
-
Check for local changes: Run
git status --shortandgit rev-list --count origin/$BASE_BRANCH..HEAD:- Clean AND not ahead: Nothing to analyze — stop.
- Has uncommitted changes: Tell the user what will be committed and pushed. Do NOT proceed until the user approves.
- Clean but ahead of remote: Tell the user commits will be pushed. Do NOT proceed until the user approves.
-
Stash uncommitted changes (skip if clean):
git stash push --include-untracked -m "release-analysis: preserve working changes" -
Create review branch:
ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD) BRANCH_NAME="feat/release-readiness-review" git checkout -b $BRANCH_NAME 2>/dev/null || { BRANCH_NAME="feat/release-readiness-review-$(date +%Y%m%d-%H%M%S)"; git checkout -b $BRANCH_NAME; } -
Apply stash and commit (skip if clean):
git stash apply git add -A git commit -m "chore: snapshot for release readiness review"Check for sensitive files before staging — warn user if found.
-
Push:
git push -u origin HEAD -
Build the content: Extract
owner/repoand hostname fromgit remote get-url origin | sed 's|://[^@]*@|://|'. MANDATORY: Always use the sed command, we cannot expose PAT tokens in the context window! -
Set
headBranchto$BRANCH_NAME. UsegithubPrContent(GitHub) orgitlabMrContent(GitLab) as an array. -
After analysis completes — clean up:
git checkout $ORIGINAL_BRANCH
git push origin --delete $BRANCH_NAME 2>/dev/null || true
git branch -D $BRANCH_NAME 2>/dev/null || true
If stash was used: git stash pop.
Important: Do NOT create a PR/MR — only push the branch.
If $ARGUMENTS is empty and no git repo is detected, prompt the user for a PR/MR URL or repo name.