-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
🚨This issue needs some love.This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Bug
When using the Cloud Build API, I initially attempted to await builds as a long running operation:
const [resp] = await cb.runBuildTrigger({
projectId: project,
triggerId: args.trigger,
source: {
projectId: project,
branchName: 'master', // TODO: It might fail if we change the default branch.
substitutions: {
_GITHUB_TOKEN: token.token,
_PR: args.pr.toString(),
_PR_BRANCH: prData.head.ref,
_PR_OWNER: prOwner,
_REPOSITORY: prRepo,
// _CONTAINER must contain the image digest. For example:
// gcr.io/repo-automation-tools/nodejs-post-processor**@1234abcd**
// TODO: read this from OwlBot.yaml.
_CONTAINER: args.image,
_DEFAULT_BRANCH: args.defaultBranch ?? 'master',
},
},
});
const [build] = await resp.promise();This code did not successfully wait for a build to complete and return a build object.
As a workaround we implemented our own polling behavior (see here).
Expected Behavior
const [build] = await resp.promise(); waits for build to complete and returns the build object.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.