Skip to content

Commit

Permalink
PR recommendations
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Schlarb <[email protected]>
  • Loading branch information
pSchlarb committed May 17, 2022
1 parent 723ad43 commit a316af1
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 18 deletions.
24 changes: 6 additions & 18 deletions docs/source/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

#### Branches

At the moment work is being done so that `ubuntu20.04-upgrade` becomes the new master/main branch.
At the moment work is being done so that `ubuntu-20.04-upgrade` becomes the new master/main branch.
The old `master` will be moved to `ubuntu16` branch.
The documentation for the old "legacy" process will reside in that branch.

- `master` branches contains the latest changes. All PRs usually need to be sent to master.
- `master` | `ubuntu-20.04` branches contains the latest changes. All PRs usually need to be sent to `master` | `ubuntu-20.04-upgrade`.



Expand Down Expand Up @@ -36,7 +37,7 @@ The old `master` will be moved to `ubuntu16` branch.

## Continuous Delivery

- CD part of the pipeline is defined in `.github/workflows/publishRelease.yaml` & `.github/workflows/PR.yaml` file.
- CD part of the pipeline is defined in `.github/workflows/tag.yaml`, `.github/workflows/releasepr.yaml`, and `.github/workflows/publishRelease.yaml` file.
- CD part is run via GitHubActions issuing and uploading new builds.

#### Builds
Expand Down Expand Up @@ -104,22 +105,9 @@ Each `build-scripts` folder includes `Readme.md`. Please check them for more det
- different versions in migrations scripts


##### For releases `< 1.7.0` (deprecated)
- Please note, that we are using semver-like approach for versioning (major, minor, build) for each of the components.
- Major and minor parts are set in the code (see [\_\_metadata\_\_.py](https://github.com/hyperledger/indy-node/blob/master/indy_node/__metadata__.py)). They must be incremented for new releases manually from code if needed.
- Build part is incremented with each build on Jenkins (so it always increases, but may be not sequentially)
- Each dependency (including indy-plenum) has a strict version (see [setup.py](https://github.com/hyperledger/indy-node/blob/master/setup.py))
- If you install indy-node (either from pypi, or from deb package), the specified in setup.py version of indy-plenum is installed.
- Master and Stable builds usually have different versions.
- Differences in master and stable code:
- `setup.py`:
- dev suffix in project names and indy-plenum dependency in master; no suffixes in stable
- different versions of indy-plenum dependency
- different versions in migrations scripts

## Release workflow
The diagram for the Release Workflow can be found [here](release-workflow.png).
It starts with setting a tag in the form of `setRelease-v<Major>.<Minor>.<Patch>[-rc<Num>]`.
![release-workflow](./release-workflow.png)

### Feature Release

Expand All @@ -142,7 +130,7 @@ It starts with setting a tag in the form of `setRelease-v<Major>.<Minor>.<Patch>
1. [**Maintainer**]
- Wait till the PR with the updated Version number from the RC preperation step is created and the Pipeline has run its tests (`releasepr.yaml` run successfully).
2. [**Maintainer**]
- If all checks passed and RC is approved merge the update version PR. It will kick of the `Releasepr.yaml`Pipeline, which creates a Github Release and publishes the packages.
- If all checks passed and RC is approved merge the update version PR. It will kick of the `publishRelease.yaml` Pipeline, which creates a Github Release and publishes the packages.
- Otherwise: just close the update version PR **without** merging.
3. [**GHA (`publishRelease.yaml`)**]
- Gets the artifacts from the last successfull `releasepr.yaml` run.
Expand Down
Binary file added docs/source/release-workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions docs/source/release-workflow.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@startuml

:**Tag Triggered - Release Workflow**;
start

:Create a tag on the branch and commit on which the release
is to be based.

The tag must be in the following format:
- ""setRelease-v<Major>.<Minor>.<Patch>[-rc<Num>]""

Examples:
- To generate an RC Release (marked as a pre-release)
- ""setRelease-v1.12.6-rc0""
- To generate an official Release
- ""setRelease-v1.12.6"";

partition "**Workflow**: tag.yaml" {
floating note left
Workflow triggered
by the ""setRelease""
tag being pushed.
end note

:Extract information;
note left:Extract version number from tag
:Bump version number;
:Create Pull Request to the branch, where the tag was set on;
}

partition "**Workflow**: releasepr.yaml" {
floating note left
Workflow triggered
by Pull Request affecting
**ONLY** ""indy_node/_version_.json"".
end note

:Extract information;
if (isVersionBump) then (yes)
:Lint using ""indy-shared-gha"";
:build Docker-images using ""indy-shared-gha"";
:Execute tests (""reuseable_tests.yaml"");
:Esecute ""indy-test-automation"";
note left: WIP
:build packages using ""indy-shared-gha"";
note left: packages published to workflow
else (no)
endif
}

if (**Review PR** - All tests passed?) then (Merge PR)
partition "**Workflow**: publishRelease.yaml" {
floating note right
Workflow triggered by
pushes affecting
**ONLY**
""indy_node/_version_.json"".
end note

:Extract version number from the commit message;
if (isVersionBump) then (yes)
:Download artifacts from last successfull ""releasepr"" run;
:Create a GitHub Release;
:Set tag and title to match release version;

if (is RC Release) then (yes)
:Set pre-release checkbox;
else (no)
endif
:Publish GitHub Release
- Containing the artifacts;
:Publish Packages using ""indy-shared-gha"";
else (no)
endif
}
else (Close PR without Merging)
:Release process aborted;
endif

stop
@enduml

0 comments on commit a316af1

Please sign in to comment.