Repository navigation
Prevent GitHub and Jira sync checkpoints from skipping unread tickets - #1359
Conversation
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
|
Notes while it is a draft. The rule matches 0072 (inclusive
Smaller: |
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
…on setup Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
WaylandYang
left a comment
There was a problem hiding this comment.
Thanks. This matches 0072, and all three points from my 10-22 comment are handled: discussions are read in full, the second listing pass is in a dated 0072 revision, and rate-limit waits are capped. The checkpoint and the run's success commit in one transaction, and the tests go through the real readers and the database. A few small things before merge:
- Make 0072's status line one line, per the README rule, for example
In progress 2026-10-25 (#1359, migration 0119); open: custom batch progression and recovery (#1397).Move the second paragraph into the body, and clear the "Overtaken" cell indocs/decisions/README.md(that column is for later records). - #1246 is closed and #1397 replaces it. Please update the references in 0072,
docs/design/sources.md, the migration comment and the PR body. - Jira: please use
ORDER BY updated ASC, key ASC. Without a tie-breaker, offset paging over an equal-time group can repeat an issue, which fails the run, and the next run reads the same group again.
Merge order: this PR first. #1409 also uses 0119 and will move to 0121/108, and #1397 rebases onto the new sync_source branch. One note for the release: existing GitHub/Jira sources start with no checkpoint and rescan from the beginning, so a 20k-issue repository takes about 100 runs to catch up.
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
WaylandYang
left a comment
There was a problem hiding this comment.
Thanks @Floating-Y, the status line is one line, #1397 is referenced everywhere, and Jira pages are stable with key ASC. Approving and merging this first.
Why
Refs #1212 and implements the GitHub/Jira part of ADR 0072 (#1213). A successful sync previously advanced from its start time after reading only 200 items or ten pages, permanently skipping unread tickets.
What changes
ORDER BY updated ASC, key ASCso equal-time results have stable page boundaries.sources.sync_checkpointand commit it atomically with the successful sync record. Migration 0119 starts GitHub/Jira recovery from NULL while preserving documents, versions, jobs and audit history. The CLI schema count is 107.totalremains required.The readers, checkpoint transaction, recovery migration and regression tests stay together because the guarantee that no unread tickets are skipped must be checked through the real ingestion and storage paths. Most added lines are regression coverage. Custom batch progression remains in #1397; this PR does not close #1212.
How it was checked
On Windows, current head
3cabf315526e56a8339d4e72781548b291b4a327passed:UTOPIA_TEST_REQUIRE_DB=1.cargo fmt --all --check,cargo clippy --locked --offline --workspace --all-targets -- -D warnings, andgit diff --check.The existing JQL test now checks the complete query both with and without a checkpoint, including
key ASC; the existing pagination test also checks the emitted query. No test files or ignored tests were added for this review fix. These HTTP fixtures validate the emitted query and reader behavior, not a live Jira server's sorting engine.Current head
3cabf315526e56a8339d4e72781548b291b4a327passed all six CI checks: lint, test, build, backend, web and migrations. The CI log confirms the exact JQL assertions, equal-time Jira pagination and all eight checkpoint regressions ran successfully. The earlier local full-workspace run encountered a Windows Poppler/CJK-resource failure inpdf_gbk; this revision reran the related tests locally and uses the full Linux CI suite for workspace validation. No tests or expectations were disabled.Integration and recovery
Per the reviewed merge order, this PR merges first with migration 0119/schema count 107. #1409 will move to 0121/108, and #1397 will rebase onto the updated
sync_sourceflow.Existing GitHub/Jira sources start with no checkpoint and rescan from the beginning. At the nominal 200-item budget, a 20,000-issue repository needs about 100 runs to catch up; a complete equal-time group may exceed that per-run budget. Existing documents, versions and jobs are retained.
Tradeoffs
The second pass adds listing requests and cannot provide an atomic snapshot; a continuously changing prefix may repeatedly fail. The Jira key tie-breaker stabilizes equal-time ordering but does not prevent updates from moving items between pages. Complete discussions increase request count, memory use and run duration. Ordinary job retries do not persist a long
Retry-Afterdeadline, so later attempts are not guaranteed to honor it.Before review