-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(releases): improve bump oss script to allow less human errors
Summary: This added React-ImageManager to the use_frameworks! - a lot of rpm modules podspec need this. bypass-github-export-checks [iOS] [FIXED] - Add React-ImageManager path to work with use_frameworks! For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: #38247 Test Plan: Should not be breaking - it will add to the header_search_paths React-ImageManager Reviewed By: dmytrorykun Differential Revision: D47593749 Pulled By: cipolleschi fbshipit-source-id: a66e90707e5fa73573deab1f04e8d8693869a90c chore(releases): improve bump oss script to allow less human errors (#38666) Summary: One of the limitations of the existing flow for the release crew is that they need to manually remember to publish all the other packages in the monorepo ahead of a new patch release - this PR modifies the logic for the bump-oss-version script (and makes it available via yarn) so that it will not run if: * there are git changes lying around * if some of the packages need a new release it required a bit of refactoring to extract some portions of the logic from the bump-all-package-versions script, but I think the end result is pretty decent. ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [INTERNAL] [CHANGED] - improve bump oss script to allow less human errors Pull Request resolved: #38666 Test Plan: * checkout this branch * comment L54 of bump-oss-version.js (to remove the check on the branch name) * run `yarn bump-all-updated-packages`, verify that it works and that it detects that some packages have unreleased code * run `yarn bump-oss-version -t asd -v asd` (the "fake" parameters are needed to pass the yargs check), verify that it will throw an error because it finds a package that has unreleased code Reviewed By: mdvacca Differential Revision: D48156963 Pulled By: cortinico fbshipit-source-id: 2473ad5a84578c5236c905fd9aa9a88113fe8d22 # Conflicts: # scripts/publish-npm.js re-add the file nit Revert "Update new_architecture.rb for React-ImageManager (#38247)" This reverts commit 645264e249f566ce87f6aaf462e029909302fd92.
- Loading branch information
Showing
5 changed files
with
134 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
|
||
const chalk = require('chalk'); | ||
const {echo, exec} = require('shelljs'); | ||
|
||
const detectPackageUnreleasedChanges = ( | ||
packageRelativePathFromRoot, | ||
packageName, | ||
ROOT_LOCATION, | ||
) => { | ||
const hashOfLastCommitInsidePackage = exec( | ||
`git log -n 1 --format=format:%H -- ${packageRelativePathFromRoot}`, | ||
{cwd: ROOT_LOCATION, silent: true}, | ||
).stdout.trim(); | ||
|
||
const hashOfLastCommitThatChangedVersion = exec( | ||
`git log -G\\"version\\": --format=format:%H -n 1 -- ${packageRelativePathFromRoot}/package.json`, | ||
{cwd: ROOT_LOCATION, silent: true}, | ||
).stdout.trim(); | ||
|
||
if (hashOfLastCommitInsidePackage === hashOfLastCommitThatChangedVersion) { | ||
echo( | ||
`\uD83D\uDD0E No changes for package ${chalk.green( | ||
packageName, | ||
)} since last version bump`, | ||
); | ||
return false; | ||
} else { | ||
echo(`\uD83D\uDCA1 Found changes for ${chalk.yellow(packageName)}:`); | ||
exec( | ||
`git log --pretty=oneline ${hashOfLastCommitThatChangedVersion}..${hashOfLastCommitInsidePackage} ${packageRelativePathFromRoot}`, | ||
{ | ||
cwd: ROOT_LOCATION, | ||
}, | ||
); | ||
echo(); | ||
|
||
return true; | ||
} | ||
}; | ||
|
||
module.exports = detectPackageUnreleasedChanges; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters