Skip to content

demo: BEFORE — messy PR with generated-file churn across 4 commits#3011

Draft
qstearns wants to merge 3 commits into
demo/basefrom
demo/before
Draft

demo: BEFORE — messy PR with generated-file churn across 4 commits#3011
qstearns wants to merge 3 commits into
demo/basefrom
demo/before

Conversation

@qstearns
Copy link
Copy Markdown
Contributor

Summary

The "before" half of a paired demo showing what mise run git:squash-gen does. Companion PR: demo/after-default → demo/base.

A synthetic PR built on top of two prep commits (more on those below) plus four "feature" commits that simulate how a real branch accumulates generated-file churn when generators run multiple times during development:

# Subject Files Lines
prep1 chore(gen): mark .speakeasy/out.openapi.yaml as linguist-generated 1 +2/-1
prep2 chore(gen): take ownership of client/sdk/.gitattributes via .genignore 2 +1/-2
a1 chore(dashboard): clarify OAuth mode docstring 1 +6/-4
a2 feat(usersessions): add roastUserSession endpoint 31 +2,803
a3 feat(usersessions): count active sessions per issuer 2 +35
a4 fix(elements): clarify defaultGetSession relay path 1 +2

The a2 commit is what squash-gen is for: a tiny silly Goa design change (a roastUserSession endpoint) drags 31 files and 2,800 lines of regenerated SDK/server/openapi output along with it, completely burying the ~60 lines of hand-written code that's actually under review.

a3 shows the same pattern at smaller scale: a new SQL query (+11 lines) pulls along the *.sql.go regen (+24 lines).

a4 is hand-only — included to show that not every commit has generated content; squash-gen should leave it untouched.

About the prep commits

squash-gen uses git check-attr linguist-generated to decide what to scrub. Two preexisting issues on main would break that logic and were fixed in prep commits so the demo runs cleanly:

  1. .speakeasy/out.openapi.yaml wasn't in .gitattributes — the speakeasy-bundled OpenAPI spec is a generator output and should be linguist-generated.
  2. client/sdk/.gitattributes contained *.ts linguist-generated=false — incorrectly overrode the root rule. Replaced with a client/sdk/.genignore so speakeasy stops regenerating it.

Both prep commits use the chore(gen): prefix so they act as scope fences for squash-gen (mode 2 in the tool's docs: prior labeled commit shifts scope-start).

What to look at

Compare commit-by-commit against the after-default PR. Specifically a2 (this PR) vs the rewritten a2 (after-default PR): same hand-written changes, but the after-default version has the 28 generated files surgically moved to a single chore(gen): regenerate artifacts tip.

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 23, 2026 12:58am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: 568aa58

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@qstearns qstearns changed the base branch from demo/base to main May 23, 2026 00:47
@qstearns qstearns changed the base branch from main to demo/base May 23, 2026 00:47
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.

1 participant