agentleFS
redhat-developerredhat-developer/rhdh/.claude/skills/e2e-submit-and-review/SKILL.md

e2e-submit-and-review

Skill171 starsChanged 20 days agoApache-2.0View on GitHub

Create a PR for an E2E test fix, trigger Qodo agentic review, address review comments, and monitor CI results

  • Reads credentials
  • Commits and pushes

We split this skill into the rules it gives an agent

23 rules. About 0 are common, 17 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Create a pull request for the E2E test fix, trigger automated review, address feedback, and verify CI passes.

    line 9
  2. Very specific:

    Use this skill after verifying the fix (via e2e-verify-fix) when all tests pass and code quality checks are clean.

    line 13
  3. Distinctive:

    Before committing, ensure all related workspaces have their dependencies installed so pre-commit hooks (lint-staged, rulesync, etc.) pass:

    line 17
  4. Distinctive:

    If a pre-commit hook fails during commit, fix the issue and create a new commit — do not amend.

    line 30
  5. Distinctive:

    Follow the conventional commit format:

    line 52
  6. Distinctive:

    If a Jira ticket exists, reference it:

    line 58
  7. Very specific:

    Create a PR against the upstream redhat-developer/rhdh repository.

    line 78
  8. Very specific:

    Important: Always use --repo redhat-developer/rhdh and --head <username>:<branch> for cross-fork PRs.

    line 109
  9. Distinctive:

    After the PR is created, trigger an agentic review from Qodo (PR-Agent):

    line 121
  10. Distinctive:

    If a review is received, fetch the inline comments:

    line 153
  11. Distinctive:

    If no review is received after 5 minutes, ask the user for guidance.

    line 161
  12. Distinctive:

    Code suggestions: If the suggestion improves the code, apply it:

    line 167
  13. Distinctive:

    False positives: If a suggestion is incorrect, explain why in a reply:

    line 179
  14. Distinctive:

    After addressing Qodo review feedback (and pushing any follow-up commits), trigger the presubmit E2E job that corresponds to the originally …

    line 189
  15. Very specific:

    CRITICAL: Never guess or construct presubmit job names.

    line 191
  16. Distinctive:

    If no response is received after 1 minute, ask the user for guidance.

    line 220
  17. Distinctive:

    If no matching job exists in the list, inform the user and ask how to proceed

    line 260
  18. Distinctive:

    After pushing changes, monitor the CI pipeline:

    line 266
  19. Distinctive:

    E2E test failure: Check the Prow job logs, determine if it's the same test or a different one

    line 281
  20. Very specific:

    E2E lint failure: Run yarn lint:fix from e2e-tests/, then rerun its lint and formatting checks before committing

    line 282
  21. Very specific:

    Application build failure: Check TypeScript errors with yarn tsc from the repository root.

    line 283
  22. Distinctive:

    If a CI check needs to be re-run:

    line 288
  23. Distinctive:

    After CI passes (or all issues are addressed), produce a final report:

    line 299

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Submit and Review

Create a pull request for the E2E test fix, trigger automated review, address feedback, and verify CI passes.

When to Use

Use this skill after verifying the fix (via e2e-verify-fix) when all tests pass and code quality checks are clean.

Step 0: Resolve Pre-Commit Hooks

Before committing, ensure all related workspaces have their dependencies installed so pre-commit hooks (lint-staged, rulesync, etc.) pass:

# Root workspace
yarn install

# If e2e-tests files were changed
cd e2e-tests && yarn install && cd ..

# If .ci files were changed
cd .ci && yarn install && cd ..

If a pre-commit hook fails during commit, fix the issue and create a new commit — do not amend.

Step 1: Commit Changes

Stage and Commit

# Stage only relevant files
git add e2e-tests/
git add .ci/  # Only if deployment config was changed

# Commit with a descriptive message
git commit -m "fix(e2e): <short description of what was fixed>

<Longer description if needed explaining:>
- What test was failing
- What the root cause was
- How it was fixed"

Commit Message Convention

Follow the conventional commit format:

  • fix(e2e): fix flaky topology test timeout
  • fix(e2e): update RBAC page locators after UI redesign
  • fix(e2e): add retry logic for catalog entity refresh
  • fix(e2e): skip orchestrator test on GKE platform

If a Jira ticket exists, reference it:

  • fix(e2e): fix topology locator drift [RHIDP-1234]

Step 2: Push to Fork

Push the fix branch to the fork (origin):

git push -u origin <branch-name>

Example:

git push -u origin fix/e2e-topology-locator
# or
git push -u origin fix/RHIDP-1234-e2e-topology-locator

Step 3: Create Pull Request

Create a PR against the upstream redhat-developer/rhdh repository.

Dynamic username extraction -- Always derive the GitHub username from the fork remote at runtime rather than hardcoding it. This makes the workflow portable across any contributor's environment:

GITHUB_USER=$(git remote get-url origin | sed 's|.*github.com[:/]||;s|/.*||')

Then create the PR as a draft (always use --draft):

gh pr create \
  --draft \
  --repo redhat-developer/rhdh \
  --head "${GITHUB_USER}:<branch-name>" \
  --base <release-branch> \
  --title "fix(e2e): <description> [AI /e2e-fix]" \
  --body "$(cat <<'EOF'
## Summary
- <1-2 bullet points explaining what was fixed and why>

## Test Results
- Local verification: 5/5 passes
- Code quality: Oxlint, Oxfmt, and applicable ShellCheck/unit tests pass

## Related
- Prow job: <URL if applicable>
- Jira: <ticket ID if applicable>
EOF
)"

Important: Always use --repo redhat-developer/rhdh and --head <username>:<branch> for cross-fork PRs. Never hardcode the GitHub username -- always extract it dynamically from the origin remote URL so this workflow works for any contributor.

PR Description Guidelines

Keep it concise:

  • What test was failing
  • What the root cause was
  • How it was fixed
  • Link to the original failing CI job or Jira ticket

Step 4: Trigger Qodo Agentic Review

After the PR is created, trigger an agentic review from Qodo (PR-Agent):

# Get the PR number from the create output, then comment
gh pr comment <PR-number> --repo redhat-developer/rhdh --body "/agentic_review"

The Qodo bot will:

  1. Analyze the code changes
  2. Post review comments with suggestions
  3. Optionally approve or request changes

Step 5: Wait for and Address Qodo Review

Poll for Review Comments

Poll for Qodo review completion (typically takes 1-3 minutes):

# Poll for Qodo bot review (check every 15s, up to 20 attempts = 5 min)
for i in $(seq 1 20); do
  REVIEW_STATE=$(gh api repos/redhat-developer/rhdh/pulls/<PR-number>/reviews \
    --jq '[.[] | select(.user.login | test("github-actions|qodo|codium|pr-agent"))] | last | .state // empty')
  if [[ -n "$REVIEW_STATE" ]]; then
    echo "Qodo review received (state: $REVIEW_STATE)"
    break
  fi
  echo "Waiting for Qodo review (attempt $i/20)..."
  sleep 15
done

If a review is received, fetch the inline comments:

# Get inline review comments
gh api repos/redhat-developer/rhdh/pulls/<PR-number>/comments \
  --jq '.[] | select(.user.login | test("github-actions|qodo|codium|pr-agent")) | {path: .path, line: .line, body: .body}'

If no review is received after 5 minutes, ask the user for guidance.

Address Review Comments

For each review comment:

  1. Code suggestions: If the suggestion improves the code, apply it:
# Make the change locally
# Then stage only the changed files and commit
git add <specific-files>
git commit -m "fix(e2e): address review feedback"
git push

Never use git add -A or git add . — always stage specific files to avoid committing .env, test artifacts, or other local-only files.

  1. Style/convention issues: Fix them per project conventions
  2. False positives: If a suggestion is incorrect, explain why in a reply:
gh api repos/redhat-developer/rhdh/pulls/<PR-number>/comments/<comment-id>/replies \
  -f body="This is intentional because <reason>"
  1. Questions: Answer them with context from the codebase

Step 6: Trigger Affected CI Job

After addressing Qodo review feedback (and pushing any follow-up commits), trigger the presubmit E2E job that corresponds to the originally failing CI job. Presubmit job names differ from periodic/nightly names but cover the same platform and deployment method.

CRITICAL: Never guess or construct presubmit job names. Always discover them from the openshift-ci bot response as described below.

Step 6a: Request Available Jobs

Comment /test ? on the PR to request the list of available presubmit jobs:

gh pr comment <PR-number> --repo redhat-developer/rhdh --body "/test ?"

Step 6b: Wait for the Bot Response

The bot usually responds within seconds. Poll PR comments for the openshift-ci bot's response:

# Poll for the openshift-ci bot response (check every 5s, up to 12 attempts = 1 min)
for i in $(seq 1 12); do
  BOT_RESPONSE=$(gh api repos/redhat-developer/rhdh/issues/<PR-number>/comments \
    --jq '[.[] | select(.user.login == "openshift-ci[bot]" or .user.login == "openshift-ci-robot")] | last | .body // empty')
  if [[ -n "$BOT_RESPONSE" ]] && echo "$BOT_RESPONSE" | grep -q '/test'; then
    echo "Bot response received:"
    echo "$BOT_RESPONSE"
    break
  fi
  echo "Waiting for openshift-ci bot response (attempt $i/12)..."
  sleep 5
done

If no response is received after 1 minute, ask the user for guidance.

Step 6c: Understand the Bot Response

The bot's response has two sections:

  1. Required jobs — triggered automatically when the PR is marked as ready for review (not on draft PRs). These run the basic presubmit checks:
/test e2e-ocp-helm
  1. Optional jobs — must be triggered explicitly. These include nightly variants, other platforms, and operators:
/test e2e-ocp-helm-nightly
/test e2e-eks-helm-nightly
/test e2e-aks-operator-nightly
...

Note: the job names in the bot's response are shortened (e.g., e2e-ocp-helm), not the full Prow pull-ci-redhat-developer-rhdh-... format. Use these short names directly with /test.

Step 6d: Select and Trigger the Right Job

Match the original failure to the right presubmit job from the bot's list:

Original failure patternTrigger
*ocp*helm*nightly*/test e2e-ocp-helm-nightly
*ocp*operator*nightly*/test e2e-ocp-operator-nightly
*ocp*v4-19*helm*/test e2e-ocp-v4-19-helm-nightly
*aks*helm*/test e2e-aks-helm-nightly
*eks*helm*/test e2e-eks-helm-nightly
*gke*operator*/test e2e-gke-operator-nightly
gh pr comment <PR-number> --repo redhat-developer/rhdh --body "/test <job-name-from-bot-response>"

Rules:

  • Only use job names that appeared in the bot's response — never construct or guess names
  • The required job (e2e-ocp-helm) runs automatically — you usually only need to trigger the optional job matching the original failure
  • If no matching job exists in the list, inform the user and ask how to proceed

Step 7: Monitor CI Status

Watch CI Checks

After pushing changes, monitor the CI pipeline:

gh pr checks <PR-number> --repo redhat-developer/rhdh --watch

Or check manually:

gh pr checks <PR-number> --repo redhat-developer/rhdh

CI check types (Prow E2E jobs, lint checks, build checks, etc.) are documented in the project CI rules. Use gh pr checks output to identify which specific check failed.

If CI Fails

  1. E2E test failure: Check the Prow job logs, determine if it's the same test or a different one
  2. E2E lint failure: Run yarn lint:fix from e2e-tests/, then rerun its lint and formatting checks before committing
  3. Application build failure: Check TypeScript errors with yarn tsc from the repository root; the E2E workspace has no separate tsc:check script
  4. Unrelated failure: Comment on the PR noting it's an unrelated failure, optionally /retest to re-trigger

Re-trigger CI

If a CI check needs to be re-run:

# For Prow jobs, comment on the PR
gh pr comment <PR-number> --repo redhat-developer/rhdh --body "/retest"

# For specific jobs
gh pr comment <PR-number> --repo redhat-developer/rhdh --body "/retest <job-name>"

Step 8: Final Status Report

After CI passes (or all issues are addressed), produce a final report:

PR Status Report:
- PR: <URL>
- Branch: <branch> -> <release-branch>
- CI Status: PASS / PENDING / FAIL
- Qodo Review: Addressed / Pending
- Files changed: <count>
- Action items: <any remaining items>

Quick Reference: PR Workflow Commands

# Determine GitHub username from fork remote
GITHUB_USER=$(git remote get-url origin | sed 's|.*github.com[:/]||;s|/.*||')

# Create draft PR (always use --draft)
gh pr create --draft --repo redhat-developer/rhdh --head "${GITHUB_USER}:<branch>" --base <release-branch> --title "fix(e2e): <description> [AI /e2e-fix]"

# Trigger Qodo review
gh pr comment <PR#> --repo redhat-developer/rhdh --body "/agentic_review"

# List available presubmit jobs (Step 6a)
gh pr comment <PR#> --repo redhat-developer/rhdh --body "/test ?"

# Wait for openshift-ci bot response (Step 6b) -- poll until bot replies with job list

# Trigger specific presubmit job (Step 6d) -- ONLY use a job name from the bot's response
gh pr comment <PR#> --repo redhat-developer/rhdh --body "/test <job-name-from-bot-response>"

# Check CI status
gh pr checks <PR#> --repo redhat-developer/rhdh

# Re-trigger tests
gh pr comment <PR#> --repo redhat-developer/rhdh --body "/retest"

# View PR
gh pr view <PR#> --repo redhat-developer/rhdh --web

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.