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

Changes to release process based on auto-generated frontend assets #109

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/release/publication.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
git push origin $VERSION
```

A draft release will be automatically created on GH once this tag is pushed.

1. **Publish Docker images**

1. Log in to DockerHub
Expand Down Expand Up @@ -99,13 +101,14 @@
docker logout
```

1. **Create GitHub release**
1. **Update the draft GitHub release and publish it**

```
gh release create \
gh release edit \
--latest \
--title "Version $VERSION (alpha release)" \
--notes "__[Release notes](https://docs.mathesar.org/releases/$VERSION/)__" \
--draft=false \
$VERSION
```

Expand Down
121 changes: 55 additions & 66 deletions docs/release/qa.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,55 @@ This page describes manual QA testing routines that we perform before a release.

## Administrator-facing QA {:#admin}

### Pre-requisites for testing Installation & Upgrades

#### For setups from scratch

- Create and push a tag on GitHub with a draft release version.

```sh
git checkout $VERSION
git pull
git tag "draft-$VERSION"
git push origin "draft-$VERSION"
```

- GH will automatically create a draft release containing the static assets for this tag. This will take a few minutes.

- Use the following command to download the static_files.zip asset from the draft release for the "Download release static files and extract into the correct directory" step during installation.

```sh
gh release download --repo mathesar-foundation/mathesar "draft-$VERSION" -p 'static_files.zip'
```

- You could also download this file via the GH web UI.
- Since draft releases aren't final, the urls generated by GH for the assets are dynamic. The static urls are formed when the release is published.

#### For docker related setups

For installations:

- Clear out remains of any previous installations.

For upgrades:

- Clear out remains of any previous installations.
- Install the current published version of Mathesar.

For both:

- Locally download and tag the new version images as `latest`:

```sh
docker image pull mathesar/mathesar-caddy:<version_number>
docker image tag mathesar/mathesar-caddy:<version_number> mathesar/mathesar-caddy:latest

docker image pull mathesar/mathesar-prod:<version_number>
docker image tag mathesar/mathesar-prod:<version_number> mathesar/mathesar-prod:latest
```

### Tasks

- [ ] Test installing the release from scratch by following our documentation
- [ ] Test all different installation methods
- [ ] Docker compose
Expand All @@ -26,78 +75,18 @@ This page describes manual QA testing routines that we perform before a release.
- [ ] New docker compose file, bring `.env` into the new file
- [ ] Build from scratch -- All above variants for build from scratch

### Test the installation process for the new version

1. Clear out your docker containers, images, and volumes:

```sh
docker rm -f $(docker ps -a | awk '{print $1}')
docker rmi $(docker image ls | awk '{print $3}')
docker volume rm $(docker volume ls | awk '{print $2}')
```
This is just to ensure that the below validation starts from a known state.

1. Clear out remains of any previous installations.

- Delete `.env` file and `docker-compose.yml` file within `/etc/mathesar`.
### Cleanup

1. Locally tag the new version as `latest`:
- Destroy any infra setup on GCP that was created for QA purposes.
- Delete the draft release and tag that were created when testing "Setups from scratch".

```sh
docker image pull mathesar/mathesar-caddy:<version_number>
docker image tag mathesar/mathesar-caddy:<version_number> mathesar/mathesar-caddy:latest

docker image pull mathesar/mathesar-prod:<version_number>
docker image tag mathesar/mathesar-prod:<version_number> mathesar/mathesar-prod:latest
gh release delete "draft-$VERSION" -y
git tag -d "draft-$VERSION"
git push -d origin "draft-$VERSION"
```

1. Install the new version:

```sh
bash <(curl -sL https://raw.githubusercontent.com/mathesar-foundation/mathesar/<version_number>/install.sh)
```

- Note that the installation command will vary based on the installation method you use. The above command used the interactive installer.
- Ensure that the installation process does not throw any errors.

### Test upgrades

!!! tip "Optional"
This only needs to be performed for releases which have changes to installation/upgrade setup.

- In case if the release contains changes to installation/upgrade setup, we need to attempt all installation methods and upgrade processes additionally.
- Ideally, this testing would already be taken care of during the course of the release projects.
- To test upgrades for the docker-compose setup, follow the below steps:
- Clean up local docker images and containers.
- Install the current published version of Mathesar.
- Eg., Assuming the current version is `0.1.0`, and the new version we need to release is `0.1.1`:

```sh
bash <(curl -sL https://raw.githubusercontent.com/mathesar-foundation/mathesar/0.1.0/install.sh)
```

- Open Mathesar on browser, create a few tables. Ensure the version shown in the product is the old one. i.e `0.1.0`.
- Run the following commands while Mathesar is running:

```sh
docker image pull mathesar/mathesar-caddy:0.1.1
docker image tag mathesar/mathesar-caddy:0.1.1 mathesar/mathesar-caddy:latest

docker image pull mathesar/mathesar-prod:0.1.1
docker image tag mathesar/mathesar-prod:0.1.1 mathesar/mathesar-prod:latest
```

- Replace `0.1.1` with the new version number.
- Open browser, make the following request manually. The request cannot be made via UI since there isn't a GH release at this point:

```js
fetch('http://localhost/api/ui/v0/upgrade/', { method: 'POST', headers: { 'X-CSRFToken': '<replace_with_csrf_token>', 'Content-Type': 'application/json' }, body: JSON.stringify({}) });
```
- The CSRF token can be found by looking at your cookies. It is named csrftoken.
- Reload the page after request ends. Mathesar should now be upgraded.
- Ensure the version in the Software update page shows the new version. Eg., `0.1.1`.
- It will show an error saying release notes aren't present. This is expected.
- Ensure that the upgrade process does not throw any errors.

## User-facing QA {:#users}

Expand Down
Loading