Skip to content

feat: add admin endpoints to reset package summaries and releases#447

Merged
paulvanbrenk merged 3 commits intomainfrom
feat/admin-reset-endpoints
Feb 26, 2026
Merged

feat: add admin endpoints to reset package summaries and releases#447
paulvanbrenk merged 3 commits intomainfrom
feat/admin-reset-endpoints

Conversation

@paulvanbrenk
Copy link
Collaborator

Summary

  • Adds POST /api/admin/packages/{id}/reset-summaries endpoint that marks all releases as stale and deletes summaries, triggering regeneration on next sync
  • Adds POST /api/admin/packages/{id}/reset-releases endpoint that deletes all releases/summaries and clears LastFetchedAt, treating the package as freshly added on next sync
  • Includes 8 integration tests covering auth gates (unauth/non-admin/404) and happy paths with DB verification

Test plan

  • All 8 new tests pass (dotnet test --filter "ResetSummaries|ResetReleases")
  • Full test suite passes (441/441)
  • Manual verification: call endpoints against a running API and confirm DB state changes

🤖 Generated with Claude Code

Add two new admin-only POST endpoints:
- /api/admin/packages/{id}/reset-summaries: marks all releases as
  SummaryStale=true and deletes ReleaseSummary rows so summaries
  regenerate on next sync
- /api/admin/packages/{id}/reset-releases: deletes all releases and
  summaries, clears LastFetchedAt so the package is re-fetched from
  scratch on next sync

Includes 8 integration tests covering auth, 404, and happy paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@paulvanbrenk paulvanbrenk mentioned this pull request Feb 26, 2026
5 tasks
paulvanbrenk and others added 2 commits February 26, 2026 11:47
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@paulvanbrenk paulvanbrenk merged commit ac07a7c into main Feb 26, 2026
4 checks passed
@paulvanbrenk paulvanbrenk deleted the feat/admin-reset-endpoints branch February 26, 2026 16:56
paulvanbrenk added a commit that referenced this pull request Feb 26, 2026
## Summary
- Adds `/admin/reset` page with paginated table of all packages
- Three actions per package: Reset Summaries, Reset Releases, Delete
Package
- Confirmation modal before each destructive action
- Pagination controls for navigating large package lists
- Nav link from main Admin page

## Details
- Regenerated OpenAPI spec and Orval client code for the new
`reset-summaries` and `reset-releases` endpoints (from #447)
- New `useResetSummaries` and `useResetReleases` mutation hooks
- MSW handlers for the new admin endpoints
- 14 new tests: 4 hook tests + 10 page component tests

**Depends on:** #447

## Test plan
- [x] `npx vitest run` - all 159 tests pass (13 test files)
- [x] `npx tsc --noEmit` - clean TypeScript build
- [ ] Manual: navigate to /admin/reset, verify table loads with
pagination
- [ ] Manual: test each action button opens correct confirmation modal
- [ ] Manual: confirm actions call the correct API endpoints

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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