|
1 | 1 | # Prepare for Auto Upgrade Test |
2 | 2 |
|
| 3 | +@ant-node/Cargo.toml |
3 | 4 | @ant-node/src/bin/antnode/main.rs |
4 | 5 | @ant-node/src/bin/antnode/upgrade/mod.rs |
5 | 6 | @release-cycle-info |
6 | 7 | @ant-build-info/src/release_info.rs |
7 | 8 |
|
8 | 9 | I want you to help me prepare for a test of the automatic-upgrades process. |
9 | 10 |
|
10 | | -The process has 2 phases: preparing the current branch for an auto-upgrade test, and preparing a new |
11 | | -branch with a fake release candidate. |
12 | | - |
13 | | -So first, I need you to reduce the upgrade check time from 3 days to 30 minutes, and reduce the |
14 | | -randomness to 2 minutes. Now you need to make a change to the `fetch_and_cache_release_info` |
15 | | -function. Replace the usage of `release_repo.get_latest_autonomi_release_info` to |
16 | | -`release.get_autonomi_release_info`. This function takes a string, which is the tag of the fake |
17 | | -release that will be created. You need to prompt me for the name. Finally, we have code that |
18 | | -downloads the new binary from an `autonomi.com` URL and uses an S3 URL as a fallback. Another |
19 | | -temporary change is required here to just use the S3 URL directly, since the `autonomi.com` URL |
20 | | -always points to the latest release, which is not what we want for the test. |
21 | | - |
22 | | -Once you've made that change, create a chore commit that indicates these are temporary changes that |
23 | | -will be removed. This commit then needs to be pushed to the origin on the current branch. However, |
24 | | -before you do this, let me review the diff first. Then you can push when I give the go ahead. If you |
25 | | -get an error, you most likely need to force push. This is fine. |
26 | | - |
27 | | -Now the second phase. |
28 | | - |
29 | | -First, I need you to create a new branch from the current one. Prompt me for the name of the new |
30 | | -branch. Second, I need you to run `cargo release version <version> --package ant-node --execute |
31 | | ---no-confirm`. For the version, you should get the current version of the `ant-node` crate, then |
32 | | -increment the `PATCH` component by 1, and also add the `rc.1` suffix. Third, I need you to update |
33 | | -the `release-cycle-info` and `ant-build-info/src/release_info.rs` files. The cycle counter value in |
34 | | -both of them needs to be incremented by 1. |
35 | | - |
36 | | -With these changes, create a commit with the title `chore(release): release candidate |
37 | | -<release_year>.<release_month>.<release_cycle>.<release_cycle_counter>` and in the body, indicate |
38 | | -that it's a fake release candidate. |
| 11 | +## Parameters |
| 12 | + |
| 13 | +Before starting, the user must provide: |
| 14 | + |
| 15 | +- **RELEASE_TAG**: The tag for the fake release that will be fetched during the test. For example, |
| 16 | + `rc-2026.2.2.2`. |
| 17 | +- **UPSTREAM_BRANCH_NAME**: The name of the branch to create on the upstream repository. For |
| 18 | + example, `rc-2026.2.2`. |
| 19 | + |
| 20 | +## Overview |
| 21 | + |
| 22 | +The process has 4 phases: |
| 23 | + |
| 24 | +* Obtain additional parameters |
| 25 | +* Clear previous test artifacts |
| 26 | +* Prepare the current branch for an auto-upgrade test |
| 27 | +* Prepare a new branch with a fake release candidate |
| 28 | + |
| 29 | +# Phase 1: Obtain additional parameters |
| 30 | + |
| 31 | +We need to obtain additional parameters that will be used throughout the process. |
| 32 | + |
| 33 | +Follow these steps: |
| 34 | +- Read the current release info from the release cycle info file. |
| 35 | +- Create a `RELEASE_CYCLE` parameter by adding 10 to the current `release-cycle` value. |
| 36 | +- Create a `RELEASE_CYCLE_COUNTER` parameter by setting it to the value 1. |
| 37 | +- Create a `BRANCH_NAME` parameter with the value `rc-<release-year>.<release-month>.<release-cycle> + |
| 38 | + 10`. So you will be adding 10 to the current `release-cycle` value and should end up with |
| 39 | + something like, e.g., `rc-2026.2.12`. |
| 40 | +- Create a `TAG_NAME` parameter by taking the value of `BRANCH_NAME` and appending `.1`. So you |
| 41 | + should end up with something like, e.g., `rc-2026.2.12.1`. |
| 42 | +- Create an `ANTNODE_VERSION_RC_VERSION` number by reading the current `antnode` version number from |
| 43 | + the `Cargo.toml` file and adding 10 to the `PATCH` component and appending an `-rc.1` suffix. So for |
| 44 | + example, if the current version number is `0.4.16`, the new RC version should be `0.4.26-rc.1`. |
| 45 | + |
| 46 | +Print the values you have obtained for these parameters and prompt me to verify them before |
| 47 | +proceeding to the next phase. |
| 48 | + |
| 49 | +# Phase 2: Clear previous test artifacts |
| 50 | + |
| 51 | +It could be possible there was a previous test run that has not been cleared up. We need to get rid |
| 52 | +of any artifacts from any previous test. |
| 53 | + |
| 54 | +Follow these steps: |
| 55 | +- If a `BRANCH_NAME` branch exists on the current repository, delete it. |
| 56 | +- If a `BRANCH_NAME` branch exists on the upstream repository, delete it. |
| 57 | +- If a `TAG_NAME` tag exists on the upstream repository, delete it. |
| 58 | +- Use the `remove-s3-ant-rc-binaries.sh` script by calling it with the value of the |
| 59 | + `ANTNODE_VERSION_RC_VERSION` parameter |
| 60 | + |
| 61 | +# Phase 3: Preparing the current branch |
| 62 | + |
| 63 | +For the test, the current branch needs a temporary commit to reduce the upgrade check time and some |
| 64 | +other details. |
| 65 | + |
| 66 | +Follow these steps: |
| 67 | + |
| 68 | +* Reduce the upgrade check time from 3 days to 30 minutes. |
| 69 | +* Reduce the randomness in the upgrade check time to +/- 2 minutes. |
| 70 | +* Change the `fetch_and_cache_release_info` function to replace the usage of |
| 71 | + `release_repo.get_latest_autonomi_release_info` to `release.get_autonomi_release_info`. This |
| 72 | + function takes a string, which is the value of `RELEASE_TAG` |
| 73 | +* We have code that downloads the new binary from an `autonomi.com` URL and uses an S3 URL as a |
| 74 | + fallback. Another temporary change is required here to just use the S3 URL directly, since the |
| 75 | + `autonomi.com` URL always points to the latest release, which is not what we want for the test. |
| 76 | +* Create a chore commit with these changes and indicate that it is temporary and will be removed. |
| 77 | + Let me review the commit before proceeding. |
| 78 | +* Push the change to the remote branch. Force pushing is fine if necessary. |
| 79 | + |
| 80 | +# Phase 4: Prepare fake release candidate branch |
| 81 | + |
| 82 | +Now we need to prepare a fake release candidate branch that is based on the current branch. |
| 83 | + |
| 84 | +Follow these steps: |
| 85 | +* Create a new branch from the current one called `BRANCH_NAME` |
| 86 | +* Run `cargo release version ANTNODE_VERSION_RC_VERSION --package ant-node --execute |
| 87 | + --no-confirm`. |
| 88 | +* Update the `release-cycle-info` and `ant-build-info/src/release_info.rs` files with the values of |
| 89 | + `RELEASE_CYCLE_COUNTER` and `RELEASE_CYCLE`. |
| 90 | +* Put these changes in a commit with the title `chore(release): release candidate |
| 91 | + <release_year>.<release_month>.RELEASE_CYCLE_COUNTER.RELEASE_CYCLE` and in the body, indicate that |
| 92 | + it's a fake release candidate. |
39 | 93 |
|
40 | 94 | Allow me to review the commit, and once I approve, push the branch to the `upstream` remote. |
0 commit comments