Skip to content

ci: Try to auto-fix flaky test issues#20793

Merged
mydea merged 8 commits into
developfrom
fn/auto-fix-issue
May 19, 2026
Merged

ci: Try to auto-fix flaky test issues#20793
mydea merged 8 commits into
developfrom
fn/auto-fix-issue

Conversation

@mydea
Copy link
Copy Markdown
Member

@mydea mydea commented May 11, 2026

This adds a workflow that tries to auto-fix a given issue. It is auto-run for flaky test issues.

@mydea mydea self-assigned this May 11, 2026
Comment thread .github/workflows/auto-fix-issue.yml Outdated
@mydea mydea force-pushed the fn/auto-fix-issue branch from be4e7e3 to 86f6509 Compare May 11, 2026 10:37
@mydea
Copy link
Copy Markdown
Member Author

mydea commented May 12, 2026

adjusted this a bit and introduced prompt injection checker from triage-issue here as well.

Comment thread .github/workflows/auto-fix-issue.yml
Comment thread .github/workflows/auto-fix-issue.yml Outdated
Comment thread .github/FLAKY_CI_FAILURE_TEMPLATE.md
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 26.92 kB - -
@sentry/browser - with treeshaking flags 25.35 kB - -
@sentry/browser (incl. Tracing) 44.91 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.16 kB - -
@sentry/browser (incl. Tracing, Profiling) 49.91 kB - -
@sentry/browser (incl. Tracing, Replay) 84.54 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.04 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 89.25 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 101.87 kB - -
@sentry/browser (incl. Feedback) 44.1 kB - -
@sentry/browser (incl. sendFeedback) 31.73 kB - -
@sentry/browser (incl. FeedbackAsync) 36.84 kB - -
@sentry/browser (incl. Metrics) 28.01 kB - -
@sentry/browser (incl. Logs) 28.15 kB - -
@sentry/browser (incl. Metrics & Logs) 28.84 kB - -
@sentry/react 28.66 kB - -
@sentry/react (incl. Tracing) 47.16 kB - -
@sentry/vue 31.85 kB - -
@sentry/vue (incl. Tracing) 46.78 kB - -
@sentry/svelte 26.94 kB - -
CDN Bundle 29.34 kB - -
CDN Bundle (incl. Tracing) 47.47 kB - -
CDN Bundle (incl. Logs, Metrics) 30.71 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 48.59 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.03 kB - -
CDN Bundle (incl. Tracing, Replay) 84.94 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 90.8 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 91.88 kB - -
CDN Bundle - uncompressed 86.46 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.93 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 90.66 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.4 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 215.38 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.71 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.16 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.41 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 278.85 kB - -
@sentry/nextjs (client) 49.66 kB - -
@sentry/sveltekit (client) 45.4 kB - -
@sentry/core/server 75.77 kB - -
@sentry/core/browser 62.54 kB - -
@sentry/node-core 62.2 kB - -
@sentry/node 166.72 kB - -
@sentry/node - without tracing 74.64 kB - -
@sentry/aws-serverless 109.62 kB - -
@sentry/cloudflare (withSentry) - minified 171.49 kB - -
@sentry/cloudflare (withSentry) 429.51 kB - -

View base workflow run

@mydea mydea force-pushed the fn/auto-fix-issue branch from 72358be to 8543d80 Compare May 19, 2026 08:08
@mydea mydea marked this pull request as ready for review May 19, 2026 08:09
@mydea mydea requested review from a team, Lms24, chargome and s1gr1d May 19, 2026 08:09
Comment thread .github/workflows/auto-fix-issue.yml Outdated
Comment thread .github/workflows/auto-fix-issue.yml Outdated
Comment thread .github/workflows/auto-fix-issue.yml Outdated
COMMENTS_JSON="${RUNNER_TEMP}/comments.json"
gh api "repos/getsentry/sentry-javascript/issues/${ISSUE_NUMBER}" > "$ISSUE_JSON"
gh api "repos/getsentry/sentry-javascript/issues/${ISSUE_NUMBER}/comments" > "$COMMENTS_JSON"
python3 .claude/skills/triage-issue/scripts/detect_prompt_injection.py "$ISSUE_JSON" "$COMMENTS_JSON"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The workflow auto-fix-issue.yml calls a script from an incorrect path, causing the step to fail on every execution.
Severity: HIGH

Suggested Fix

In .github/workflows/auto-fix-issue.yml, update the path in the run command to point to the correct script location: .agents/skills/triage-issue/scripts/detect_prompt_injection.py.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .github/workflows/auto-fix-issue.yml#L64

Potential issue: The `auto-fix-issue.yml` workflow attempts to execute a script from
`.claude/skills/triage-issue/scripts/detect_prompt_injection.py`. This path is
incorrect; the script actually resides at
`.agents/skills/triage-issue/scripts/detect_prompt_injection.py`. As a result, the
"Check issue for prompt injection and language" step will deterministically fail on
every run with a "No such file or directory" error, preventing the workflow from ever
completing successfully.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this should be fine.

Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
@mydea
Copy link
Copy Markdown
Member Author

mydea commented May 19, 2026

We'll merge this as-is with manual run only, then we can iterate a bit on it and look into auto-running it in a follow up step.

Comment thread .github/workflows/auto-fix-issue.yml
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a1ceb40. Configure here.

Comment thread .github/workflows/auto-fix-issue.yml Outdated
COMMENTS_JSON="${RUNNER_TEMP}/comments.json"
gh api "repos/getsentry/sentry-javascript/issues/${ISSUE_NUMBER}" > "$ISSUE_JSON"
gh api "repos/getsentry/sentry-javascript/issues/${ISSUE_NUMBER}/comments" > "$COMMENTS_JSON"
python3 .claude/skills/triage-issue/scripts/detect_prompt_injection.py "$ISSUE_JSON" "$COMMENTS_JSON"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The workflow references a Python script at an incorrect path, which will cause the step to fail and halt the workflow.
Severity: CRITICAL

Suggested Fix

In .github/workflows/auto-fix-issue.yml, update the path to the detect_prompt_injection.py script to point to its correct location at .agents/skills/triage-issue/scripts/detect_prompt_injection.py.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .github/workflows/auto-fix-issue.yml#L68

Potential issue: The `auto-fix-issue.yml` workflow attempts to execute a Python script
from an incorrect path:
`.claude/skills/triage-issue/scripts/detect_prompt_injection.py`. The script is actually
located at `.agents/skills/triage-issue/scripts/detect_prompt_injection.py`. This will
cause the "Check issue for prompt injection and language" step to fail with a
file-not-found error every time the workflow is triggered, which will halt the workflow
and prevent the auto-fix functionality from running.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is fine

@mydea mydea merged commit 2bc118a into develop May 19, 2026
269 checks passed
@mydea mydea deleted the fn/auto-fix-issue branch May 19, 2026 11:16
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.

2 participants