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

[0.73-stable] Cherry-pick improvements to monorepo publish script #42991

Merged

Conversation

huntie
Copy link
Member

@huntie huntie commented Feb 13, 2024

Cherry-picks the following updates to our find_and_publish_bumped_packages CI workflow onto the 0.73-stable branch (Meta employees: stack beginning D53607809):

These changes should make find_and_publish_bumped_packages 1/ more reliable (built-in network retry), 2/ re-runnable (uses npm as source of truth, meaning it can be rerun from an incomplete previous attempt).

The script is renamed from scripts/monorepo/find-and-publish-all-bumped-packages.js to scripts/releases-ci/publish-updated-packages.

…42936)

Summary:
Pull Request resolved: facebook#42936

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607809

fbshipit-source-id: 990826fda5538af9a13e3f24978295a2f3b0c8c3

# Conflicts:
#	scripts/monorepo/__tests__/find-and-publish-all-bumped-packages-test.js
#	scripts/monorepo/find-and-publish-all-bumped-packages.js
Summary:
Pull Request resolved: facebook#42937

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607810

fbshipit-source-id: 18e79f23060ee70e96bd8ac6e9995b0a8ba300b3

# Conflicts:
#	scripts/monorepo/__tests__/find-and-publish-all-bumped-packages-test.js
#	scripts/monorepo/find-and-publish-all-bumped-packages.js
Summary:
Pull Request resolved: facebook#42938

Substitutes the `forEachPackage` util with a replacement async `getPackages` function. This will be used further in the next diff.

The new function aims to be more erganomic/versatile than `forEachPackage` by returning a package mapping (see updated test mock). The API aligns roughly with `yarn workspaces list` and [Lerna's `detectProjects`](https://lerna.js.org/docs/api-reference/utilities#detectprojects).

This also aligns with / replaces similar attempts in our existing scripts:
- [`getPackagesToPublish`](https://github.com/facebook/react-native/blob/2ca7bec0c2a7d821ceaaf39840a6cdc5eceb8678/scripts/monorepo/get-and-update-packages.js#L56)
- [`getPublicPackages`](https://github.com/facebook/react-native/blob/2ca7bec0c2a7d821ceaaf39840a6cdc5eceb8678/scripts/releases/set-version/index.js#L19)

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607806

fbshipit-source-id: 00ec34edadab863dc8f2f0c7852f6e835a5dddf5

# Conflicts:
#	scripts/monorepo.js
#	scripts/monorepo/find-and-publish-all-bumped-packages.js
#	scripts/monorepo/for-each-package.js
…rerunnable) (facebook#42944)

Summary:
Pull Request resolved: facebook#42944

Updates `find-and-publish-all-bumped-packages` to use the npm registry as the source of truth, similar to tools like Lerna (`lerna publish from-package`). **This enables safe reruns of the publish script**, and replaces the previous Git-diff-detection implementation.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D53607807

fbshipit-source-id: 135808b7ce36cf463c9f53a8059500b83f8b6679

# Conflicts:
#	scripts/monorepo/find-and-publish-all-bumped-packages.js
Summary:
Pull Request resolved: facebook#42964

We've seen npm publishes fail occasionally in CI as part of this script, most recently in S391653. This change adds a single retry, per package, during the execution of this script, in an attempt to reduce the chance of manual interventions after a broken pipeline.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607808

fbshipit-source-id: 526d9c33d51ec57702efba3c199bad313c1bf2d4

# Conflicts:
#	scripts/monorepo/find-and-publish-all-bumped-packages.js
Summary: Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607805

fbshipit-source-id: babe9bbd7fb5e7016b567193727c6a441bee60a3

# Conflicts:
#	scripts/__tests__/publish-updated-packages-test.js
#	scripts/publish-updated-packages.js
#	scripts/releases-ci/README.md
@huntie huntie requested a review from lunaleaps February 13, 2024 11:22
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Feb 13, 2024
}

module.exports = {
getPackages,
Copy link
Member Author

Choose a reason for hiding this comment

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

@lunaleaps Note that I have not included getTagsFromCommitMessage in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@lunaleaps lunaleaps Feb 19, 2024

Choose a reason for hiding this comment

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

Oh I see, we didn't pick #42146. Okay fixed locally with 7d06cd8

Copy link

Fails
🚫

📋 Missing Changelog - Please add a Changelog to your PR description. See Changelog format

Warnings
⚠️ 📋 Missing Summary - Can you add a Summary? To do so, add a "## Summary" section to your PR description. This is a good place to explain the motivation for making this change.
⚠️ 📋 Missing Test Plan - Can you add a Test Plan? To do so, add a "## Test Plan" section to your PR description. A Test Plan lets us know how these changes were tested.
⚠️

Can't find the E2E test log for ci/circleci: test_e2e_ios. Job link

⚠️

Can't find the E2E test log for ci/circleci: test_e2e_ios. Job link

Generated by 🚫 dangerJS against 15501fe

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,500,341 -8,746,606
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 9,754,924 -10,854,426
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 4d07aae
Branch: main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner Pick Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants