angular/aio/aio-builds-setup/dockerbuild/scripts-js/test/common
George Kalpakas c4340970c7 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]: baa3e18812/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
2022-05-09 11:54:08 -07:00
..
circleci-api.spec.ts fix(docs-infra): handle CircleCI API v2 responses in preview server (#45934) 2022-05-09 11:54:08 -07:00
github-api.spec.ts build: upgrade all preview-server JS dependencies to latest versions (#38736) 2020-09-08 10:07:25 -07:00
github-pull-requests.spec.ts refactor(docs-infra): take advantage of latest Jasmine features in preview server tests (#36837) 2020-05-05 17:46:46 -07:00
github-teams.spec.ts refactor(docs-infra): take advantage of latest Jasmine features in preview server tests (#36837) 2020-05-05 17:46:46 -07:00
utils.spec.ts test(docs-infra): fix preview server unit tests on Windows (#25671) 2018-09-26 15:26:19 -07:00