fix-e2e
Skill172 starsChanged 22 days agoApache-2.0View on GitHub
Autonomously investigate and fix a failing RHDH E2E CI test. Accepts a Prow job URL or Jira ticket ID. Deploys RHDH, reproduces the failure, fixes the test using Playwright agents, and submits a PR with Qodo review.
- Commits and pushes
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- e2e-deploy-rhdhSkill
- e2e-diagnose-and-fixSkill
- e2e-parse-ci-failureSkill
- e2e-reproduce-failureSkill
- e2e-submit-and-reviewSkill
- e2e-verify-fixSkill
- patch-backstageSkill
- pr-review-prioritizerSkill
- pr-triageSkill
- trigger-nightly-jobSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 10 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Decision gate: If the input cannot be parsed (invalid URL, inaccessible Jira ticket), report the error and ask the user for clarification.
- Distinctive: line 40
Multiple failures: If the job has more than one failing test:
- Distinctive: line 44
If failures share a root cause, fix them together in one PR.
- Very specific: line 59
If a Jira ticket was provided, include the ticket ID in the branch name: fix/RHIDP-XXXX-e2e-<test-description>
- Distinctive: line 63
Use the current branch as-is
- Distinctive: line 64
Create a new branch from the upstream release branch
- Very specific: line 84
Use the full Prow CI job name for -j (not shortened names).
- Distinctive: line 88
After deployment completes, unlock Bitwarden and use the URL printed by the deployment:
- Very specific: line 97
Use the namespaces of the actual deployment when they differ from these defaults.
- Very specific: line 107
Run the specific failing test to confirm it reproduces locally.
- Very specific: line 115
No cluster or deployment available: If Phase 3 was skipped or no running RHDH instance exists, ask the user for explicit approval before …
- Very specific: line 129
Cross-repo investigation: If the issue is in deployment config, search rhdh-operator and rhdh-chart repos.
- Distinctive: line 145
Run the fixed test once — must pass
- Distinctive: line 146
Run 5 times — must pass 5/5
- Very specific: line 147
Run code quality checks: yarn lint, yarn fmt:check, yarn shellcheck, and relevant yarn test:unit tests
- Distinctive: line 150
Decision gate: If the test still fails or is flaky, return to Phase 5 and iterate.
- Very specific: line 156
Resolve pre-commit hooks: Run yarn install in all relevant workspaces (root, e2e-tests/, .ci/) before committing
- Very specific: line 159
Create draft PR: Always use --draft. Determine the GitHub username from the fork remote: git remote get-url origin | sed …
- Distinctive: line 168
After all phases complete, produce a summary:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Fix E2E CI Failure
Autonomous workflow to investigate, reproduce, fix, and submit a PR for a failing RHDH E2E test.
Input
$ARGUMENTS — A failure URL or ticket, optionally followed by --no-qodo:
- Prow URL:
https://prow.ci.openshift.org/view/gs/... - Playwright report URL:
https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/.../index.html[#?testId=...] - Jira ticket ID:
RHIDP-XXXX - Jira URL:
https://redhat.atlassian.net/browse/RHIDP-XXXX
Options:
--no-qodo— Skip Qodo agentic review (steps 5-7 in Phase 7). Use this to avoid depleting a limited Qodo quota.
Workflow
Execute the following phases in order. Load each skill as needed for detailed instructions. If a phase fails, report the error and stop — do not proceed blindly.
Phase 1: Parse CI Failure
Skill: e2e-parse-ci-failure
Parse the input to extract:
- Failing test name and spec file path
- Playwright project name
- Release branch (main, release-1.9, etc.)
- Platform (OCP, AKS, EKS, GKE)
- Deployment method (Helm, Operator)
- Error type and message
- local-run.sh job name parameter
Decision gate: If the input cannot be parsed (invalid URL, inaccessible Jira ticket), report the error and ask the user for clarification.
Multiple failures: If the job has more than one failing test:
- Present all failures in a table with test name, spec file, error type, and consistency (e.g., "failed 3/3" vs "failed 1/3")
- Group failures that likely share a root cause (same spec file, same error pattern, same page object)
- Ask the user which failure(s) to focus on
- If failures share a root cause, fix them together in one PR. If they're unrelated, fix them in separate branches/PRs — complete one before starting the next.
Phase 2: Setup Fix Branch
First, check the current branch:
git branch --show-current- On
mainorrelease-*: You're on a base branch — create a feature branch using the skill:
If a Jira ticket was provided, include the ticket ID in the branch name:git fetch upstream <release-branch> git checkout -b fix/e2e-<test-description> upstream/<release-branch>fix/RHIDP-XXXX-e2e-<test-description> - On any other branch (e.g.,
fix/e2e-*): You're likely already on a feature branch. Ask the user whether to:- Use the current branch as-is
- Create a new branch from the upstream release branch
Phase 3: Deploy RHDH
Skill: e2e-deploy-rhdh
Deploy RHDH to a cluster using e2e-tests/local-run.sh. CLI mode requires -r and -t; always supply -j with the full parsed Prow job name to select the intended job:
OCP jobs — use -s (deploy-only) to skip automated test execution so you can run the specific failing test manually:
cd e2e-tests
./local-run.sh -j "$PROW_JOB_NAME" -r "$IMAGE_REPO" -t "$IMAGE_TAG" -sK8s jobs (AKS, EKS, GKE) — do not use -s. These jobs require the full execution pipeline and do not support deploy-only mode:
cd e2e-tests
./local-run.sh -j "$PROW_JOB_NAME" -r "$IMAGE_REPO" -t "$IMAGE_TAG"Use the full Prow CI job name for -j (not shortened names).
Derive the image repo (-r) and tag (-t) from the release branch — see docs/agents/knowledge/e2e-fix-workflow.md for the derivation logic.
After deployment completes, unlock Bitwarden and use the URL printed by the deployment:
export BW_SESSION=$(bw unlock --raw)
export BASE_URL=https://deployed-rhdh.example.com
export NAME_SPACE=showcase
export NAME_SPACE_RBAC=showcase-rbac
export NAME_SPACE_RUNTIME=showcase-runtimeUse the namespaces of the actual deployment when they differ from these defaults.
Set K8S_CLUSTER_URL and K8S_CLUSTER_TOKEN explicitly for cluster-aware tests;
local-test.sh does not generate tokens or read deployment configuration.
Decision gate: Before attempting deployment, verify cluster connectivity (oc whoami). If no cluster is available, ask the user for explicit approval before skipping this phase — do not skip silently. If deployment fails, the e2e-deploy-rhdh skill has error recovery procedures. If deployment cannot be recovered after investigation, report the deployment issue and stop.
Phase 4: Reproduce Failure
Skill: e2e-reproduce-failure
Run the specific failing test to confirm it reproduces locally. Use --project=any-test to avoid running the smoke test dependency — it matches any spec file without extra overhead:
cd e2e-tests
./local-test.sh -- --project=any-test --retries=0 --workers=1 "$SPEC_FILE"Decision gates:
- No cluster or deployment available: If Phase 3 was skipped or no running RHDH instance exists, ask the user for explicit approval before skipping reproduction — do not skip silently.
- Consistent failure: Proceed to Phase 5
- Flaky (fails sometimes): Proceed to Phase 5, focus on reliability
- Cannot reproduce (passes every time after 10 runs): Before giving up, try running the entire CI project with
CI=true ./local-test.sh -- --project="$CI_PROJECT" --retries=0to simulate CI conditions (3 workers, with project-specific overrides). If that also passes, report the results and ask the user for explicit approval before proceeding.
Phase 5: Diagnose and Fix
Skill: e2e-diagnose-and-fix
Analyze the failure and implement a fix:
- Classify the failure: locator drift, timing, assertion mismatch, data dependency, platform-specific, deployment config
- Use Playwright Test Agents: Invoke the healer agent (
@playwright-test-healer) for automated test repair — it can debug the test, inspect the UI, generate locators, and edit the code - Follow Playwright best practices: Consult the
playwright-locatorsandci-e2e-testingproject rules. Use semantic role-based locators (getByRole,getByLabel), auto-waiting assertions, Page Object Model, component annotations. Fetch official Playwright best practices via Context7 or https://playwright.dev/docs/best-practices if needed - Cross-repo investigation: If the issue is in deployment config, search
rhdh-operatorandrhdh-chartrepos. Use Sourcebot or Context7 if available; otherwise fall back togh search codeor clone the repo locally and grep
Decision gate: If the analysis reveals a product bug (not a test issue), you must be absolutely certain before marking a test with test.fixme(). The Playwright healer agent must have confirmed the test is correct and the application behavior is wrong. Ask the user for confirmation before proceeding. Then:
- File or update a Jira bug in the
RHDHBUGSproject - Mark the test with
// TODO:linking to the Jira ticket, followed bytest.fixme():// TODO: https://redhat.atlassian.net/browse/RHDHBUGS-XXXX test.fixme('Description of the product bug'); - Proceed to Phase 6 with the
test.fixme()change
Phase 6: Verify Fix
Skill: e2e-verify-fix
Verify the fix:
- Run the fixed test once — must pass
- Run 5 times — must pass 5/5
- Run code quality checks:
yarn lint,yarn fmt:check,yarn shellcheck, and relevantyarn test:unittests - Fix any lint/formatting issues
Decision gate: If the test still fails or is flaky, return to Phase 5 and iterate. If verification cannot be run (no cluster, environment issues), ask the user for explicit approval before proceeding without it.
Phase 7: Submit PR and Handle Review
Skill: e2e-submit-and-review
- Resolve pre-commit hooks: Run
yarn installin all relevant workspaces (root,e2e-tests/,.ci/) before committing - Commit: Stage changes, commit with conventional format
- Push:
git push -u origin <branch> - Create draft PR: Always use
--draft. Determine the GitHub username from the fork remote:git remote get-url origin | sed 's|.*github.com[:/]||;s|/.*||'. Then usegh pr create --draft --repo redhat-developer/rhdh --head <username>:<branch> --base <release-branch> - Trigger Qodo review (skip if
--no-qodo): Comment/agentic_reviewon the PR - Wait for review (skip if
--no-qodo): Poll for Qodo bot review (check every 15s, up to 5 minutes) - Address feedback (skip if
--no-qodo): Apply valid suggestions, explain rejections - Trigger affected CI job: Comment
/test ?on the PR to list available presubmit jobs, then comment/test <job-name>to trigger the presubmit job matching the platform and deployment method from Phase 1 - Monitor CI: Watch CI checks with
gh pr checks
Final Report
After all phases complete, produce a summary:
E2E Fix Summary:
- Input: <Prow URL or Jira ticket>
- Test: <spec file> (<playwright project>)
- Branch: <fix branch> → <release branch>
- Root cause: <classification and description>
- Fix: <what was changed>
- Verification: <X/X passes>
- PR: <PR URL>
- CI Status: <PASS/PENDING/FAIL>
- Qodo Review: <status>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
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.

