Skip to content

feat(analytics): a restore event says whether the patch was retired or deleted - #690

Merged
allisonmahmood merged 1 commit into
mainfrom
feat/543-restored-from
Oct 15, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
feat/543-restored-from

Conversation

@allisonmahmood

Copy link
Copy Markdown
Owner

patch.restored fires for both a retired and a deleted patch coming back, but doesn't say which. On the dashboard those are different moments: undeleting inside the recovery window is usually a mistake undone, bringing a retired patch back is a tool returning to use.

patch.restored now carries from, retired or deleted. Patches.restore already locks the patch row and works out its state to refuse a live patch. It keeps that state once, narrowed to retired | deleted, and reports it. A patch that was retired and then deleted reports deleted, the state the portal and CLI showed for it. The catalogue type in Analytics.ts makes the field required, so every emitter has to supply it.

Closes #543

Tests

The existing assertions already covered both cases on both paths. They now expect from:

  • API (PatchesApi.test.ts): retire → restore reports retired; delete → restore reports deleted.
  • Portal (PortalPages.test.ts): the card's restore reports retired and deleted in its two cases. The reactivation bulk restore reports retired.
  • Service (Patches.test.ts): the lifecycle sequence reports retired.

Tried by hand

Ran pnpm dev up team. The worktree runner doesn't forward PostHog settings, so I ran a second server by hand on the same database, with PATCHY_POSTHOG_HOST pointed at a local HTTP collector, as OPERATIONS describes. Then, as Ada:

Restore Patch was Captured patch.restored
patchy restore (environment CLI) retired from: "retired", byAdmin: false
Portal card Restore deleted from: "deleted", byAdmin: true
Portal card Restore retired, then deleted from: "deleted", byAdmin: true

Each event carried the patch id, the owner, the company and Ada as principal. Torn down with pnpm dev down.

Surfaces

  • Vocabulary and product shape: no new concept. docs/OPERATIONS.md lists event names and points to the catalogue for properties, so it is unchanged.
  • Wire contract, CLI, dev loop, migrations, company resources, served pages, reverse states, repo layout: not touched.

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:s Under 100 changed lines labels Oct 15, 2026
…r deleted

patch.restored gains `from`, the state the locked row was in when the
restore committed. A retired patch that was later deleted reports `deleted`.

Closes #543

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit 52b61a7 into main Oct 15, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the feat/543-restored-from branch October 15, 2026 20:05
allisonmahmood added a commit that referenced this pull request Oct 16, 2026
…u when they fail (#720)

Release 13's What's new entry, written from `c9b8fc4`, ahead of
deploying it. `patchy` and `CURRENT_RELEASE` move to `0.13.0`, so CLIs
and patch repos installed before this deploy are told to upgrade.

| Change | PRs |
| --- | --- |
| New: Home puts the patches you use first | #713, #716, #719 |
| New: Every patch in one list | #715 |
| Improved: Each patch's page leads with Open | #717 |
| New: See when your tools are failing | #718 |
| Fixed: Everyone has a name | #687 |
| Improved: Your company's look is easier to get right | #697, #696,
#703, #688 |
| Improved: Forms follow your look's error states | #691, #692 |
| Improved: Clearer answers when a publish goes wrong | #686, #685, #689
|
| Fixed: Your agent's Patchy commands are steadier | #695, #704, #680,
#681 |
| Behind the scenes: stricter checks on static pages and tools' database
requests; malformed requests are logged | #682, #693, #683 |
| Behind the scenes: usage numbers count every publish, sharing change
and restore | #698, #699, #700, #690 |
| Test and tooling only, no line | #705, #702, #701, #694, #684, #607 |

Made by Claude Opus 5.5 in Claude Code, running in T3 Code.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(analytics): a restore says what the patch came back from

1 participant