Actions

Developer Area/Release Instructions/Release day: Difference between revisions

From Mahara Wiki

< Developer Area‎ | Release Instructions
Line 18: Line 18:


*✅ What minor point release are you going to do?
*✅ What minor point release are you going to do?
*✅ Is there a [[Developer Area/Release Instructions/Pre-release investigation and tasks#Creating a release on Launchpad|release]] ready receive tarballs to on Launchpad?
*✅ <code>git pull [https://git.mahara.org/scripts/mahara-scripts mahara-scripts]</code>
*✅ <code>git pull [https://git.mahara.org/scripts/mahara-scripts mahara-scripts]</code>
*✅ Valid GPG - do you have a [https://wiki.mahara.org/wiki/Developer_Area/Release_Instructions/Creating_a_GPG_key valid GPG key] added to your Launchpad account? See https://launchpad.net/~username/+editpgpkeys
*✅ Valid GPG - do you have a [https://wiki.mahara.org/wiki/Developer_Area/Release_Instructions/Creating_a_GPG_key valid GPG key] added to your Launchpad account? See https://launchpad.net/~username/+editpgpkeys
*✅ <code>lptools</code> - do you have the lp-upload-project installed for uploading the release tars? <code> apt-get install lptools</code>
*✅ <code>lptools</code> - do you have the lp-upload-project installed for uploading the release tars? <code> apt-get install lptools</code>


==📓 Prepare the change log and release notes==
==📓 Prepare the changelog and release notes==


====Change log template:====
====Change log template:====
Line 49: Line 50:
  the upgrade on it first, to minimise the effect of any potential unforeseen problems.
  the upgrade on it first, to minimise the effect of any potential unforeseen problems.
                                                              
                                                              
==⚡ The release script==


==🛠 [[Developer Area/Release Instructions/Pre-release investigation and tasks#Creating a release on Launchpad|Create the release on Launchpad (if there isn't one)]]==
*A git repo will be created at <code>/tmp/mahara.####/mahara/</code> cloned from https://git.mahara.org/mahara/mahara .
==⚡ Initiate the release script==
*Pre-built Mahara archives are generated and put into your current folder.
*You will get a <code>release-X.Y.Z-cleanup.sh</code> script to run later.


Go into your <code>mahara-scripts</code> and run the first step: <code>./release.php X.Y.Z X.Y_DEV #[version][branch])(For rc X.Yrc1)</code>
=== Run the script ===
Go into <code>mahara-scripts</code> and run <code>./release.php X.Y.Z X.Y_DEV</code> , i.e. <code>[version number][branch] For rc X.Yrc1</code>  


*When prompted, insert your change log.
#When prompted, insert your changelog.
*When prompted, insert your release notes.
#(TEMPORARY: <code>sshphp</code>) Open up <code>/tmp/mahara.####/mahara/make.log</code> to watch for prompts.
*A pre-built version of Mahara is generated and put into <code>.zip</code> and <code>.tar</code> file in same folder.
#Respond to the prompts in your terminal with <code>y</code> .
*You will get a <code>release-X.Y.Z-cleanup.sh</code> script. You will run this later.


===🚨 Check the terminal output in case there are GPG errors,===
Any data you enter for the changelog or release notes prompts will go into the Launchpad release page. You can enter it here, or leave it empty here and enter it directly into the Launchpad webpage.
Example: Tag new version bump commit as 'X.YRC2_RELEASE' error: gpg failed to sign the data error: unable to sign the tag
 
===Check the terminal output in case there are GPG errors===
E.g. <code>Tag new version bump commit as 'X.YRC2_RELEASE' error: gpg failed to sign the data error: unable to sign the tag</code>


So this is what I did to fix it, all commands are on command line:
So this is what I did to fix it, all commands are on command line:
Line 72: Line 77:
then run again <code> echo "test" | gpg2 --clearsign</code>
then run again <code> echo "test" | gpg2 --clearsign</code>


After all that when I ran release.php command again it didn't give me the error
After all that when I ran <code>release.php</code> command again it didn't give me the error.
 
Note that the repos that will be pushed back to git.mahara.org are live in your /tmp.  


'''Do not reboot your machine''' in the middle of doing a release or you will have to run through the release script again.
'''Do not reboot your machine''' in the middle of doing a release or you will have to run through the release script again.
Line 105: Line 108:


#Install a fresh <code>X.Y.Z-1</code> site (one version before your working one).
#Install a fresh <code>X.Y.Z-1</code> site (one version before your working one).
#Upgrade to <code>X.Y.Z</code> with the CLI script <code>htdocs/admin/cli/upgrade.php</code>.
#Switch the code to your current release and upgrade to <code>X.Y.Z</code> with the CLI script <code>htdocs/admin/cli/upgrade.php</code>.
#Make a quick check that everything works (create a portfolio, a blog with a blog post, a group with a forum and a forum post).
#Check that everything works (create a portfolio, a blog with a blog post, a group with a forum and a forum post).
#Reset your database.
#Reset your database.
#Install a fresh <code>X.Y.Z-1</code> .
#Install a fresh <code>X.Y.Z-1</code>  
#Upgrade to <code>X.Y.Z</code> by going to the site and clicking 'Upgrade'.
#Switch the code to your current release and upgrade to <code>X.Y.Z</code> by going to the site and clicking 'Upgrade'.
#Repeat with PostgreSQL/MySQL.
#Repeat with PostgreSQL/MySQL.


=Sign and upload the tarballs=
==🚀 Sign and upload the tarballs==
Run the next part of the release script, i.e. the script that was spit out by the release script.
Run upload the release and clean up any temporary files with <code>./release-X.Y.Z-cleanup.sh</code>
<code>./release-X.Y.Z-cleanup.sh</code>
You will be prompted for enter release notes and a changelog. This will happen once for each archive file that is being uploaded, so you'll see six prompts total. Any data you enter here will go into the Launchpad release page. So, you can either enter it here, or leave it empty here and enter it directly into the Launchpad webpage.


'''Note I''': If running this file stops before completion for any reason you will need to edit it and comment out the bits that did finish so that you don't run those buts twice then try the script again. For example the script does the bit where it pushes the tag to the git remote and signs the zipped files but doesn't upload them - you would need to comment out the 'git push' lines and the 'gpg --armor' lines.
'''Note I''': If running this file stops before completion for any reason you will need to edit it and comment out the bits that did finish so that you don't run those buts twice then try the script again. For example the script does the bit where it pushes the tag to the git remote and signs the zipped files but doesn't upload them - you would need to comment out the 'git push' lines and the 'gpg --armor' lines.
Line 121: Line 122:
'''Note II''': If the zipped files fail to upload to Launchpad via the script then you will need to manually upload the zipped files and their corresponding .asc files. To do this go to the milestone page in Launchpad and click the 'Add download file' link. Set the description to: release tarball and choose the matching zipped and .asc file to upload
'''Note II''': If the zipped files fail to upload to Launchpad via the script then you will need to manually upload the zipped files and their corresponding .asc files. To do this go to the milestone page in Launchpad and click the 'Add download file' link. Set the description to: release tarball and choose the matching zipped and .asc file to upload


You will need to do this for all the three types: .zip, .tar.bz2, .tar.gz
You will need to do this for all the three types: <code>.zip, .tar.bz2, .tar.gz</code>
 
==🐛 Update bugs on the tracker==
Go to Launchpad and click on all of the bugs targeted for that milestone and move them from 'Fix committed' to 'Fix released'.


=Update bugs on the tracker=
'''OR'''
On Launchpad, click on all of the bugs targeted for that milestone and move them from "Fix committed" to "Fix released".


To save some clicking you can go to the milestone page and open all the bugs in new tabs at once by pasting the following into the browser console (firefox)
In Firefox, go to the milestone page and open all the bugs in new tabs at once by pasting the following into the browser console.
  var result = document.evaluate("//tbody//tr[contains(., 'Committed')]//a[contains(@href, 'bugs')]", document, null, XPathResult.ANY_TYPE,null ); var mycount=0; while(node = result.iterateNext()) { window.open(node.href, '_blank'); mycount++; if (mycount == 50) { break; } }
  var result = document.evaluate("//tbody//tr[contains(., 'Committed')]//a[contains(@href, 'bugs')]", document, null, XPathResult.ANY_TYPE,null ); var mycount=0; while(node = result.iterateNext()) { window.open(node.href, '_blank'); mycount++; if (mycount == 50) { break; } }
You will ned to allow popups for the site for this to work and it will open up to 50 bugs where the status is 'Committed'. If you have more than 50 to do - mark the first ones 'released' - refresh the list and do again.
You will ned to allow popups for the site for this to work and it will open up to 50 bugs where the status is 'Committed'. If you have more than 50 to do - mark the first ones 'released' - refresh the list and do again.
Line 132: Line 135:
Now is also a good time to create the next release number in the series. Any remaining bugs that were not fixed for this release may be transferred to the next one, if they're still on the roadmap but were simply delayed.
Now is also a good time to create the next release number in the series. Any remaining bugs that were not fixed for this release may be transferred to the next one, if they're still on the roadmap but were simply delayed.


=Put the release notes on the wiki page=
==📔 Put the release notes on the wiki page==
This is just adding a link to the right page on Launchpad, we no longer have a duplicate copy of the release notes on the wiki.
This is just adding a link to the right page on Launchpad, we no longer have a duplicate copy of the release notes on the wiki.


[[Releases|Release notes page]]
[[Releases|Release notes page]]


=Language packs=
==🌏 Language packs==
[[Developer Area/Language Packs/Launchpad Branching|Create a new translation branch on launchpad.net and update the language scripts]] for the new release so that they appear on <nowiki>http://langpacks.mahara.org</nowiki>
[[Developer Area/Language Packs/Launchpad Branching|Create a new translation branch on launchpad.net and update the language scripts]] for the new release so that they appear on <nowiki>http://langpacks.mahara.org</nowiki>

Revision as of 18:30, 11 March 2022

📋 Final checks before starting release day

🚨 Make sure that any security reviews/patches are merged before proceeding 🚨

🔒 Security team (if you don't have +2 review status, you won't be able to see these patches)

  • ✅ Merge the 'Draft' security patches.
  • ✅ Update the related Launchpad bugs to 'Public security'.

🛠 Release manager

  • ✅ CVE #'s - Security issues have an assigned CVE number?
  • ✅ Backporting - security fixes backported to all supported versions that need them?
  • ✅ Bugs fixed - all bugs going into his release have their fixes merged for all supported versions?
  • ✅ Comms - to Mahara partners + drafted the forum posts?

👷🏻 For all devs

📓 Prepare the changelog and release notes

Change log template:

Note: You can copy the list of bugs from the milestone page and re-format the list. Remove the 'bump version number' commits text.

Bug XXXXXXX: <Title of bug>
Bug XXXXXXX: <Title of bug>
Bug XXXXXXX: <Title of bug>
...

Release notes template:

Note: Replace the <XX.XX.X> with the milestone/version you are working on.

Mahara <XX.XX.X> Release Notes
This is a stable release of Mahara <XX.XX>. Stable release are fit for general use. 
If you find a bug, please report it to the tracker:
https://bugs.launchpad.net/mahara/+filebug
This release includes an upgrade path from 1.1.0. 
If you wish to upgrade, we encourage you to make a copy of your website and test 
the upgrade on it first, to minimise the effect of any potential unforeseen problems.
                                                            

⚡ The release script

  • A git repo will be created at /tmp/mahara.####/mahara/ cloned from https://git.mahara.org/mahara/mahara .
  • Pre-built Mahara archives are generated and put into your current folder.
  • You will get a release-X.Y.Z-cleanup.sh script to run later.

Run the script

Go into mahara-scripts and run ./release.php X.Y.Z X.Y_DEV , i.e. [version number][branch] For rc X.Yrc1

  1. When prompted, insert your changelog.
  2. (TEMPORARY: sshphp) Open up /tmp/mahara.####/mahara/make.log to watch for prompts.
  3. Respond to the prompts in your terminal with y .

Any data you enter for the changelog or release notes prompts will go into the Launchpad release page. You can enter it here, or leave it empty here and enter it directly into the Launchpad webpage.

Check the terminal output in case there are GPG errors

E.g. Tag new version bump commit as 'X.YRC2_RELEASE' error: gpg failed to sign the data error: unable to sign the tag

So this is what I did to fix it, all commands are on command line:

  1. Update the gpg program with: git config --global gpg.program gpg2
  2. Test if it is working with: echo "test" | gpg2 --clearsign

It wasn't so I had to do: export GPG_TTY=$(tty)

then run again echo "test" | gpg2 --clearsign

After all that when I ran release.php command again it didn't give me the error.

Do not reboot your machine in the middle of doing a release or you will have to run through the release script again.

Note: For release candidates the commit message should be empty.

✅ Testing

With continuous Behat testing throughout development, we only need to some basic manual testing.

The following needs to be tested with MySQL as well as PostgreSQL.

Extract the build and prep the database

  1. Extract the build (.tar or .zip) of your pre-built Mahara and make sure you can connect to it via web installer.
  2. Drop the database and create a new blank one.

Test case: Install the site with CLI and the web interface

Test that we can install Mahara with the pre-built packages:

  1. Install Mahara using the CLI script htdocs/admin/cli/install.php.
  2. Reset your database.
  3. Go to your Mahara site and click 'Install'.
  4. Reset your database.
  5. Repeat with MySQL/PostgreSQL.

Note: If we are doing a .0 release the install will complain about missing $versions->$currentmajorversion->latest release number but don't panic this is because the local copy of the release has the series version that doesn't exist upstream yet so we can ignore this warning·

Test case: Manual upgrade with CLI and the web interface

Once we are all happy with that we need to run these manual upgrade tests

  1. Install a fresh X.Y.Z-1 site (one version before your working one).
  2. Switch the code to your current release and upgrade to X.Y.Z with the CLI script htdocs/admin/cli/upgrade.php.
  3. Check that everything works (create a portfolio, a blog with a blog post, a group with a forum and a forum post).
  4. Reset your database.
  5. Install a fresh X.Y.Z-1
  6. Switch the code to your current release and upgrade to X.Y.Z by going to the site and clicking 'Upgrade'.
  7. Repeat with PostgreSQL/MySQL.

🚀 Sign and upload the tarballs

Run upload the release and clean up any temporary files with ./release-X.Y.Z-cleanup.sh

Note I: If running this file stops before completion for any reason you will need to edit it and comment out the bits that did finish so that you don't run those buts twice then try the script again. For example the script does the bit where it pushes the tag to the git remote and signs the zipped files but doesn't upload them - you would need to comment out the 'git push' lines and the 'gpg --armor' lines.

Note II: If the zipped files fail to upload to Launchpad via the script then you will need to manually upload the zipped files and their corresponding .asc files. To do this go to the milestone page in Launchpad and click the 'Add download file' link. Set the description to: release tarball and choose the matching zipped and .asc file to upload

You will need to do this for all the three types: .zip, .tar.bz2, .tar.gz

🐛 Update bugs on the tracker

Go to Launchpad and click on all of the bugs targeted for that milestone and move them from 'Fix committed' to 'Fix released'.

OR

In Firefox, go to the milestone page and open all the bugs in new tabs at once by pasting the following into the browser console.

var result = document.evaluate("//tbody//tr[contains(., 'Committed')]//a[contains(@href, 'bugs')]", document, null, XPathResult.ANY_TYPE,null ); var mycount=0; while(node = result.iterateNext()) { window.open(node.href, '_blank'); mycount++; if (mycount == 50) { break; } }

You will ned to allow popups for the site for this to work and it will open up to 50 bugs where the status is 'Committed'. If you have more than 50 to do - mark the first ones 'released' - refresh the list and do again.

Now is also a good time to create the next release number in the series. Any remaining bugs that were not fixed for this release may be transferred to the next one, if they're still on the roadmap but were simply delayed.

📔 Put the release notes on the wiki page

This is just adding a link to the right page on Launchpad, we no longer have a duplicate copy of the release notes on the wiki.

Release notes page

🌏 Language packs

Create a new translation branch on launchpad.net and update the language scripts for the new release so that they appear on http://langpacks.mahara.org