Skip to content

Commit 668d60c

Browse files
authored
Update docs (#634)
* Update notes on release workflow to better match current practice * Add note on turning the other services back on
1 parent 947c023 commit 668d60c

File tree

1 file changed

+43
-45
lines changed

1 file changed

+43
-45
lines changed

docs/developer/releases.md

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,54 @@ The project loosely uses [Semantic Versions](https://semver.org) where the patch
1111
developed. For now, we make sure all URLs are at least under a version suffix, which makes
1212
support in the future possible.
1313

14-
Breaking changes of a resource include deleting a field, changing the name of an existing field,
15-
or changing the datatype of a field. Adding new fields is not a breaking change.
14+
We do our best to version API changes such that users can opt out of breaking changes.
15+
We consider the following breaking changes:
1616

17-
On a breaking change for a resource (e.g. for Dataset), a new router with a new version should
18-
be created. The existing router should be deprecated, and rewritten so that it can handle the
19-
new metadata of the database. This deprecation of a router will be visible in the Swagger
20-
documentation. Calls to a deprecated router will still work, but a response header "Deprecated"
21-
will be added with the deprecation date. The deprecated router will then be deleted on the next
22-
release.
17+
- removing a field from the input
18+
- changing the name of a field
19+
- changing the datatype of a field
20+
- changing or removing the default of a field
2321

24-
On non-breaking changes of a resource, a new version is not needed for the corresponding router.
25-
26-
Example:
27-
- Start www.aiod.eu/api/datasets/v0
28-
- Release 1: www.aiod.eu/api/datasets/v0 (no breaking changes)
29-
- Release 2:
30-
- www.aiod.eu/api/datasets/v0 (deprecated)
31-
- www.aiod.eu/api/datasets/v1
32-
- Release 3: www.aiod.eu/api/datasets/v1
33-
34-
## Changelog
35-
36-
As changelog we use the Github tags. For each release, a release branch should be created with a
37-
bumped version in the pyproject.toml, and merged with the master. The tag should contain a
38-
message detailing all the breaking and non-breaking changes. This message should adhere to the
39-
guiding principles as described in https://keepachangelog.com/.
40-
41-
- Show all tags: https://github.com/aiondemand/AIOD-rest-api/tags
42-
- Show a specific tag: https://github.com/aiondemand/AIOD-rest-api/releases/tag/0.3.20220501
43-
44-
This information can also be extracted using the Github REST API.
22+
We generally try to avoid putting breaking changes into already released versions.
23+
There can be some exceptions based on the developers' judgement, but such a decision should not
24+
be made lightly and clearly communicated. Once the project matures more, one should avoid these
25+
changes altogether. Some changes may be backported in a compatible manner,
26+
for example instead of changing the name for a field, you could add a field with the new name without removing the old one.
27+
This gives people time to move from one name to the other ([example](https://github.com/aiondemand/AIOD-rest-api/pull/594)).
4528

29+
The entire API is versioned together. This is because of the interconnectedness of assets.
30+
If one versioned asset types independently, but we return e.g., `Person`s that are member of an `Organisation`
31+
as part of the organisations endpoint, we would need a way to specify versions for both `Organisation` and `Person`
32+
in the request. Because there are many high-level connections (e.g., `has_part` and `is_part_of`) we felt it is
33+
better to version the entire API. However, while we internally have *some* support for schema migrations (
34+
[example](https://github.com/aiondemand/AIOD-rest-api/blob/ff24e3c4278194b405bc49adc93991704e9c0e1d/src/database/model/project/project.py#L122)
35+
), there are still issues when they are retrieved through indirect means ([#633](https://github.com/aiondemand/AIOD-rest-api/issues/633)).
4636

4737
## Creating a release
4838
To create a new release:
4939

5040
1. Make sure all requested functionality is merged with the `develop` branch.
51-
2. Create a release branch from develop: `git checkout -b release/[VERSION]`. Example of version: `1.1.20231129`
52-
3. Update the version in `pyproject.toml` on the release branch.
53-
4. Test all (most of) the functionality. Checkout the project in a new directory and remove all
54-
your local images, and make sure it works out-of-the box.
55-
5. Go to https://github.com/aiondemand/AIOD-rest-api/releases and draft a new release from the
56-
release branch. Look at all closed PRs and create a changelog.
57-
6. Create a PR from release branch to develop. Make sure that when it is merged, the release branch is preserved.
58-
7. Deploy on the server(s):
59-
- Check which services currently work (before the update). It's a sanity check for if a service _doesn't_ work later.
60-
- Bring the services down.
61-
- Update the code on the server by checking out the release.
62-
- If the release contains new configuration options or configuration defaults, make sure that the override files are updated as needed.
63-
- Start the services without connectors.
64-
- Make sure the latest database migrations are applied: see ["Schema Migrations"](schema/migration.md#update-the-database)
65-
- Restart the services with connectors.
66-
9. Notify everyone (e.g., in the API channel in Slack).
41+
2. Make sure the version in `pyproject.toml` is updated in the `develop` branch.
42+
3. Make a release on GitHub: https://github.com/aiondemand/AIOD-rest-api/releases
43+
4. Make sure the release notes follow a similar style, use the merged PRs since last release (use e.g. filter `merged:>=2025-08-2`).
44+
45+
Deploy the new release to the test server. If that works (preferably leave it up for a while), then deploy to production.
46+
Deploying an update:
47+
48+
1. Create an additional database backup: `./scripts/mysql_dump.sh`
49+
1. Check which services currently work (before the update). It's a sanity check for if a service _doesn't_ work later.
50+
1. See which files, if any, are changed locally: `git status`
51+
- Stash the changes, or keep track of them in some way. Try to make a note to update the software so that local changes are not necessary.
52+
1. Check out the release (e.g., `git fetch origin && git checkout v2.0.20250802`)
53+
- If absolutely necessary, reapply the changes. Again: make a note to avoid needing any local changes next time.
54+
1. If the release contains new configuration options or configuration defaults, make sure that the override files are updated as needed.
55+
1. Rebuild the images: `./scripts/build.sh`
56+
1. Build the alembic image separately (it's not included in the above script), see `docker build -f alembic/Dockerfile . -t aiod-migration` ([docs](schema/migration.md).
57+
1. Bring down the services: `./scripts/down.sh`
58+
1. Bring the database back up: `docker compose --env-file=.env --env-file=override.env up sqlserver -d`
59+
- Runs the [migrations](schema/migration.md), if any: `docker run -v $(pwd)/alembic:/alembic:ro -v $(pwd)/src:/app -it --network aiod-rest-api_default aiod-migration`
60+
- Start the remainder of the services: `./scripts/up.sh`
61+
- To make sure the latest taxonomy is also included:
62+
- Copy the `export/taxonomies.json` file from the `metadata-schema` repository and have it update on startup, or
63+
- run the taxonomy service independently (preferred, but currently broken?)
64+
- Notify everyone (e.g., in the API channel in Slack).

0 commit comments

Comments
 (0)