mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(docs-infra): handle CircleCI API v2 responses in preview server (#45934)
In PR #45349 we switched to using version 2 of the CircleCI API. It turns out that this version of the API (in addition to different URLs) also returns different info from some endpoints, which we have failed to account for. More specifically, the v2 API response for a job does not contain info that we need in [BuildRetriever][1]. As an example, see the API responses for an `aio_preview` run: - [API v1.1][2] - [API v2][3] This commit updates the code to handle API v2 responses. In addition, since the info we need is not present in the job info (as it was with the previous version of the API), we now also retrieve the pipeline info. NOTE: This issue did not manifest earlier, because the preview server code on the VM was not updated to the latest version (that tried to use API v2) due to a different error. This error was fixed with PR #45895, which allowed the preview server to be updated on the VM and uncovered the API v2 incompatibility. [1]: https://github.com/angular/angular/blob/baa3e18812127e7266580f4cd202a4cb3204cbcb/aio/aio-builds-setup/dockerbuild/scripts-js/lib/preview-server/build-retriever.ts#L39-L45 [2]: https://circleci.com/api/v1.1/project/github/angular/angular/1163816 [3]: https://circleci.com/api/v2/project/gh/angular/angular/job/1163816 Fixes #45931 PR Close #45934
This commit is contained in:
committed by
Andrew Kushnir
parent
af253cc2ea
commit
c4340970c7
@@ -4,6 +4,8 @@ export const enum BuildNums {
|
||||
BUILD_INFO_BUILD_FAILED,
|
||||
BUILD_INFO_INVALID_GH_ORG,
|
||||
BUILD_INFO_INVALID_GH_REPO,
|
||||
PIPELINE_INFO_ERROR,
|
||||
PIPELINE_INFO_404,
|
||||
CHANGED_FILES_ERROR,
|
||||
CHANGED_FILES_404,
|
||||
CHANGED_FILES_NONE,
|
||||
@@ -21,6 +23,17 @@ export const enum BuildNums {
|
||||
TRUST_CHECK_INACTIVE_TRUSTED_USER,
|
||||
}
|
||||
|
||||
export const enum PipelineIds {
|
||||
PIPELINE_INFO_ERROR = 'pipeline-error',
|
||||
PIPELINE_INFO_404 = 'pipeline-404',
|
||||
CHANGED_FILES_ERROR = 'pipeline-cfe',
|
||||
CHANGED_FILES_404 = 'pipeline-cf404',
|
||||
CHANGED_FILES_NONE = 'pipeline-cfn',
|
||||
TRUST_CHECK_ERROR = 'pipeline-tce',
|
||||
TRUST_CHECK_UNTRUSTED = 'pipeline-tcu',
|
||||
PIPELINE_INFO_OK = 'pipeline-ok',
|
||||
}
|
||||
|
||||
export const enum PrNums {
|
||||
CHANGED_FILES_ERROR = 1,
|
||||
CHANGED_FILES_404,
|
||||
|
||||
Reference in New Issue
Block a user