Adopt AIP 151 operations - #37
Merged
Merged
Conversation
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.
Problem
Import and discovery jobs run in the background, but their Create APIs return custom responses. Clients cannot use the standard long running operation contract.
Solution
Return
google.longrunning.Operationfrom both Create APIs and expose the standard Operations service. Keep ImportRun and DiscoveryRun as stored resources for progress and history.Major Changes
Note
Medium Risk
This is a breaking RPC contract change for CreateImportRun/CreateDiscoveryRun; callers must use Operations polling and Any unpacking, though the in-repo frontend is updated in the same PR.
Overview
CreateImportRun and CreateDiscoveryRun now return
google.longrunning.Operationinstead of bespoke create responses. Progress lives in operation metadata (ImportRunMetadata/DiscoveryRunMetadatawith the run resource); success and failure useOperation.responseandOperation.error.GetImportRun,ListImportRuns,GetDiscoveryRun, andListDiscoveryRunsstay for history.Buf pulls in googleapis, adds a second generate pass for
google.longrunning.Operations(Go Connect + TS), and marks generated trees as linguist-generated. The web app registers metadata/response types on the Connect JSON registry, exports anoperationsClient, andstartDiscoveryreads the run name from unpacked operation metadata instead of a direct run field.Docs/ADR now describe AIP 151 polling via
GetOperation, one active import or discovery per workspace with parallel creates returningABORTED, and the standard operation shape.Reviewed by Cursor Bugbot for commit 2f4d846. Bugbot is set up for automated code reviews on this repo. Configure here.