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

ENG-1235: Push release tags automatically on rasa-sdk #1139

Merged

Conversation

AsadHasan-Rasa
Copy link
Collaborator

@AsadHasan-Rasa AsadHasan-Rasa commented Aug 22, 2024

Proposed changes:
Introduce mechanism to automatically create and push tag for release, similar to how it is already done in rasa-private. Summary of changes:

  1. Updated scripts/release.py to create and push release tag, if invoked with --tag flag.
  2. Updated Makefile with new target make tag-release.
  3. Added GHA workflow tag-release, to do this in CI, when PR is merged to main or a release branch.

Status (please check what you already did):

  • made PR ready for code review
  • added some tests for the functionality
  • Manually tested this locally, as described below*
  • updated the documentation in the rasaHQ/rasa
  • updated the changelog (please check changelog for instructions)
  • Not required I think as this is internal-only change, and not user facing?
  • reformat files using ruff (please check Readme for instructions)

*Ran make release and make tag-release locally, to see that a tag is created and pushed (Note: Tagging function checks that the branch is main or a final release branch (complying to regex pattern ^\d+\.\d+\.x$ for e.g. 1.2.x), so locally disabled this check so that I can test on a dev-test release branch):

(rasa-sdk-py3.10) asadhasan@ENG-UK-0011 ~/r/rasa-sdk (ENG-1235-push-release-tags-automatically-on-rasa-sdk) [1]> make release && make tag-release
poetry run python scripts/release.py
The release script will increase the version number, create a changelog and create a release branch. Let's go!
? What is the version number you want to release ('major', 'minor', 'micro', 'alpha', 'rc' or valid version number e.g. '3.10.1' or '3.10.1a1')? 3.10.0dev5
? Is the next version '3.10.0.dev5' correct (current version is '3.10.0.dev4')? Yes
Loading template...
Finding news fragments...
Rendering news fragments...
Writing to newsfile...
Staging newsfile...
No news fragments to remove. Skipping!
Done!
Switched to a new branch 'prepare-release-3.10.0.dev5'
[prepare-release-3.10.0.dev5 bda721c] prepared release of version 3.10.0.dev5
 6 files changed, 33 insertions(+), 7 deletions(-)
 delete mode 100644 changelog/1122.improvement.md
 delete mode 100644 changelog/1128.misc.md
 delete mode 100644 changelog/1135.misc.md
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 14 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 813 bytes | 813.00 KiB/s, done.
Total 7 (delta 6), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (6/6), completed with 6 local objects.
remote: 
remote: Create a pull request for 'prepare-release-3.10.0.dev5' on GitHub by visiting:
remote:      https://github.com/RasaHQ/rasa-sdk/pull/new/prepare-release-3.10.0.dev5
remote: 
remote: GitHub found 11 vulnerabilities on RasaHQ/rasa-sdk's default branch (1 high, 9 moderate, 1 low). To find out more, visit:
remote:      https://github.com/RasaHQ/rasa-sdk/security/dependabot
remote: 
To https://github.com/RasaHQ/rasa-sdk.git
 * [new branch]      HEAD -> prepare-release-3.10.0.dev5

 All done - changes for version 3.10.0.dev5 are ready! 

Please open a PR on GitHub: https://github.com/RasaHQ/rasa-sdk/compare/ENG-1235-push-release-tags-automatically-on-rasa-sdk...prepare-release-3.10.0.dev5?expand=1
poetry run python scripts/release.py --tag

    The release tag script will tag the current commit with the current version.

    This should be done on the applicable *.x branch after running
    `make release` and merging the prepared release branch.
        
Applying tag '3.10.0.dev5' to commit.
Pushing tag '3.10.0.dev5' to origin.
Enumerating objects: 2, done.
Counting objects: 100% (2/2), done.
Delta compression using up to 14 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 304 bytes | 304.00 KiB/s, done.
Total 2 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/RasaHQ/rasa-sdk.git
 * [new tag]         3.10.0.dev5 -> 3.10.0.dev5
 * [new tag]         3.10.0.dev2 -> 3.10.0.dev2

 All done - tag for version 3.10.0.dev5 was added and pushed to the remote 

@CLAassistant
Copy link

CLAassistant commented Aug 22, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@sanchariGr sanchariGr left a comment

Choose a reason for hiding this comment

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

Great job 🎉
Left two small comments and would be great if we could also test this before merge.
edit : I see you have tested this locally 🥇

- name: Checkout git repository 🕝
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
token: ${{ secrets.RELEASE_TAGGER_PAT }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this PAT token doesnot exist for the repo. @rasa-aadlv can you help with this please?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

RELEASE_TAGGER_PAT now added to this repo's secrets (thanks @rasa-aadlv !)
image


print_done_message(branch, base, version)
if not version.pre:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not related to your changes but just noticed this was missing. Can you also add and not version.dev here please? We shouldnt generate changelog for dev releases either.

@sanchariGr sanchariGr requested a review from rasa-aadlv August 22, 2024 16:00
@AsadHasan-Rasa AsadHasan-Rasa changed the title [WIP | DRAFT] ENG-1235: Push release tags automatically on rasa-sdk ENG-1235: Push release tags automatically on rasa-sdk Aug 22, 2024
@AsadHasan-Rasa AsadHasan-Rasa marked this pull request as ready for review August 22, 2024 16:19
@AsadHasan-Rasa AsadHasan-Rasa requested a review from a team as a code owner August 22, 2024 16:19
@AsadHasan-Rasa AsadHasan-Rasa requested review from a team, Northwind01, djcowley and OgnjenFrancuski and removed request for a team, Northwind01 and djcowley August 22, 2024 16:57
@AsadHasan-Rasa AsadHasan-Rasa merged commit 1db19bc into main Aug 27, 2024
17 checks passed
@AsadHasan-Rasa AsadHasan-Rasa deleted the ENG-1235-push-release-tags-automatically-on-rasa-sdk branch August 27, 2024 09:53
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.

3 participants