
The Ticket That Ate Your Sprint
Phillip Harrington Jun 2026
First published on LinkedIn, April 2026.
CommentsTL;DR: Here's a real-ish feature ticket, the kind that turns into a 40-file PR, and how to break it into pieces before you write a single line of code.
I've written about why big PRs are bad, and why they keep happening anyway. The short version: one feature becomes one ticket becomes one branch becomes one massive PR that nobody can actually review. Everyone agrees it's a problem. Nobody seems to know what to do about it in the moment.
So let's walk through one: a feature with several moving parts, the kind that lands in your sprint every other week. Here's the ticket as the product owner might write it, and then how to break it apart before you touch your keyboard.
The Ticket
Here's what drops into your backlog:
ORG-1247: Team Invitations
As an organization admin,
I want to invite new members to my organization by email,
so that I can grow my team without involving support.Acceptance criteria:
- Admin can enter an email address and pick a role (member, editor, admin)
- System sends an invitation email with a unique, expiring link
- If the invitee already has an account, they're added to the org when they click the link
- If they don't have an account, they're taken to a registration form, and added to the org when they complete it
- Invitations expire after 72 hours
- Admin can view pending invitations and revoke them
- An invitee can't be invited twice to the same organization while a pending invite exists
- Activity is logged for audit purposes
That's a clean ticket. The product owner did their job: the acceptance criteria are clear and testable. It looks like one feature.
It's also going to touch 40 to 50 files if you build it in one pass.
Let Me Count
- 2 migrations (invitations, and an audit log if you don't have one)
- 2 models (Invitation and AuditLog)
- 2 validation classes (sending an invite, accepting one)
- 2 controllers (the admin's: create, list, revoke; the invitee's: show, accept)
- 1 service for the invitation logic
- 2 or 3 for the email: the message, its template, and sometimes a class that builds it
- 1 event and 1 listener
- 1 policy for authorization
- 1 scheduled job to expire old invitations
- 1 routes file
- 4 to 6 for the front end, depending on what it needs
- Tests for all of the above
That's 22 to 25 files, generously, and the tests double it. Then come the edge cases: duplicate invite prevention, the two-path accept flow (existing user and new user), expiration, revocation, audit logging. Each edge case adds files.
A junior dev looks at this ticket and thinks, "Got it. One feature. I'll start a branch and build it." And honestly, why wouldn't they? The ticket is one ticket. The feature is one feature. Nothing about the Jira card suggests it should be nine branches.
But it should be. Here's how.
The Breakdown
Don't think about the feature. Think about the layers. What can exist, tested and merged, before anything depends on it? This is the bottom-up way from the last post: start at the lowest layer and work up. Every PR carries its own tests.
1. The Invitation Model and Migration (ORG-1247a)
Create the invitations table and the Invitation model. Columns: id, organization_id, email, role, token, expires_at, accepted_at, revoked_at, timestamps. Add the relationships. Write a factory. Write model tests. Does the factory work? Do the relationships resolve? Do the pending, expired and accepted scopes return the right things?
That's it. Merge it. Nobody cares that nothing uses it yet. It exists, it's reviewed, and it's on main. 3-5 files.
2. The Invitation Service (ORG-1247b)
Build the InvitationService with a create() method. It takes an organization, an email and a role. It generates a secure token, sets the expiration, creates the record and returns the invitation.
This is also where your invariants live: rules that are always true, no matter who's calling the service or which controller they came through. An invitation must have an email address. An invitation must have a role. Maybe invitations can only go out for certain kinds of organization (enterprise orgs only, say).
Validation checks user input. Invariants are business rules the service enforces, every time. If something upstream skips validation or calls the service directly, the invariants still hold. Put them here, not in the controller.
There's no controller yet. No route. No email. Just the service and its tests. Does it create an invitation? Does it enforce the invariants? Does it set the expiration correctly? Does it generate a unique token?
2-4 files. Merge it.
You could split this further: the happy path in one PR, duplicate invite prevention in a second. One proves it works; the other proves you can't abuse it.
3. The Invitation Email (ORG-1247c)
Build the email: a class for the message and its template (and, if that's how your app does it, a separate class that builds the message). It takes an Invitation, builds the acceptance URL from the token, and renders the email. Test it: does it render? Does the URL contain the token? Is the subject line right?
Don't wire it up to anything. Don't send it from the service. Build the email and prove it works.
2-4 files. Merge it.
4. The Event and Listener (ORG-1247d)
Create an InvitationCreated event and a listener that sends the invitation email. Wire the listener to the event. Test it: when the event fires, does the email go out?
Now go back to the InvitationService (already on main, already reviewed) and dispatch the event at the end of create(). That's a one-line change and a test update.
3-5 files. Merge it.
You could even split this into two PRs: one for the event and listener, tested on their own, and a second that's just the one-line change to dispatch it. Overkill for most teams, but it's an option. Nobody's counting PRs. Every PR should have one clear reason to exist.
5. Admin Endpoints: Create, List, Revoke (ORG-1247e)
Now the admin controller: InvitationController with store, index and destroy. A validation class. The policy for authorization (only org admins can invite). Routes. This is also where the feature flag lives. Gate these endpoints, and any navigation links that point to them. The feature is on main, but invisible until you're ready.
This is where people panic: "Three methods, a validation class and a policy? That's a big PR!" It's not. The service already exists. The model already exists. The email already sends itself through the event. The controller is thin: it calls the service and returns a response. The policy is straightforward. The validation class handles user-facing validation. (The service already enforces the invariants, remember. Validation is there to give the user good error messages.)
Still feels too big? Each controller method can be its own PR with its related files: store, its validation class and its tests in one; index and its tests in another; destroy and its tests in a third. Nothing says you have to ship the whole controller at once just because it's one class.
Test it: can an admin create an invitation? Is the input validated? Does a non-admin get a 403? Does the index return pending invitations? Does destroy revoke the invite?
6-10 files. The biggest PR so far, and still easy to review.
6. The Accept Flow, Existing Users (ORG-1247f)
Add an accept method to the InvitationService. Given a token and a user, it checks the invitation (not expired, not revoked, not already accepted), adds the user to the organization with the invited role, marks the invitation accepted, and logs the activity.
Build the invitee's controller, the second one: GET /invitations/{token} checks the token, and if the user already has an account and is logged in, calls accept and redirects. Put this endpoint behind the feature flag too. The accept link only works once the feature is live.
3-4 files. Merge it.
7. The Accept Flow, New Users (ORG-1247g)
If the user doesn't have an account, redirect to a registration form that carries the invitation token through. After registration, accept automatically. This might touch the existing registration flow, which is why it's its own ticket. Changes to the auth flow deserve their own review.
It also suggests a post-registration redirect service: something that decides where a user goes after signup, based on context. Your framework may have some of this built in. But if your app doesn't already have a clean way to say "after signup, take them here instead of the default dashboard," that service could be an earlier PR of its own, with its own tests, before this ticket ever touches it. One more piece that can exist and get reviewed on its own.
3-5 files. Merge it.
8. Expiration Cleanup (ORG-1247h)
A scheduled job that finds and marks expired invitations, run daily (or hourly, depending on your needs). Test it: given three invitations, one pending, one expired and one accepted, does the job touch only the expired one? In QA, run it every 5 or 10 minutes, with a short expiry, so nobody waits three days to test it. (Anything on a schedule deserves the same treatment in QA.)
2-3 files. Merge it.
9. Remove the Flag (ORG-1247i)
One last PR: once the feature is live, deployed and stable, delete the flag and the code that checked it. File this ticket the day you add the flag. A commit hook can make sure you do.
2-4 files. Merge it, and the feature's done.
The Math
Same feature, same code, same tests. The difference is that every PR can be reviewed, tested and deployed on its own. Nobody's eyes glaze over. Nobody rubber-stamps it. If you made a bad design choice in the model layer, the reviewer catches it in sub-ticket 1, before you've built six layers of logic on top of it.
And it's faster, which surprises people. You're not waiting two days for a review on a monster PR. You're not reworking 40 files because the reviewer found a problem in the foundation. You're merging daily. You're unblocked. Your branch never conflicts with main, because it barely exists before it's merged.
It keeps you focused, too. On one big branch, the whole feature lives in your head, and fixes land all over the place. Here, if an earlier layer needs a change, that's another small PR.
"But that's more process overhead!" Yes. More PRs means more descriptions to write, more testing steps to document, more reviews to request. I hear you. Two things about that.
First, writing a description and testing steps for a 4-file change is easy. You know exactly what it does and exactly how to test it. A 40-file PR is where you stare at the screen for twenty minutes trying to summarize what happened. The overhead per PR drops dramatically when the PR is small.
Second, AI tools like Claude can draft PR descriptions and QA testing steps for you. Hand it the diff, tell it the context, and proofread what comes back. It's not zero effort, but it turns a twenty-minute chore into a two-minute review. The overhead argument made more sense before we had tools that handle the tedious parts.
The Conversation You Need to Have
None of this happens by itself. Whoever shapes the ticket shapes the PR, so it starts with a conversation with the product owner or your team lead. When that ticket lands, don't open your IDE. Say this:
"This is a solid ticket. I can see about nine pieces of work here. Can we create sub-tickets so I can merge them incrementally? The feature won't be user-facing until the last piece lands, but every piece will be tested and reviewed on its own."
Any reasonable product owner says yes. They don't care about your branching strategy. They care about the feature shipping reliably, and if sub-tickets do that with less risk, they're all for it.
Bonus: when they see sub-tickets closing and merging every day, they see progress. That makes PMs happier than one ticket sitting in "In Progress" for two weeks with no visible movement.
If your product owner insists on one ticket and one PR? That's a different conversation, and probably a different article.
What Else You Get
Smaller PRs are the obvious win. The breakdown buys you a few more.
The Fixes Have a Place to Go
In the last post I described two ways to make work mergeable before it's finished: bottom up, unwired code first, and top down, feature flag first. This breakdown goes bottom up. Here's what that looks like on the actual tickets.
Sub-tickets 1 through 4 (model, service, email, event and listener) are all unwired new code. They're on main. They're tested. Nothing calls them yet. That's the point: you're merging real, reviewed work before a single endpoint exists.
Sub-ticket 5, the admin endpoints, is where the feature flag goes. Gate the routes and any links that point to them. The feature is on main, but invisible. You keep merging and keep getting reviews, and nobody sees anything until you flip the switch. (Going top down, you'd flip the order: the admin screen first, behind the flag, then the endpoints, and on down.)
The Questions Show Up Early
The ticket says "system sends an invitation email." Great. What does the email say? What's the subject line? What's the call to action? That copy isn't in the ticket. It almost never is.
In the one-big-PR version, the developer either writes placeholder copy and hopes someone reviews it, or sits blocked for three days waiting on marketing or product. In the broken-down version, that detail belongs to sub-ticket 3, and the PM or PO has the whole time you're working on sub-tickets 1 and 2 to go get it. You're not blocked. They're not rushed.
Same with the UI design for the admin screens. That's a dependency of sub-ticket 5, not of the whole feature. The designers can see exactly when their input is needed, and plan for it. Same, too, with what an invitee sees when the link has expired. The ticket doesn't say. Sub-ticket 6 needs an answer, and now everybody knows that ahead of time.
Room to Grow
After launch, the PM asks, "Can we add a screen that shows the invitee who invited them, and to which organization?" In the broken-down version, that's a clean new PR. It hooks into the accept flow, it has an obvious place to live, and it gets its own tests.
In the one-big-PR version? Good luck finding where to slot it in without breaking anything. And ideas like that don't wait for launch: they show up while you're still building, and each one sends you back through the whole branch to rethink it. Same with a "decline" action with audit logging, invitation reminders, or a limit on invitations per org. Each one is a small, focused addition, because the feature was built in layers instead of one tangled pass.
Breaking the work down shrinks the PRs. It also makes the work visible, makes the dependencies explicit, and leaves you something you can extend later without dreading the diff. The best time to break up a big PR is before it exists. The second best time is never: break up the ticket first, and there's no big PR to break up.
Next: quick and dirty feature flags, the piece that makes merging unfinished code safe.
Ask for the words and pictures on day one
When you break the ticket down, find every piece that needs something from someone else (the email copy, the error messages, the admin screens) and ask for it that day. They get the whole time you're building the earlier sub-tickets to deliver it.