Store and Resolve Previous Commit SHA for Synchronize Jobs

Offen
#180 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
55/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
node.js, typescript
Bereich
backend, databases

Rechercherichtung

Start with prepare.ts and trace how synchronize jobs are created, then inspect the job schema and database code in packages/schema and packages/db. Check how job history identifies the most recently completed job for the same PR and how superseded jobs are represented. Done means the new field is persisted, the three listed cases are covered, and the required typecheck, test, and lint commands pass.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement good first issue

Goal

Store and resolve previousCommitSha for synchronize jobs so the incremental review knows which commit range to diff.

Background

To review only the files changed by the newest push, the review needs the previously reviewed head commit. The natural source is the most recently completed job for the same PR: its head SHA becomes the base for the incremental diff.

This sub-issue is part of the parent issue: incremental reviews on synchronize events.

What to Build

  • In prepare.ts (or the job preparation path), when a new job is created for a synchronize event, resolve previousCommitSha from the most recently completed job on the same PR
  • Persist previousCommitSha on the job record (schema/DB change in packages/db and packages/schema)
  • Handle the superseded-job case: if the previous job was superseded before completing, there is no valid previous SHA, so leave it unset and let the review fall back to the full PR diff
  • Keep the resolution logic runtime-agnostic so it works in both Cloudflare Workers and Node/Docker

Done When

  • New synchronize jobs carry previousCommitSha when a prior completed job exists for the same PR
  • Superseded or missing prior jobs leave previousCommitSha unset (no incorrect fallback to an older SHA)
  • Schema/DB migration works in both runtimes
  • Tests cover first-push, completed-prior-job, and superseded-prior-job cases
  • npm run typecheck, npm test, and npm run lint all pass
Vorherrschende Sprache
TypeScript
Sterne
125
Forks
23
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
12

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus devarshishimpi/codra

Alle Issues in devarshishimpi/codra

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.