Skip to content

Conversation

@Shrinath-O2
Copy link
Contributor

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

Failed to generate code suggestions for PR

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 4, 2025

Greptile Overview

Greptile Summary

Added a new auto-rerun workflow that automatically retriggers failed Playwright tests on their first failure, helping reduce flakiness impact on CI/CD pipeline.

Key Changes:

  • New playwright-auto-rerun.yml workflow listens for Playwright test failures
  • Only triggers on first attempt (run_attempt == 1) to prevent infinite loops
  • Uses gh run rerun --failed to rerun only failed jobs, leveraging TestDino for test-level optimization
  • Includes comprehensive debug logging and validation checks
  • Supports manual triggering via workflow_dispatch for testing
  • Removed deliberate test failure from streamname.spec.js that was used for testing

Technical Implementation:

  • Workflow triggers on workflow_run completion event for "Playwright UI Tests"
  • Validates workflow state (completed + failed) before initiating rerun
  • Installs GitHub CLI if not present for rerun capabilities
  • Proper permissions (actions: write, contents: read) configured

Confidence Score: 4/5

  • This PR is safe to merge with low risk - implements a well-bounded auto-rerun mechanism with proper safeguards
  • Score reflects solid implementation with appropriate safeguards: only triggers on first attempt to prevent loops, includes comprehensive validation and error handling, and removes test debugging code. Minor concern is the potential for increased CI usage if flaky tests consistently fail-then-pass, but this is an acceptable trade-off for improved developer experience
  • No files require special attention - the workflow is well-structured with proper validation logic

Important Files Changed

File Analysis

Filename Score Overview
.github/workflows/playwright-auto-rerun.yml 4/5 Added new auto-rerun workflow that triggers on Playwright test failures, only runs on first attempt, includes debug logging and proper validation

Sequence Diagram

sequenceDiagram
    participant PT as Playwright UI Tests
    participant GHA as GitHub Actions
    participant AR as Auto-Rerun Workflow
    participant GHCLI as GitHub CLI
    
    PT->>PT: Run tests on PR/push
    alt Tests fail on first attempt
        PT->>GHA: Mark workflow as failed (attempt 1)
        GHA->>AR: Trigger workflow_run event
        AR->>AR: Check if run_attempt == 1
        AR->>AR: Check if conclusion == 'failure'
        AR->>AR: Install GitHub CLI
        AR->>GHCLI: gh run view $RUN_ID
        GHCLI-->>AR: Return run details (status, conclusion, attempt)
        AR->>AR: Validate workflow is completed
        AR->>AR: Validate conclusion is failure
        AR->>GHCLI: gh run rerun $RUN_ID --failed
        GHCLI->>PT: Trigger rerun of failed jobs only
        PT->>PT: TestDino optimizes to run only failed tests
    else Tests pass or attempt > 1
        PT->>GHA: Complete workflow
        Note over GHA,AR: Auto-rerun workflow not triggered
    end
    
    alt Manual testing
        GHA->>AR: workflow_dispatch with run_id
        AR->>AR: Use provided run_id
        AR->>GHCLI: gh run rerun $RUN_ID --failed
        GHCLI->>PT: Trigger rerun
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@Shrinath-O2 Shrinath-O2 marked this pull request as ready for review December 4, 2025 06:35
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

Failed to generate code suggestions for PR

- Add separate playwright-auto-rerun.yml workflow
- Automatically triggers when Playwright tests fail on first attempt
- Only reruns failed/cancelled jobs to save CI resources
- Integrates with TestDino for optimized test execution
- Includes manual trigger option for testing before merge
- Comprehensive debug logging and error handling
- Prevents infinite loops by limiting to one auto-rerun attempt
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

- Add separate playwright-auto-rerun.yml workflow
- Automatically triggers when Playwright tests fail on first attempt
- Only reruns failed/cancelled jobs to save CI resources
- Integrates with TestDino for optimized test execution
- Includes manual trigger option for testing before merge
- Comprehensive debug logging and error handling
- Prevents infinite loops by limiting to one auto-rerun attempt
@Shrinath-O2 Shrinath-O2 merged commit ffc265c into main Dec 4, 2025
52 of 55 checks passed
@Shrinath-O2 Shrinath-O2 deleted the e2e-autoRerunPoc branch December 4, 2025 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants