Fix BCApps e2e: scope PR Build run lookup to e2etest branch#2329
Merged
Conversation
The Pull Request Build run lookup filtered only by event and name, so a concurrent Dependabot 'Pull Request Build' run could also match. That made $run an array, and WaitWorkflow's [string] $runid coerced the id array to a space-joined string, producing an invalid /actions/runs URL and a 404. Scope the lookup to head_branch = e2etest and Select-Object -First 1 so the run id is always a single value. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
aholstrup1
approved these changes
Jul 23, 2026
spetersenms
approved these changes
Jul 23, 2026
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.
❔What, Why & How
The
BCAppse2e scenario intermittently fails during the Pull Request Build wait with a404 (Not Found)thrown fromWaitWorkflow.Root cause: the run lookup in
e2eTests/scenarios/BCApps/runtest.ps1filtered/actions/runsonly byevent -eq 'pull_request'andname -eq 'Pull Request Build'. When a concurrent Dependabot PR is open in the temp repo, its build run is also named "Pull Request Build", so the filter returns more than one run and$runbecomes an array.WaitWorkflow's[string] $runidparameter then coerces that array to a space-joined string ("<id1> <id2>"), producing an invalid/actions/runs/<id1> <id2>URL that 404s.The longer runtime introduced by #2306 (pushing the
projectschange tomainand waiting for a full CI/CD build) widened the window for Dependabot to open its PR before thee2etestPR is created, which is why this surfaced now. The underlying filter bug predates that change.Fix: scope the lookup to
head_branch -eq $branch(thee2etestbranch) and take the most recent match withSelect-Object -First 1, so$run.idis always a single value.✅ Checklist
N/A for RELEASENOTES / documentation / telemetry: this only touches internal e2e test infrastructure and is not user facing.