Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature][Core] Backfill: when timeAfter moves earlier, collect only the missing period instead of restarting full sync

Aperta
#9,246 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start with backend/helpers/pluginhelper/api/collector_state_manager.go and the duplicated SubtaskStateManager logic; trace how GetSince() and GetUntil() reach collectors. Then inspect api_collector.go, graphql_collector.go, and GitHub collectors, including workflow runs, to find flush behavior and range filters. Done means backfill fetches only the missing interval, preserves existing raw rows, and stores the earlier TimeAfter; collectors that cannot bound the range may retain full recollection.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Search before asking
  • I had searched in the issues and found no similar feature requests.
Use case

A project is first collected with timeAfter = T1. Later the user moves timeAfter to an earlier date T0 < T1 to get more history. Today this restarts the collection from scratch:

  • NewCollectorStateManager (backend/helpers/pluginhelper/api/collector_state_manager.go) sees syncPolicy.TimeAfter.Before(state.TimeAfter) and drops to full-sync mode: since = T0, isIncremental = false.
  • Every collector then fetches [T0, now], which includes [T1, now], the period that was already collected.
  • The REST and GraphQL collectors (api_collector.go, graphql_collector.go: "flush data if not incremental collection") delete all existing raw rows for the scope before fetching.

For large scopes the repeated fetch is the expensive part. GitHub workflow runs and jobs dominate API calls and run time, and the rate limit is shared by every pipeline using the same App or token. A full re-collection also leaves the scope with fewer rows until it finishes.

Description

Add a third collection mode, "backfill", used when the new timeAfter is earlier than the stored one:

  1. Collect only [T0, T1]: since = T0, with an upper bound until = state.TimeAfter.
  2. Do not flush the existing raw data.
  3. On success, store T0 as the new TimeAfter (the existing code already updates it for full syncs).
  4. Apply the same rule in SubtaskStateManager, which duplicates the logic.

Collectors need to honour the upper bound. Today only a few call GetUntil() (in the GitHub plugin, only the workflow runs collector); the rest use GetSince() alone. A backfill would add an until filter to each collector's request or stop condition, and fetch child records (reviews, comments, jobs) only for the newly found parents.

Collectors that cannot bound the range could keep today's behaviour (a full re-collect), so this can ship incrementally, starting with the state managers and one or two collectors.

Related issues

None found.

Are you willing to submit a PR?
  • Yes I am willing to submit a PR!
Code of Conduct
Lingua principale
Go
Stelle
3.2k
Fork
824
Merge medio
2g 22h
PR unite (30g)
50

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/devlake

Tutte le issue di apache/devlake

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.