fix(cli): support next_token sync pagination#2818
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 require-ready-label-and-ciWonderful, this rule succeeded.
|
Greptile SummaryThis PR extends the generated sync layer to recognize
Confidence Score: 5/5Safe to merge. The changes are well-scoped additive extensions with no behavioral regressions on existing sync paths. All three change areas (next_token cursor detection, SinceParamFormat propagation, and date-format conversion) are self-contained and well-tested. The parse ladder in formatSyncSinceValue handles RFC3339, RFC3339Nano, and pure-date inputs correctly. The SinceParamFormat field is threaded consistently through every copy site in profiler.go and both template loops. The injected end-to-end test compiles and exercises the generated code against a realistic multi-leaf spec. No files require special attention. Important Files Changed
|
Merge Queue Status
This pull request spent 10 minutes 35 seconds in the queue, including 10 minutes 21 seconds running CI. Required conditions to merge
|
Summary
Generated REST sync now recognizes
next_tokenas a cursor request parameter and response cursor field, so multi-page APIs using that token shape no longer fall back to the hardcodedaftercursor.The sync profiler also carries temporal parameter formats into generated CLIs. Date-only lower-bound params such as
start_datenow receiveYYYY-MM-DD, while datetime params keep RFC3339 values.A generated-output test covers the multi-leaf collection shape from the issue: shared
/usercollection/...list paths stay syncable, auth-tagged webhook resources stay out of the default sync set, cursor-backed resources are marked paginated, and the generated runtime helper formats date-only sync params correctly.Closes #2804
Verification
go test ./...scripts/golden.sh verifyscripts/verify-generator-output.shgolangci-lint run ./...