Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Release scripts #2174

Merged
merged 2 commits into from
Feb 14, 2025
Merged

Conversation

ognyanstoimenov
Copy link
Collaborator

@ognyanstoimenov ognyanstoimenov commented Feb 11, 2025

Reference Issues/PRs

What does this implement or fix?

Currently versions are released by manually running the tag.yml workflow, which releases selected branch with a specified version.
This extends that with scripts that call the tag.yml with version to release and branch to release it from.

Flow:

  • Main entry point - automated_release.full_version_cron - on a schedule (or manual trigger) releases the latest release branch. Release branches follow the naming convention X.Y.Z so the release produced will be vX.Y.Z
  • When a release is created - automated_release.create_release_branch is triggered which calculates what the next release version should be based on commits in master and create that release branch from which would be the base of the next release. Immediately releases it as rc0 (calls tag.yml to release <new_branch_name>rc0)
  • On every commit in release branch - automated_release.rc_version releases next rc version of that branch (calls tag.yml to release <release_branch_name>rc1 or rc2, etc)

Marking PR's as patch, minor, major

  • New PR template:
## Change Type (Required)
- [ ] **Patch** (Bug fix or non-breaking improvement)
- [ ] **Minor** (New feature, but backward compatible)
- [ ] **Major** (Breaking changes)
- [ ] **Cherry pick**
  • On every PR opened/edited to master automated_release.parse_pr_template - parses new template and adds apropriate label which in future gets parsed by automated_release.create_release_branch specified above

Proof of working/demo (~7min, watch in 1.5x speed)

1080.Screen.Recording.2025-02-13.155706.mp4

Any other comments?

Checklist

Checklist for code changes...
  • Have you updated the relevant docstrings, documentation and copyright notice?
  • Is this contribution tested against all ArcticDB's features?
  • Do all exceptions introduced raise appropriate error messages?
  • Are API changes highlighted in the PR description?
  • Is the PR labelled as enhancement or bug so it appears in autogenerated release notes?

@ognyanstoimenov ognyanstoimenov force-pushed the ostoimenov/automated_release branch from 4df65ee to 1e842af Compare February 12, 2025 23:31
@ognyanstoimenov ognyanstoimenov changed the title Release scripts Automated Release scripts Feb 12, 2025
@ognyanstoimenov ognyanstoimenov force-pushed the ostoimenov/automated_release branch from 1e842af to 14f9ce4 Compare February 13, 2025 14:00
@ognyanstoimenov ognyanstoimenov marked this pull request as ready for review February 13, 2025 14:45
Copy link
Collaborator

@G-D-Petrov G-D-Petrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, I just have a couple of questions

permissions:
contents: write
pull-requests: write
repository-projects: write
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need all of these permissions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought they are needed for the downstream jobs, but just tested and seems like they are not necessary, will remove

uses: oprypin/find-latest-tag@v1
with:
repository: ${{ github.repository }}
regex: ^v\d+\.\d+\.\d+rc\d+$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is called with different params than the ones in create-next-release-branch.
Maybe equalize them

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are slightly different in meaning. This one searches for the latest rc tag, and later strips 'rc'. while the other one searches for the latest full release and later increments the version

echo Labels: $labels
increment_type="patch"
case "$labels" in
*"${{ env.MAJOR_LABEL }}"*) increment_type="major"; echo "Major changes found! Should increase major version." ;;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this would work when we have mix of major, minor and patch between releases? Say something like when we cut the release candidate branch, master had only minor changes. But then during the week, master had major version changes. I wonder if we need to think about it?

name: "Automated Release: Release next full version from release branch"

on:
# schedule:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we enable this? Or you want to test it manually first?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's test manually first and if all is ok, I will enable it

@ognyanstoimenov ognyanstoimenov merged commit 12b9acd into master Feb 14, 2025
152 checks passed
@ognyanstoimenov ognyanstoimenov deleted the ostoimenov/automated_release branch February 14, 2025 17:05
@@ -3,6 +3,12 @@

#### What does this implement or fix?

## Change Type (Required)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just enforce these with labels on the PR rather than these checkboxes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible yes, maybe even clearer. I will enforce it so we can't merge without the labels. Also I think we can use the same set of labels for releases and release notes, so that we don't have e.g. both minor and feature but just the one that would be used for both release versions and release notes

on:
push:
branches:
- '[0-9]+.[0-9]+.[0-9]+'
Copy link
Collaborator

@poodlewars poodlewars Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a stricter naming convention for these branches - otherwise someone will create a branch 65.11.22 and it will get released. It might be possible to configure the repo to block creation of these branches other than by these workflows

Copy link
Collaborator Author

@ognyanstoimenov ognyanstoimenov Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. I thought we could use x.y.z-<branch cut sha> as naming convention but it looked ugly. So blocking such creations should be fine. I will try to configure that as well as some merging restrictions in release branches

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will we patch older versions with this? Say we have,

v5.5.5rc3 -> we want to release this to 5.5.3
v4.4.2rc1 -> we want to release this to 4.4.2

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what you mean. Why would we patch an older version? If we have v5.5.5rc3 or rc4 etc, when it is time we release v5.5.5 and that's it for that version. If we find something is wrong after the full release and we want to patch it would be in the next patch version 5.5.6

ognyanstoimenov added a commit that referenced this pull request Feb 20, 2025
#### Reference Issues/PRs
<!--Example: Fixes #1234. See also #3456.-->
* New workflow that on trigger creates a dev release from current master
* Calculates what next version would be and names the release
`x.y.z.dev0+<master_sha>`
* Release scripts introduced in #2174 had some permissions/token issues.
This fixes them.

  * Not working (5.2.4 branch, check annotations);
  https://github.com/man-group/ArcticDB/actions/runs/13397301934
  https://github.com/man-group/ArcticDB/actions/runs/13409868194

  * Working (5.2.4 after applying this):
  * https://github.com/man-group/ArcticDB/actions/runs/13410089783

#### What does this implement or fix?

## Change Type (Required)
- [x] **Patch** (Bug fix or non-breaking improvement)
- [ ] **Minor** (New feature, but backward compatible)
- [ ] **Major** (Breaking changes)
- [ ] **Cherry pick**

#### Any other comments?

#### Checklist

<details>
  <summary>
   Checklist for code changes...
  </summary>
 
- [ ] Have you updated the relevant docstrings, documentation and
copyright notice?
- [ ] Is this contribution tested against [all ArcticDB's
features](../docs/mkdocs/docs/technical/contributing.md)?
- [ ] Do all exceptions introduced raise appropriate [error
messages](https://docs.arcticdb.io/error_messages/)?
 - [ ] Are API changes highlighted in the PR description?
- [ ] Is the PR labelled as enhancement or bug so it appears in
autogenerated release notes?
</details>

<!--
Thanks for contributing a Pull Request to ArcticDB! Please ensure you
have taken a look at:
- ArcticDB's Code of Conduct:
https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md
- ArcticDB's Contribution Licensing:
https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing
-->
jamesmunro pushed a commit that referenced this pull request Feb 25, 2025
#### Reference Issues/PRs
<!--Example: Fixes #1234. See also #3456.-->

#### What does this implement or fix?
Currently versions are released by manually running the tag.yml
workflow, which releases selected branch with a specified version.
This extends that with scripts that call the tag.yml with version to
release and branch to release it from.
### Flow: 
* **Main entry point** - `automated_release.full_version_cron` - on a
schedule (or manual trigger) releases the latest release branch. Release
branches follow the naming convention `X.Y.Z` so the release produced
will be `vX.Y.Z`
* **When a release is created** -
`automated_release.create_release_branch` is triggered which calculates
what the next release version should be based on commits in `master` and
create that release branch from which would be the base of the next
release. Immediately releases it as `rc0` (calls `tag.yml` to release
`<new_branch_name>rc0`)
* **On every commit in release branch** - `automated_release.rc_version`
releases next rc version of that branch (calls `tag.yml` to release
`<release_branch_name>rc1` or rc2, etc)
 
### Marking PR's as `patch`, `minor`, `major`
* **New PR template**:
```
## Change Type (Required)
- [ ] **Patch** (Bug fix or non-breaking improvement)
- [ ] **Minor** (New feature, but backward compatible)
- [ ] **Major** (Breaking changes)
- [ ] **Cherry pick**
```
* **On every PR opened/edited to master**
`automated_release.parse_pr_template` - parses new template and adds
apropriate label which in future gets parsed by
`automated_release.create_release_branch` specified above



## Proof of working/demo (~7min, watch in 1.5x speed)

https://github.com/user-attachments/assets/94705eb1-dd76-4397-8e2e-44828fc01ceb

#### Any other comments?

#### Checklist

<details>
  <summary>
   Checklist for code changes...
  </summary>
 
- [ ] Have you updated the relevant docstrings, documentation and
copyright notice?
- [ ] Is this contribution tested against [all ArcticDB's
features](../docs/mkdocs/docs/technical/contributing.md)?
- [ ] Do all exceptions introduced raise appropriate [error
messages](https://docs.arcticdb.io/error_messages/)?
 - [ ] Are API changes highlighted in the PR description?
- [ ] Is the PR labelled as enhancement or bug so it appears in
autogenerated release notes?
</details>

<!--
Thanks for contributing a Pull Request to ArcticDB! Please ensure you
have taken a look at:
- ArcticDB's Code of Conduct:
https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md
- ArcticDB's Contribution Licensing:
https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing
-->
jamesmunro pushed a commit that referenced this pull request Feb 25, 2025
#### Reference Issues/PRs
<!--Example: Fixes #1234. See also #3456.-->
* New workflow that on trigger creates a dev release from current master
* Calculates what next version would be and names the release
`x.y.z.dev0+<master_sha>`
* Release scripts introduced in #2174 had some permissions/token issues.
This fixes them.

  * Not working (5.2.4 branch, check annotations);
  https://github.com/man-group/ArcticDB/actions/runs/13397301934
  https://github.com/man-group/ArcticDB/actions/runs/13409868194

  * Working (5.2.4 after applying this):
  * https://github.com/man-group/ArcticDB/actions/runs/13410089783

#### What does this implement or fix?

## Change Type (Required)
- [x] **Patch** (Bug fix or non-breaking improvement)
- [ ] **Minor** (New feature, but backward compatible)
- [ ] **Major** (Breaking changes)
- [ ] **Cherry pick**

#### Any other comments?

#### Checklist

<details>
  <summary>
   Checklist for code changes...
  </summary>
 
- [ ] Have you updated the relevant docstrings, documentation and
copyright notice?
- [ ] Is this contribution tested against [all ArcticDB's
features](../docs/mkdocs/docs/technical/contributing.md)?
- [ ] Do all exceptions introduced raise appropriate [error
messages](https://docs.arcticdb.io/error_messages/)?
 - [ ] Are API changes highlighted in the PR description?
- [ ] Is the PR labelled as enhancement or bug so it appears in
autogenerated release notes?
</details>

<!--
Thanks for contributing a Pull Request to ArcticDB! Please ensure you
have taken a look at:
- ArcticDB's Code of Conduct:
https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md
- ArcticDB's Contribution Licensing:
https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants