Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release script --commit param #20720

Merged
merged 1 commit into from
Feb 3, 2021
Merged

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Feb 3, 2021

PR #20717 accidentally broke the --commit parameter because the script errors if you provide both a --build and a --commit.

I solved by removing the validation error. When there's a conflict, it will choose the --build.

(Although maybe we should remove --build and always use --commit. I think --commit is a sufficient replacement.)

PR facebook#20717 accidentally broke the `--commit` parameter because the
script errors if you provide both a `--build` and a `--commit`.

I solved by removing the validation error. When there's a conflict, it
will choose the --`build`.

(Although maybe we should `--build` entirely and always uses `--commit`.
I think `--commit` is a sufficient replacement.)
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 3, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 3, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 65b3132:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Feb 3, 2021

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 65b3132

@sizebot
Copy link

sizebot commented Feb 3, 2021

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 65b3132

@acdlite acdlite merged commit 0e526bc into facebook:master Feb 3, 2021
@bvaughn
Copy link
Contributor

bvaughn commented Feb 3, 2021

How did #20717 break the --commit param?

That PR only affected the scripts/release/download-experimental-build.js which I'm the only person who uses (and I tested it).

Edit Oh, it broke it if you pasted in the reproducible run with the --build param. Gotcha!

process.exit(1);
}
// TODO: Should we just remove the `build` param? Seems like `commit` is a
// sufficient replacement.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the release script README is in a broken state at the moment. I'll take a pass at that too with an update PR.

'--build',
await getLatestMasterBuildNumber(true)
);
addDefaultParamValue(null, '--commit', 'master');
Copy link
Contributor

@bvaughn bvaughn Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a simpler solution but as it stands after this PR, the Firefox DevTools release process will be broken (because their testers need to have a reproducible from source and scripts/release/download-experimental-build.js --commit=master isn't a valid way to repro a specific build). I'll propose a small change with a follow up PR though!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm do we not include the build-info.json with CI builds anymore? I was hoping we could read from it instead but I don't see it in the build2 artifacts.

Copy link
Contributor

@bvaughn bvaughn Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh now I see this:

// FIXME: New build script does not output build-info.json. It's only used
// by this post-publish print job, and only for "latest" releases, so I've
// disabled it as a workaround so the publish script doesn't crash for
// "next" and "experimental" pre-releases.
const {commit} = readJsonSync(

But is there a reason why the new build script doesn't/can't output it? We're in a weird space now where our scripts both validate and require that build-info.json is in the package files array and we no longer publish it 😁

I guess I can always parse it out of the build number?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some follow up: #20723

Copy link
Collaborator Author

@acdlite acdlite Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But is there a reason why the new build script doesn't/can't output it?

Figured it was worth seeing if it's actually necessary anymore. Might be nice to stop requiring every package to publish that file to npm, if we can.

I believe the last remaining reason we need it is because the prepare-release-from-npm needs it. But maybe we can instead pull the build artifacts from CI, like we do with prereleases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, but at the same time I don't see much of a downside of publishing it. It adds a little complexity in one place (but we already have it in place and well "tested") in exchange for avoiding it in another (having to pull a duplicate artifact from CI somehow– which seems difficult to do if we don't have build-info)

acdlite added a commit to acdlite/react that referenced this pull request Feb 3, 2021
This was ported to the new workflow by facebook#20720
acdlite added a commit that referenced this pull request Feb 3, 2021
This was ported to the new workflow by #20720
koto pushed a commit to koto/react that referenced this pull request Jun 15, 2021
PR facebook#20717 accidentally broke the `--commit` parameter because the
script errors if you provide both a `--build` and a `--commit`.

I solved by removing the validation error. When there's a conflict, it
will choose the --`build`.

(Although maybe we should `--build` entirely and always uses `--commit`.
I think `--commit` is a sufficient replacement.)
koto pushed a commit to koto/react that referenced this pull request Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants