Skip to content

Commit 9d0ee0b

Browse files
committed
Remove CircleCI environment variable requirement
I think this only reason we needed this was to support passing any job id to `--build`, instead of requiring the `process_artifacts` job. And to do that you needed to use the workflows API endpoint, which requires an API token. But now that the `--commit` argument exists and automatically finds the correct job id, we can just use that.
1 parent 900a3a7 commit 9d0ee0b

File tree

4 files changed

+1
-58
lines changed

4 files changed

+1
-58
lines changed

scripts/release/download-experimental-build.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const {
99
handleError,
1010
} = require('./utils');
1111

12-
const checkEnvironmentVariables = require('./shared-commands/check-environment-variables');
1312
const downloadBuildArtifacts = require('./shared-commands/download-build-artifacts');
1413
const parseParams = require('./shared-commands/parse-params');
1514
const printSummary = require('./download-experimental-build-commands/print-summary');
@@ -26,7 +25,6 @@ const run = async () => {
2625
params.cwd = join(__dirname, '..', '..');
2726
params.packages = await getPublicPackages(true);
2827

29-
await checkEnvironmentVariables(params);
3028
await downloadBuildArtifacts(params);
3129

3230
printSummary(params);

scripts/release/prepare-release-from-ci.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
const {join} = require('path');
66
const {addDefaultParamValue, handleError} = require('./utils');
77

8-
const checkEnvironmentVariables = require('./shared-commands/check-environment-variables');
98
const downloadBuildArtifacts = require('./shared-commands/download-build-artifacts');
109
const parseParams = require('./shared-commands/parse-params');
1110
const printPrereleaseSummary = require('./shared-commands/print-prerelease-summary');
@@ -19,7 +18,6 @@ const run = async () => {
1918
const params = await parseParams();
2019
params.cwd = join(__dirname, '..', '..');
2120

22-
await checkEnvironmentVariables(params);
2321
await downloadBuildArtifacts(params);
2422

2523
if (!params.skipTests) {

scripts/release/shared-commands/check-environment-variables.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

scripts/release/utils.js

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,8 @@ const extractCommitFromVersionNumber = version => {
5858
};
5959

6060
const getArtifactsList = async buildID => {
61-
const buildMetadataURL = `https://circleci.com/api/v1.1/project/github/facebook/react/${buildID}?circle-token=${process.env.CIRCLE_CI_API_TOKEN}`;
62-
const buildMetadata = await http.get(buildMetadataURL, true);
63-
if (!buildMetadata.workflows || !buildMetadata.workflows.workflow_id) {
64-
console.log(
65-
theme`{error Could not find workflow info for build ${buildID}.}`
66-
);
67-
process.exit(1);
68-
}
69-
const artifactsJobName = 'process_artifacts_combined';
70-
const workflowID = buildMetadata.workflows.workflow_id;
71-
const workflowMetadataURL = `https://circleci.com/api/v2/workflow/${workflowID}/job?circle-token=${process.env.CIRCLE_CI_API_TOKEN}`;
72-
const workflowMetadata = await http.get(workflowMetadataURL, true);
73-
const job = workflowMetadata.items.find(
74-
({name}) => name === artifactsJobName
75-
);
76-
if (!job || !job.job_number) {
77-
console.log(
78-
theme`{error Could not find "${artifactsJobName}" job for workflow ${workflowID}.}`
79-
);
80-
process.exit(1);
81-
}
82-
83-
const jobArtifactsURL = `https://circleci.com/api/v1.1/project/github/facebook/react/${job.job_number}/artifacts?circle-token=${process.env.CIRCLE_CI_API_TOKEN}`;
61+
const jobArtifactsURL = `https://circleci.com/api/v1.1/project/github/facebook/react/${buildID}/artifacts`;
8462
const jobArtifacts = await http.get(jobArtifactsURL, true);
85-
8663
return jobArtifacts;
8764
};
8865

0 commit comments

Comments
 (0)