👷 Draft-aware BrowserStack jobs#4522
Draft
thomas-lebeau wants to merge 2 commits intomainfrom
Draft
Conversation
Bundles Sizes Evolution
🚀 CPU PerformancePending... 🧠 Memory Performance
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 229e86a | Docs | Datadog PR Page | Give us feedback! |
2a98420 to
b89c0a4
Compare
unit-bs and e2e-bs are declared as when: manual in the parent pipeline. A new bs-auto-play job queries the GitHub API for the branch's PR state and, when the PR is open and not a draft, plays both BS jobs via the GitLab jobs API (authenticated with CI_JOB_TOKEN). Drafts, no-PR, and multi-PR cases leave the jobs as manual so they can be started with a click.
b89c0a4 to
10d6ddf
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10d6ddf0fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
When a branch has multiple open PRs, `fetchPR` throws an ambiguous-match error. Catch it and leave the BrowserStack job manual rather than fail the pipeline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
BrowserStack (BS) jobs currently run on every pipeline, including draft PRs, consuming parallelism budget on work that is not yet ready for review. This change makes BS jobs opt-in (manual) on drafts and automatic once the PR is ready for review.
Changes
unit-bsande2e-bsmanual (when: manual,allow_failure: true). On drafts / branches without a PR, they stay as a "play" button and don't block the pipeline.unit-bs-auto-playande2e-bs-auto-playjobs (needs: ['unit']/needs: ['e2e']). Each runsscripts/test/play-bs-job.ts <job-name>, which:fetchPRto check the branch's PR state.authanywhere), thenPOST /jobs/:id/playto trigger the matching manual BS job.draft: booleanon theGitHubPRinterface returned byfetchPR.Test instructions
On CI:
unit-bsande2e-bsshow as manual (play button). Confirmunit-bs-auto-play/e2e-bs-auto-playsucceed and logPR #<n> is a draft; <job> remains manual..*-bs-auto-playjobs.unit-bs-auto-play/e2e-bs-auto-playplay the BS jobs automatically (log:played <job> (job id …)), andunit-bs/e2e-bsrun to completion.Checklist