Skip to content

Commit

Permalink
Remove error code step from publish script (#18350)
Browse files Browse the repository at this point in the history
Error codes don't need to be pulled from CI anymore because the ones
in source are already expected to match the build output.

I noticed this when running the 16.13.1 release. Patch releases are cut
with the commit used to build the previous release as a base. So the
publish script accidentally reverted the changes that had landed to
the error codes file since then.
  • Loading branch information
acdlite authored Mar 19, 2020
1 parent 9e7f334 commit 31e6756
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 80 deletions.
46 changes: 0 additions & 46 deletions scripts/release/publish-commands/download-error-codes-from-ci.js

This file was deleted.

34 changes: 2 additions & 32 deletions scripts/release/publish-commands/print-follow-up-instructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const run = async ({cwd, packages, tags}) => {
// All packages are built from a single source revision,
// so it is safe to read build info from any one of them.
const arbitraryPackageName = packages[0];
const {commit, environment} = readJsonSync(
const {commit} = readJsonSync(
join(cwd, 'build', 'node_modules', arbitraryPackageName, 'build-info.json')
);

Expand All @@ -22,10 +22,6 @@ const run = async ({cwd, packages, tags}) => {
`${cwd}/build/node_modules/react/package.json`
);

const branch = await execRead('git branch | grep \\* | cut -d " " -f2', {
cwd,
});

clear();

if (tags.length === 1 && tags[0] === 'next') {
Expand Down Expand Up @@ -58,37 +54,13 @@ const run = async ({cwd, packages, tags}) => {
if (status) {
console.log(theme.path`• packages/shared/ReactVersion.js`);
}

console.log();
if (environment === 'ci') {
console.log('Auto-generated error codes have been updated as well:');
console.log(theme.path`• scripts/error-codes/codes.json`);
} else {
console.log(
theme`{caution The release that was just published was created locally.} ` +
theme`Because of this, you will need to update the generated ` +
theme`{path scripts/error-codes/codes.json} file manually:`
);
console.log(theme` {command git checkout} {version ${commit}}`);
console.log(theme` {command yarn build -- --extract-errors}`);
}
}

console.log();
console.log(
theme`{header Don't forget to also update and commit the }{path CHANGELOG}`
);

if (branch !== 'master') {
console.log();
console.log(
theme`{header Don't forget to cherry-pick any updated error codes into the} {path master} {header branch}.`
);
console.log(
theme`Else they will not be properly decoded on {link reactjs.org}.`
);
}

// Prompt the release engineer to tag the commit and update the CHANGELOG.
// (The script could automatically do this, but this seems safer.)
console.log();
Expand Down Expand Up @@ -127,9 +99,7 @@ const run = async ({cwd, packages, tags}) => {
}
}

// Updating reactjs.org accomplishes two things:
// (1) It ensures our Gatsby error codes plugin runs with the latest error codes.
// (2) It keeps the React version shown in the header up to date.
// Update reactjs.org so the React version shown in the header is up to date.
console.log();
console.log(
theme.header`Once you've pushed changes, update the docs site.`
Expand Down
2 changes: 0 additions & 2 deletions scripts/release/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const theme = require('./theme');
const checkNPMPermissions = require('./publish-commands/check-npm-permissions');
const confirmSkippedPackages = require('./publish-commands/confirm-skipped-packages');
const confirmVersionAndTags = require('./publish-commands/confirm-version-and-tags');
const downloadErrorCodesFromCI = require('./publish-commands/download-error-codes-from-ci');
const parseParams = require('./publish-commands/parse-params');
const printFollowUpInstructions = require('./publish-commands/print-follow-up-instructions');
const promptForOTP = require('./publish-commands/prompt-for-otp');
Expand Down Expand Up @@ -45,7 +44,6 @@ const run = async () => {
await checkNPMPermissions(params);
const otp = await promptForOTP(params);
await publishToNPM(params, otp);
await downloadErrorCodesFromCI(params);
await updateStableVersionNumbers(params);
await printFollowUpInstructions(params);
} catch (error) {
Expand Down

0 comments on commit 31e6756

Please sign in to comment.