opensafely-core / .github

Other
0 stars 0 forks source link

Proposal ( / dream): how I'd like our versioning/publishing actions to behave #14

Open evansd opened 1 year ago

evansd commented 1 year ago

Below is a description of how I'd like our automatic versioning/publishing system to work. I've added it as an issue here for lack of a better place to record these thoughts. A couple of preliminary remarks:

I envision the workflow as consisting of three actions.

1. Check the PR is annotated correctly

To be run whenever a PR is created or its body (aka description) is edited.

The key points are:

2. Tag new versions

This could be run on every merge to main, as we currently do. Or for some projects (opensafely-cli perhaps?) we might want to make it a manually dispatched workflow so we can control when we cut a new release.

This would need to:

3. Ensure latest version is published

The key thing here (especially given the flakiness of Github's CI) is to make this an idempotent ratchet, rather than anything stateful. It's job is:

We'll obviously want to run this whenever we tag a new version. But there's no real harm in running it more often (e.g. every merge) as it's safe by design. It should also be manually dispatchable to allow us to retry following inevitable flakiness.

iaindillingham commented 1 year ago

I really like this proposal. A question: If we didn't tag a version on merge to main, then the version that could be computed from the trailers could differ from the tagged version, couldn't it? For example, consider the following sequence:

The version that could be computed from the trailers is v2.0.0. However, the tagged version is v0.0.1.

I think it's fine that the computed version could differ from the tagged version, because a user wouldn't be affected; they would be working with a published version (of a Python package, of a Docker image, etc.). However, I had to remind myself that this proposal decouples the nature of a PR from tagging a version.

evansd commented 1 year ago

Yes, that's right. You could think of the computed version (as you called it) as being "what the version would be if we decided to release this as yet unreleased code".