Skip to content

ci: Repair regenerate-models workflow stale add glob and branch clash#809

Open
vdusek wants to merge 1 commit into
masterfrom
fix/regenerate-models-workflow
Open

ci: Repair regenerate-models workflow stale add glob and branch clash#809
vdusek wants to merge 1 commit into
masterfrom
fix/regenerate-models-workflow

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented May 20, 2026

Summary

Fixes two bugs in .github/workflows/manual_regenerate_models.yaml that, between them, are responsible for empty branches like update-models-docs-pr-2546 and update-models-docs-pr-2548 being left dangling without PRs.

Bug 1 — stale add: glob (silent, since 2026-04-29)

add: 'src/apify_client/_*_generated.py' matches nothing. PR #765 renamed the generated files from _models_generated.py / _typeddicts_generated.py to _models.py, _typeddicts.py, _literals.py, but the workflow's pathspec and header comment weren't updated. Under the previous EndBug/add-and-commit@v10 this just produced committed: false with no error — so the workflow has been exiting green while doing nothing for ~3 weeks.

Bug 2 — create-branch: true clashes with the local git switch -c "$BRANCH" (visible since #792 on 2026-05-15)

apify/actions/signed-commit@v1.0.0 with create-branch: true runs:

git push origin "HEAD:refs/heads/$BRANCH"
git fetch --depth=1 origin "$BRANCH:refs/heads/$BRANCH"

The push succeeds (creating the dangling remote branch at master's HEAD), but the fetch fails with fatal: refusing to fetch into branch ... checked out at ... because the workflow's prior Switch to existing branch or create a new one step already checked out a local branch with the same name. The job exits 128, leaving the empty remote branch behind.

Changes

  • Header comment: _{models,typeddicts}_generated.py_{models,typeddicts,literals}.py.
  • Branch setup step:
    • "Existing branch" case unchanged in spirit; uses git fetch origin "$BRANCH":"$BRANCH" (explicit local ref) for clarity.
    • "New branch" case no longer pre-creates the local branch — stays on master so signed-commit's create-branch flow can do its push + fetch without colliding.
    • Outputs create_branch (true/false) for the commit step.
  • Commit step:
    • add: enumerates the actually-generated files.
    • create-branch: is now driven by steps.branch-setup.outputs.create_branch.

Follow-up

Once this lands, the two dangling branches should be deleted and the corresponding Regenerate models workflow re-triggered for those docs PRs (or the docs PRs re-synced).

The `add:` pathspec `_*_generated.py` stopped matching anything after the
generated files were renamed (PR #765 dropped the `_generated` suffix),
so the workflow has been silently producing no commits since 2026-04-29.
After PR #792 swapped to `apify/actions/signed-commit`, the pre-existing
local `git switch -c "$BRANCH"` step also clashed with the action's
`create-branch: true` flow (its `git fetch ... $BRANCH:refs/heads/$BRANCH`
refuses to overwrite a checked-out branch), leaving dangling empty
branches like `update-models-docs-pr-2546` / `-2548`.

This fixes the `add:` list to the actual filenames and skips the local
branch creation when the remote branch doesn't yet exist, letting
signed-commit handle that path; existing branches are still pre-checked-out
locally and `create-branch` is set to `false` for that case.
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels May 20, 2026
@vdusek vdusek self-assigned this May 20, 2026
@github-actions github-actions Bot added this to the 141st sprint - Tooling team milestone May 20, 2026
@vdusek vdusek changed the title fix: repair regenerate-models workflow stale add glob and branch clash ci(openapi): Repair regenerate-models workflow stale add glob and branch clash May 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.46%. Comparing base (757a1fe) to head (7449861).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #809      +/-   ##
==========================================
- Coverage   94.52%   94.46%   -0.07%     
==========================================
  Files          48       48              
  Lines        4916     4916              
==========================================
- Hits         4647     4644       -3     
- Misses        269      272       +3     
Flag Coverage Δ
integration 90.80% <ø> (+0.12%) ⬆️
unit 83.03% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek requested a review from janbuchar May 20, 2026 15:12
@vdusek vdusek changed the title ci(openapi): Repair regenerate-models workflow stale add glob and branch clash ci: Repair regenerate-models workflow stale add glob and branch clash May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants