Skip to content

e2e: TestVendorFromSubdirectory flaky — 422 non-fast-forward on scaffold push #2489

Description

@rh-hemartin

Summary

TestVendorFromSubdirectory frequently fails with:

Error: installation failed: layer workflows: committing scaffold files:
  update ref: github api: 422 Update is not a fast forward

The .fullsend repo is freshly created, then scaffold files are committed via the Git Data API. When GitHub auto-initializes the repo with a default commit before the scaffold push lands, the ref update fails because it's not a fast-forward.

Affected runs

This is the most common e2e failure mode — appears in nearly every failed e2e run:

Run Date Branch
27939726308 2026-06-22 merge queue (PR #2481)
27936617155 2026-06-22 merge queue (PR #2457)
27936080257 2026-06-22 merge queue (PR #2475)
27934548827 2026-06-22 merge queue (PR #2457)
27823364762 2026-06-19 main

Also hits TestAdminInstallUninstall in run 27936617155.

Root cause

internal/forge/github/github.go:793 — the ref update payload only sends {"sha": "..."} without "force": true. When GitHub auto-creates a commit during repo initialization (README, license, etc.) before the scaffold push, the tree created by CommitFiles has a parent SHA that doesn't include this auto-commit, making the update non-fast-forward.

refPayload := map[string]string{
    "sha": newCommit.SHA,
}

Possible fixes

  1. Set force: true on the ref update for scaffold pushes (these target a brand-new repo we own, so force is safe)
  2. Create the repo with auto_init: false to prevent GitHub from creating any initial commits
  3. Re-fetch the latest ref before creating the commit tree, so the scaffold commit properly parents on whatever GitHub created

Option 2 is likely the cleanest — avoids the race entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/e2eEnd-to-end testspriority/highSignificant impact, address soonready-to-codeTriaged and ready for the code agenttype/bugConfirmed defect in existing behavior

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions