Skip to content

Fix BCApps e2e: scope PR Build run lookup to e2etest branch#2329

Merged
spetersenms merged 2 commits into
mainfrom
mazhelez/redesigned-bassoon
Jul 23, 2026
Merged

Fix BCApps e2e: scope PR Build run lookup to e2etest branch#2329
spetersenms merged 2 commits into
mainfrom
mazhelez/redesigned-bassoon

Conversation

@mazhelez

Copy link
Copy Markdown
Collaborator

❔What, Why & How

The BCApps e2e scenario intermittently fails during the Pull Request Build wait with a 404 (Not Found) thrown from WaitWorkflow.

Root cause: the run lookup in e2eTests/scenarios/BCApps/runtest.ps1 filtered /actions/runs only by event -eq 'pull_request' and name -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 $run becomes an array. WaitWorkflow's [string] $runid parameter 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 projects change to main and waiting for a full CI/CD build) widened the window for Dependabot to open its PR before the e2etest PR is created, which is why this surfaced now. The underlying filter bug predates that change.

Fix: scope the lookup to head_branch -eq $branch (the e2etest branch) and take the most recent match with Select-Object -First 1, so $run.id is always a single value.

✅ Checklist

  • Add tests (E2E, unit tests)
  • Update RELEASENOTES.md
  • Update documentation (e.g. for new settings or scenarios)
  • Add telemetry

N/A for RELEASENOTES / documentation / telemetry: this only touches internal e2e test infrastructure and is not user facing.

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>
Copilot AI review requested due to automatic review settings July 23, 2026 12:33
@mazhelez
mazhelez requested a review from a team as a code owner July 23, 2026 12:33

Copilot AI left a comment

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.

Pull request overview

Scopes BCApps PR-build lookup to the e2etest branch, preventing concurrent PR runs from producing an invalid run ID.

Changes:

  • Filters workflow runs by event, name, and head branch.
  • Selects only the newest matching run.

@spetersenms
spetersenms merged commit b57bbcc into main Jul 23, 2026
8 checks passed
@mazhelez
mazhelez deleted the mazhelez/redesigned-bassoon branch July 23, 2026 13:07
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.

4 participants