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

Add Release Preparation scripts #6713

Merged
merged 39 commits into from
Aug 10, 2023
Merged

Add Release Preparation scripts #6713

merged 39 commits into from
Aug 10, 2023

Conversation

merkushin
Copy link
Member

@merkushin merkushin commented Mar 28, 2023

Resolves #6664

Introduces some automation and platform/environment independence to the release PR preparation.
Please, check the RELEASE.md document for more information on these scripts.

Proposed Changes

  • Add release preparation scripts. It is supposed to simplify part of the release process.

Testing Instructions

  1. Run ./scripts/release.sh X.Y.Z, where X.Y.Z is the version to release. It will create the branch and the PR with a respective name.
  2. Run ./scripts/release.sh X.Y.Z branch-name, where X.Y.Z is the version to release and branch-name is the name of the branch you want to release. It will create the branch and the PR with a respective name.

Demo

p1679982821332209/1679948199.557769-slack-C02NWDZBL0H

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Data is sanitized / escaped
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Test cases are written and passing (including feature flags)
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • We are generally happy with it and don’t feel like it immediately needs to be rewritten
  • Application performance has not degraded
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues
  • Continuous Integration build is passing

@merkushin merkushin requested a review from a team March 28, 2023 05:52
@merkushin merkushin self-assigned this Mar 28, 2023
@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #6713 (c1a9bb1) into trunk (7c75b12) will increase coverage by 1.07%.
Report is 28 commits behind head on trunk.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #6713      +/-   ##
============================================
+ Coverage     48.25%   49.32%   +1.07%     
- Complexity    10534    10538       +4     
============================================
  Files           575      575              
  Lines         44441    44501      +60     
  Branches        402      402              
============================================
+ Hits          21443    21950     +507     
+ Misses        22671    22224     -447     
  Partials        327      327              
Files Changed Coverage Δ
includes/class-sensei.php 23.41% <0.00%> (ø)

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6738bcf...c1a9bb1. Read the comment docs.

@merkushin merkushin marked this pull request as ready for review April 2, 2023 10:36

# Create working directory and checkout Sensei.
mkdir /release && cd /release
git clone [email protected]:Automattic/sensei.git
Copy link
Contributor

Choose a reason for hiding this comment

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

In a CI context, we should use the commit hash the pipeline is executing to make sure we are releasing the exact version that we decide to release.
Maybe we can just assume the clone was done previously.

scripts/release.sh Outdated Show resolved Hide resolved
# Create the release branch.
git switch -c "release/$NEXT_VERSION"

echo "Replace next version tag"
Copy link
Contributor

@gabrielcaires gabrielcaires Apr 3, 2023

Choose a reason for hiding this comment

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

We need update the package.json and the sensei-lms.php

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Should be part of one of our scripts. Or maybe separate scripts?

@merkushin
Copy link
Member Author

Example of creating a release PR from feature/learning-mode-improvements: #6921

@merkushin
Copy link
Member Author

merkushin commented Jun 1, 2023

[x] Update constant in sensei-lms.php

@merkushin
Copy link
Member Author

merkushin commented Jun 1, 2023

[x] Don't remove jest from package-json

@merkushin
Copy link
Member Author

merkushin commented Jun 1, 2023

[x] Update Stable tag in readme.txt

@m1r0
Copy link
Member

m1r0 commented Jun 5, 2023

I think it makes sense for the release script to run the copy-changelog-to-readme.php script as well. WDYT?

@merkushin
Copy link
Member Author

@m1r0

I think it makes sense for the release script to run the copy-changelog-to-readme.php script as well. WDYT?

That's a good question. I wasn't sure about that, because I thought the changelog needs some manual edits almost always. So it is better to run copy-script manually later.
But now I think it won't be harmful: as I remember the script rewrites the whole readme section based on current changelog. I'll add it.

@m1r0
Copy link
Member

m1r0 commented Jun 6, 2023

I'll add it.

Nice!

I thought the changelog needs some manual edits

This shouldn't be the case. Last time was an exception because the readme.txt changelog section was out of sync with the changelog.txt. Our aim is for both to be the same.

@merkushin
Copy link
Member Author

Added.
Looks good: #6959

@donnapep
Copy link
Collaborator

donnapep commented Aug 1, 2023

@merkushin Curious what the status of this one is. I think there are still some comments to address? If so, should we move it back to To Do?

@merkushin merkushin added this to the 4.16.1 milestone Aug 8, 2023
@merkushin
Copy link
Member Author

@donnapep I don't see any open questions at the moment.
I don't see an approval as well.

Copy link
Member

@m1r0 m1r0 left a comment

Choose a reason for hiding this comment

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

Works well with a few minor issues that might be related to my setup! I think we should merge it and any further issues can be fixed on the go.


One such issue that I'm facing is the following error after running ./scripts/release-pr.sh 9.9.9:

includes/class-sensei.php:824: Unexpected `$$next-version$$` token.

To test the release script, I had to comment out the ./scripts/replace-next-version-tag.sh part. But maybe that's something related to my setup.

Another issue that I've faced was:

git clone [email protected]:Automattic/sensei.git
Cloning into 'sensei'...
/root/.ssh/config: line 14: Bad configuration option: usekeychain
/root/.ssh/config: terminating, 1 bad configuration options

But I've managed to fix that by adding IgnoreUnknown UseKeychain to my ssh config:

IgnoreUnknown UseKeychain
UseKeychain yes

I've also had to bump the git version because the git commit gpgsign was not working. (c1a9bb1)

@merkushin
Copy link
Member Author

Thank you @m1r0!

One such issue that I'm facing is the following error after running ./scripts/release-pr.sh 9.9.9:
includes/class-sensei.php:824: Unexpected $$next-version$$ token.

You can see it fixed in this PR:
https://github.com/Automattic/sensei/pull/6713/files#diff-7c893805411bfe432b0339a156b4e16a3cc33527fa2f201432808af846ae2e3aL817

You can try to deploy this branch to avoid encountering the issue.

But I've managed to fix that by adding IgnoreUnknown UseKeychain to my ssh config:

Oh, I don't use the keychain for this purpose, so I didn't encounter this issue. We can find a better solution together later.

@merkushin merkushin merged commit 6585162 into trunk Aug 10, 2023
19 of 20 checks passed
@merkushin merkushin deleted the add/release-branch-prep branch August 10, 2023 22:14
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.

Automate the creation of the release PR
4 participants