gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Infra: Bug: E2E did not run

Open mattKorwel opened this issue 4 months ago • 23 comments

We had a pr from a googler, https://github.com/google-gemini/gemini-cli/pull/9114, that had many failing tests including some that we think are required.

We need to understand what combination of things happened to let this in.

mattKorwel avatar Sep 26 '25 23:09 mattKorwel

Sorry about this! Do you have a link to information about what was failing? I ran npm run test:e2e and npm run preflight in the branch with my change and without my change and I thought they got the same failures that looked really unrelated, but I guess I missed something or wasn't sync'd properly. 😬

mistergarrison avatar Sep 28 '25 17:09 mistergarrison

@mattKorwel Any specifics on the failing tests? This is also critical for several of my team's workflows... how can I help resolve these?

sniemczyk-google avatar Sep 29 '25 13:09 sniemczyk-google

Seems like all the of tests are skipped: https://github.com/google-gemini/gemini-cli/actions/runs/18042915615 The workflow file is before we added merge_queue_skipper. Our if statements look okay from first glance but suspect that one of the condition checks aren't correct and is causing the whole e2e workflow to be skipped over.

Similar case after merge queue skipper was added: https://github.com/google-gemini/gemini-cli/actions/runs/18188529827

Right now it seems like adding the label does not cause e2e to be triggered

shishu314 avatar Oct 03 '25 18:10 shishu314

We have instances where the workflow fails at merge queue skipper and causing the whole e2e to be skipped: https://github.com/google-gemini/gemini-cli/actions/runs/18232148734

Fixing this part doesn't fix all the issues but should allow us to cover some of the merges that go in without passing e2e

shishu314 avatar Oct 06 '25 18:10 shishu314

Update: need approval on the test PR there to test whether or not the updated workflow is working as intended

shishu314 avatar Oct 07 '25 18:10 shishu314

Standup update: Code changes ready to review, tags WAI, removed all checks on the E2E check job except for when forks have pull_request events

shishu314 avatar Oct 08 '25 18:10 shishu314

reviewing after standup

mattKorwel avatar Oct 08 '25 18:10 mattKorwel

Update: Going to remove the label check and listening to pull_request_target event. We actually have a check for approvers permission to run workflow settings set that makes everything obsolete.

shishu314 avatar Oct 10 '25 18:10 shishu314

Standup update: Cannot test the pull_request_target event due to security. Github does not trigger pull_request_target events from pull requests from forks. Going to pair with Matt and see if we can test it somehow.

shishu314 avatar Oct 13 '25 18:10 shishu314

Standup update: Pending review from Matt, code works (I think) but not sure how to test

shishu314 avatar Oct 14 '25 18:10 shishu314

Same status as yesterday, linking PR: https://github.com/google-gemini/gemini-cli/pull/11028/files

Think this works but cannot test

shishu314 avatar Oct 15 '25 18:10 shishu314

Context:

  • Currently skipped tests are interpreted as successes (Github built-in)
  • For forked PRs, everything is skipped because we filter events for only label changes
  • Once E2E workflow is ran for a fork with label, users can update their PR and everything is skipped, and interpreted as success
  • We already require approval on our workflows, so we should just trigger E2E workflow on all forked PR changes

Changes needed:

  • Skipped tests should not count as passing
  • Label should be removed
  • Forked PRs need to pass E2E tests before submission

Blockers:

This event runs in the context of the base of the pull request, rather than in the context of the merge commit, as the pull_request event does. This prevents execution of unsafe code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow. 

Therefore, my code changes cannot be tested unless the changes are submitted.

shishu314 avatar Oct 16 '25 17:10 shishu314

E2e changes have been approved and are waiting to merge. We'll need to test this one after it lands and verify what worked or didn't. Moving to "In progress" while we test.

mattKorwel avatar Oct 16 '25 18:10 mattKorwel

E2E changes did not work, specifically because the pull_request_target directly bypass protection settings. This is because

Workflows triggered by pull_request_target events are run in the context of the base branch. Since the base branch is considered trusted, workflows triggered by these events will always run, regardless of approval settings. For more information about the pull_request_target event, see [Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target).

From github docs

shishu314 avatar Oct 16 '25 19:10 shishu314

Update: Going to use chained workflow to trigger the E2E workflow

shishu314 avatar Oct 17 '25 18:10 shishu314

Update: Chained workflow seems to work but things cannot be tested unless the code is in main. Currently: Trigger workflow (updated) triggers -> E2E workflow (on main)

shishu314 avatar Oct 20 '25 18:10 shishu314

Update: Added workflow dispatch to chained e2e workflow, getting it submitted so we can test trigger -> chained e2e

shishu314 avatar Oct 21 '25 18:10 shishu314

Update: Working on associating status back to the original PR. E2E runs after triggering.

shishu314 avatar Oct 22 '25 18:10 shishu314

Standup update: Got chained workflow running for pushes to main + merge queue but having some tasks skipped + merge queue skipper failing, have a PR out to fix that.

shishu314 avatar Oct 23 '25 18:10 shishu314

Update: Chained workflow might need a PAT to run since the SECRET_TOKEN from the chained workflow does not have write status permission. We need the write permission to report the status back to the original PR that triggered it.

shishu314 avatar Oct 28 '25 18:10 shishu314

Remaining work:

  1. Give gemini cli robot PAT status write permission
  2. Use Gemini cli robot PAT in chained e2e workflow to write status back to the original PR
  3. Use the chained e2e workflow in presubmit checks

shishu314 avatar Dec 04 '25 20:12 shishu314

I've requested commit status write permission but it needs approval from an admin.

Image

scidomino avatar Dec 04 '25 21:12 scidomino

This has been approved

scidomino avatar Dec 04 '25 21:12 scidomino

This is done!

There is no longer a need for a special label. the E2E (Chained) workflow will be kicked off when a maintainer approves the workflow.

scidomino avatar Dec 09 '25 03:12 scidomino