MatrixAI / Polykey

Polykey Core Library
https://polykey.com
GNU General Public License v3.0
31 stars 4 forks source link

CI/CD Commit/Tag Flow Consolidation #659

Open amydevs opened 10 months ago

amydevs commented 10 months ago

Specification

A race condition was discovered where the CI/CD pipeline triggered by a Tag may merge bad changes to master.

The CI/CD must be changed so that:

This will now mean that, any Tags that's history diverge from staging/master, will no longer be merged into master. This makes sense, as tags can be created from any history, even one that doesn't align with any branches on the repository.

This means that master will only ever be merged from staging, after staging is confirmed to have been successfully tested.

The flow to release should be the following:

  1. Commit to staging
  2. Run npm config set git-tag-version=false to disable tags from being created from npm version
  3. Run npm version ... to create a version commit
  4. git push
  5. CI/CD runs tests on staging.
  6. CI/CD merges staging to master
  7. Create a Tag from master
  8. CI/CD publishes GitHub release from Tag

Untitled-2023-10-23-0424 excalidraw(8)

Untitled-2023-10-23-0424 excalidraw(9)

Additional context

Tasks

  1. Change .gitlab-ci.yml on Polykey to reflect changes
  2. Change .gitlab-ci.yml on Polykey-CLI to reflect changes
CMCDragonkai commented 9 months ago

This https://github.com/MatrixAI/Polykey-CLI/issues/40#issuecomment-1907579883 might be relevant here too.

CMCDragonkai commented 2 months ago

@brynblack

CMCDragonkai commented 2 months ago

With the completion of https://github.com/MatrixAI/Orchestrator/issues/10 is this still a problem @brynblack?

brynblack commented 2 months ago

I'm not 100% certain, but generally this is fixed as it is a requirement for a tagged release to pass all checks to get merged into master. So there shouldn't be any cases of bad tagged releases into production.

CMCDragonkai commented 2 months ago

Check with @amydevs to see if this is still a problem...