Commit Graph
2 Commits
Author SHA1 Message Date
CatoandClaude ad83231630 feat(approvals): an answered package update stays on screen with what happened (#1257)
* feat(approvals): an answered package update stays on screen with what happened, and is kept in a recent list

* test(packages): Approvals page check follows the queue's new recent prop

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 17:18:37 +02:00
CatoandClaude Opus 5.5 de317a1120 Package updates arrive on their own, and you choose how (#1184)
* feat(packages): each project's update setting, applied to its Dependabot PRs

Package updates reach a project automatically by default, gated by its own
tests, with asking as an option. Loki is the policy layer only: Dependabot
proposes the pull requests and the fleet auto-merge sweep merges them.

- user_projects.package_updates: "auto" (default) | "ask" | "pinned". Values,
  labels and the one-line consequence of each are SSOT in
  src/config/package-updates.ts; an unknown stored value reads as "ask".
  No CHECK constraint, as for entities.auto_inject_mode_override (0023).
- package_update_requests: open Dependabot PRs that bump a fleet package —
  PR, head, packages (from -> to, breaking, fleet), checks state, state,
  whether Loki holds it, and the person's decision. project_packages.dep_name
  records the key package.json lists a package under, so an npm alias or a
  git dependency named by its key is matched back to the catalogue.
- Pure Dependabot parsing (single, grouped, `in /dir`, backticked shas, `v`
  tags) and breaking detection identical to the sweep's: a major, or a minor
  under 1.0; a version that is not semver counts as breaking.
- Enforcement as a pure decision table: hold when the setting is ask or
  pinned or the bump is breaking; lift only a hold Loki added; a hold a
  person added stays and blocks Loki's own merge; a hold someone takes off
  on GitHub is not put back and that PR is never merged by Loki.
- Decisions: Update (lift the hold; merge a breaking one once its checks are
  green, else on the next read), Not now (hidden 7 days), Stay on this
  version (@dependabot ignore this <part> version, per dependency in a
  group, close for a sha).
- The Phase 1 sync applies the setting after each good read, with the same
  token rules; the PR listing is a conditional request (304s are free).
- Cron sync-package-updates every 15 minutes, so a hold lands before the
  sweep merges a green PR. PATCH /api/projects/[id]/package-updates (owner
  only, applies at once when GitHub answers in time) and POST
  /api/packages/updates/[id] for a decision.
- Migration 0099 is additive: one new table, two new columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

* feat(packages): update setting, open updates and Approvals cards

- Project "Built from": the update setting as three choices (Automatic /
  Ask me / Stay on these versions) with what each will do written under it,
  and the rule none overrides (a breaking update always waits). A change
  says whether it reached the open updates already or will within 15
  minutes. Each package with an open update shows it under its row: the
  version it goes to, breaking, held for you / waiting on tests / ready,
  and the pull request.
- /packages/[slug]: the same line under each dependent project.
- /approvals: a Package updates card for every held update that needs the
  person — every update on "Ask me", breaking ones on "Automatic", none on
  "Stay on these versions". Project, packages from -> to, breaking, checks,
  why it is asking, link to the PR; Update / Not now / Stay on this
  version. A refusal stays on the card with the buttons; "no write access"
  comes with Connect GitHub. They name no private data, so they show behind
  the PIN too, and the "nothing waiting" empty state steps aside for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

* docs(packages): changelog entry and update settings in the Views table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

* fix(packages): read every repository once more to record dependency keys

Rows read before dep_name existed match update pull requests by catalogue
name only, and the sync skips a repository whose head and catalogue have
not moved — so for most projects they would have stayed that way. Folding
an observation version into the catalogue key invalidates that skip once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-14 03:05:48 -07:00