Skip to content

Conversation

twk3
Copy link
Contributor

@twk3 twk3 commented Sep 5, 2025

Fixes #56

Description

There was a bug in our useAPI mode where we where erroring out the action for notFound. This was already fixed for sharding mode as part of the initial release, but was missed. Applied the same change to ensure the command doesn't fail the action.

Demo

Here is the log output from a sample run retry with this branch: https://github.com/twk3/playwright-gh-actions-demo/actions/runs/17507043195/job/49732490763 note the action passes and all tests are run again despite the 404 in the last-failed action log

Manual Testing

  • You can reproduce the problem by enabling useApi: true, and setting previous-ci-build-id to something that isn't the actual build Id. (though the previous ci build id template doesn't have to be wrong for this to happen in the real world, the run just has to have not been created, maybe there was nothing to do, etc).
  • Without this change
    • The server throws a 404 for the missing run, and the action fails
  • With this change
    • The server throws a 404 for the missing run, but the action doesn't fail, and instead there is no last-run file. So playwright will start running all the tests. (which is the safest option)

@twk3 twk3 changed the title fix: Don't fail in apiMode when getting 404 not-founds on the build ID fix: Don't fail in apiMode when getting 404 not-founds on the build ID [CSR-3062] Sep 5, 2025
Copy link

@twk3 twk3 requested a review from Copilot September 6, 2025 00:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in API mode where the action would fail when receiving 404 not-found responses for build IDs. The fix applies the same error handling approach that was already implemented for sharding mode.

  • Adds ignoreReturnCode: true option to the exec.exec() call in API mode
  • Ensures the action doesn't fail when the API returns a 404 for non-existent build IDs
  • Aligns error handling behavior between API mode and sharding mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@twk3 twk3 requested a review from vCaisim September 6, 2025 00:08
Copy link
Contributor

@vCaisim vCaisim left a comment

Choose a reason for hiding this comment

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

@twk3 nice job!

@vCaisim vCaisim merged commit dc1d2c3 into main Sep 8, 2025
24 checks passed
@vCaisim vCaisim deleted the fix/apiMode-no-fail branch September 8, 2025 08:27
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.

Random 404s on the github action
2 participants