Skip to content

feat: mock edit/delete, session & mock management UX, hardened CI#321

Merged
gwleclerc merged 4 commits into
mainfrom
feat/mock-edit-delete
Jul 18, 2026
Merged

feat: mock edit/delete, session & mock management UX, hardened CI#321
gwleclerc merged 4 commits into
mainfrom
feat/mock-edit-delete

Conversation

@gwleclerc

Copy link
Copy Markdown
Collaborator

Summary

Adds mock edit/delete plus a round of session & mock management UX, and brings the
CI to 2026 best practices. The mock format, its serialization, and the existing HTTP/CLI
API are unchanged — the only backend addition is one additive endpoint (DELETE /sessions/:id).

Mocks

  • Edit and delete a mock while the session has received no calls (append-only otherwise).
  • Success/error toasts; when a mock is read-only the disabled controls carry a
    reason-aware tooltip + a notice ("not the latest session" or "has calls in history")
    with a "switch to latest" / "clear history" action.
  • View any mock as read-only raw YAML via a per-mock toggle.
  • Filter mocks with a search box.

Sessions

  • Delete a session from the sidebar edit popover (DELETE /sessions/:id).
  • Clear the session history from the History page.
  • Sort sessions by date (newest first by default); non-latest sessions are dimmed.
  • Filter the history with a search box; import errors are surfaced instead of hanging.

Shareable views

  • Pagination and search live in the URL query, so a filtered/paginated view is a link.

CI (2026 SOTA)

  • Least-privilege permissions, concurrency cancellation, SHA-pinned actions + Dependabot.
  • govulncheck + npm audit security gate; go-version-file: go.mod.
  • Draft / preview releases that never override "Latest" (driven by the tag suffix).

Test plan

  • make test + make test-integration (venom), npm test (Vitest, 64), golden serialization tests.
  • Playwright non-regression suite: 35 tests green (twice, deterministic).
  • tsc, oxlint, golangci-lint (0 issues), govulncheck (0 reachable), npm audit (0 high+).

Closes #299
Closes #266
Closes #303

🤖 Generated with Claude Code

gwleclerc and others added 4 commits July 18, 2026 15:09
Most-requested feature (issues #299, #266, #303). Mocks stay append-only once the
session's history references them (a history entry is tied to the mock that
answered it), so edition/deletion is allowed only while the session history is
still empty — the maintainers' stated position on #231.

- Backend: additive PUT /mocks/:id and DELETE /mocks/:id. UpdateMock keeps the
  mock's identity (ID + creation date) and replaces its definition; both refuse
  with 409 once the session has received calls (types.MockEditForbidden). No
  change to the mock format, its serialization, or the existing routes.
- Frontend: Edit/Delete controls on each mock, shown only once the history query
  resolves empty. Edit reuses the creation drawer (form/YAML) pre-filled and PUTs;
  Delete confirms via Popconfirm.

Tests: Go service tests (update/delete happy path, edit-forbidden-after-call,
not-found) and a Playwright TNR covering the edit+delete flow plus the gate
(no controls on the seeded session, which has a call).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Builds on the edit/delete feature with a round of UX work:

- Edit/delete mocks: success/error toasts, and when a mock is read-only the
  disabled controls carry a reason-aware tooltip + a notice explaining why
  (not the latest session, or the session has calls in its history) with an
  actionable "switch to latest" / "clear history" button.
- Delete a session from the sidebar's edit popover, backed by a new additive
  DELETE /sessions/:id endpoint (mock format and existing API unchanged).
- Clear the session history from a button on the History page.
- Sidebar: sort sessions by date (newest first by default) via a toggle, and
  dim non-latest (read-only) sessions; sidebar widens with the viewport.
- Filter mocks and history with a search box; search and pagination live in the
  URL query so a filtered/paginated view is shareable.
- View any mock as read-only raw YAML via a per-mock toggle.
- Harmonize every interactive tooltip/title on antd Tooltip with imperative
  wording; surface import errors instead of leaving the uploader spinning.
- Harden the Playwright TNR to 35 tests and add DeleteSession service coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Least-privilege permissions (contents: read by default; deploy elevates).
- Cancel superseded pull-request runs via a concurrency group.
- Pin every action to a commit SHA (version in a comment) and add a
  Dependabot config (github-actions, weekly, grouped) to keep them fresh.
- Replace the deprecated sonarcloud-github-action@master with a pinned
  SonarSource/sonarqube-scan-action.
- Use go-version-file: go.mod for a reproducible toolchain.
- Set persist-credentials: false on every checkout (no job pushes with git).
- Add a security job: npm audit (shipped deps, high+) and govulncheck, and
  gate deploy on it.
- Support draft / preview releases that never override "Latest": the release
  flavor is derived from the tag suffix (-draft -> draft, -<any> -> prerelease,
  bare semver -> latest) and wired into softprops/action-gh-release.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gwleclerc
gwleclerc merged commit 7c4457c into main Jul 18, 2026
17 of 18 checks passed
@gwleclerc
gwleclerc deleted the feat/mock-edit-delete branch July 18, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant