Repository navigation
feat(connectors): add --wait to connectors sync - #291
Merged
Merged
Conversation
…ken read
- `--wait` printed a re-marshalled five-field struct after the empty `{}`
accept document: the rest of the server's `.status` was lost and
`lastError`/`errorKind` were forced into the output. Keep the status as
sent and make it the command's single document; the accept response is
still validated, so a non-JSON 2xx stays a mutation error.
- A 200 without `connectorView.connector` was read as "no status yet" and
polled to the full `--wait-timeout`. It now exits 6 at once. A connector
that has never synced (no `.status`) is still waited on, which is what the
empty `completedAt` baseline exists for.
- A terminal `SYNC_STATUS_ERROR` with an empty `lastError` is a failure too;
`errorKind` cannot stand in for it (a clean DONE carries
`ERROR_KIND_UNSPECIFIED`).
- A failure writing the final status now reports `applied: true`, like every
other post-write failure.
- Docs state the single-document output, the exit-6 case and the ERROR
status; a stray blank line in the CHANGELOG list is gone.
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Live on the dev tenant: a connector created with an empty config stays SYNC_STATUS_DONE with null timestamps (its syncs record NOT_CONNECTED), and a connector whose syncs the server refuses stays RUNNING with a lastError and no completion time. Neither advances .status.completedAt, so --wait cannot tell them from a sync that has not started yet: it reports them at the timeout, with "connectors get" showing why. Say that in the help and both docs, and pin that a DONE-without-timestamp status keeps waiting instead of ending the wait (ending it would abort a wait whose connector was configured a moment ago). A never-synced connector does report .status (SYNC_STATUS_UNSPECIFIED with null timestamps), so the help no longer claims it omits the object. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
- README: re-wrap the paragraph the last edit left long. - Wait comment: say what actually makes the wait end at the timeout -- a status whose completedAt never advances looks the same at every poll -- and cover the refused/RUNNING case the docs describe. - Test: pin the live creation shape (SYNC_STATUS_UNSPECIFIED with null timestamps) ending on the sync whose completedAt advances. The docs claim both that shape and an omitted .status; only omission was pinned. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
c1i connectors sync <connector-id> --app-id <app> --wait [--wait-timeout 15m]..status.completedAtas a baseline; the wait ends only on a latercompletedAt, so an already-DONE connector cannot end it early..statusobject, as the server sent it, as the command's single document, in place of the API's empty{}. The accept response is still validated, so a non-JSON 2xx stays a mutation error. This is opt-in throughwithWaitResultOutput(); no other--waitoutput changes.connectorView.connectorexits6at once rather than polling to the timeout. A never-synced connector reports.statuswithSYNC_STATUS_UNSPECIFIEDand null timestamps (or omits it) and is waited on normally.SYNC_STATUS_ERROR, or a.status.lastError, exits1withapplied: true, naming it..status.errorKindis deliberately not checked: a clean DONE carriesERROR_KIND_UNSPECIFIED, its enum's zero value, not""..status.completedAtnever advances (an unconfigured connector staysSYNC_STATUS_DONEwith null timestamps; a sync the server refuses before it starts staysRUNNINGwith alastError) is reported at the timeout, not as a sync error: the wait cannot tell it from a sync that has not started yet.connectors getshows its.status.applied: true.--wait, behavior is unchanged.Verified
lastError, terminalSYNC_STATUS_ERRORwith nolastError, missingconnectorView.connector, both never-synced shapes, a non-JSON accept response, a failed status write, and the timeout..status(includingupdatedAtand the newcompletedAt). A connector created with an empty config (.statusSYNC_STATUS_UNSPECIFIEDwith null timestamps, laterDONEwith null timestamps) and a connector whose syncs are refused (RUNNING+lastError, nocompletedAt) both behave as described above.