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

Update release automation script to create WPiOS and WPAndroid PRs #2554

Merged
merged 10 commits into from
Aug 18, 2020

Conversation

ceyhun
Copy link
Contributor

@ceyhun ceyhun commented Aug 17, 2020

Here are the changes made to the script

  • Replaced "npx json" usage with "jq" for faster execution
  • Added string formatting, execute and abort utils
  • The script can now create WPiOS and WPAndroid PRs

To test:

  1. Run the script and use an unusually high version number
  2. Check if Gutenberg, GB-Mobile, WPiOS and WPAndroid PRs are created as drafts
  3. Check if PRs have correct descriptions and changes
  4. Close the draft PRs

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes more info and have added them to RELEASE-NOTES.txt if necessary.

cd ..

# Set version numbers
for file in 'package.json' 'package-lock.json' 'gutenberg/packages/react-native-editor/package.json'; do
npx json -I -f "$file" -e "this.version='$VERSION_NUMBER'" || { echo "Error: could not update version in ${file}"; exit 1; }
Copy link
Contributor

Choose a reason for hiding this comment

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

We may be able to remove the json dependency from the package.json file now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's great!


# Ask for new version number
CURRENT_VERSION_NUMBER=$(./node_modules/.bin/json -f package.json version)
CURRENT_VERSION_NUMBER=$(jq '.version' package.json --raw-output)
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth adding an early check that jq is available so that if it's not available the script can abort with a clear error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense 👍

@mchowning
Copy link
Contributor

Really like these improvements! 😄

The only thought I really have is that it might be nice to add some documentation to the new utility functions that are being added. At least for me, it was far from obvious what, for example, "execute" was used for. I'm far from a bash expert, so some of that is on me, but I feel like it might be nice to just add a bit of context for those methods.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Aug 17, 2020

Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job!

@ceyhun
Copy link
Contributor Author

ceyhun commented Aug 17, 2020

The only thought I really have is that it might be nice to add some documentation to the new utility functions that are being added. At least for me, it was far from obvious what, for example, "execute" was used for. I'm far from a bash expert, so some of that is on me, but I feel like it might be nice to just add a bit of context for those methods.

Sure! I'll add some "docs" as comments to top of the functions 👍

Copy link
Contributor

@cameronvoell cameronvoell left a comment

Choose a reason for hiding this comment

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

LGTM nice work 👍

@cameronvoell cameronvoell merged commit 0bc13d8 into develop Aug 18, 2020
@cameronvoell cameronvoell deleted the try/update-release-automation-script branch August 18, 2020 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants