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

211 SIM-OPS-Generate PR from staging to main with changelog #335

Conversation

AgustinRamiroDiaz
Copy link
Contributor

@AgustinRamiroDiaz AgustinRamiroDiaz commented Jul 25, 2024

Fixes #211

What

  • Creates a PR from branches of the form release-<semver>, like for example release-v1.2.3

Why

  • to automate releases

Testing done

I've created the branch release-test from this branch and

Decisions made

I decided to go with branch push as trigger instead of workflow_dispatch because I feel it's more comfortable, but I can change that if you think it's more comfortable to do it in the UI

Checks

  • I have tested this code
  • I have reviewed my own PR
  • I have created an issue for this PR
  • I have set the PR name to the issue name

Reviewing tips

GitHub API and CLI docs are very useful

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (staging@847e26b). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             staging    #335   +/-   ##
=========================================
  Coverage           ?   2.28%           
=========================================
  Files              ?      73           
  Lines              ?    6613           
  Branches           ?      75           
=========================================
  Hits               ?     151           
  Misses             ?    6390           
  Partials           ?      72           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
@AgustinRamiroDiaz AgustinRamiroDiaz force-pushed the 211-sim-ops-generate-pr-from-staging-to-main-with-changelog branch from 14e8088 to e483c63 Compare July 26, 2024 14:55
@AgustinRamiroDiaz AgustinRamiroDiaz marked this pull request as ready for review July 26, 2024 14:57
@AgustinRamiroDiaz AgustinRamiroDiaz linked an issue Jul 26, 2024 that may be closed by this pull request
id: generate_release_notes
# https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#generate-release-notes-content-for-a-release
run: |
response=$(curl -L \
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if this curl command will fail from some rate-limiting rule? How to handle such errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This hasn't failed for me in my tests. I think for now we can go forward by just retrying the action manually if it fails and addressing it in a fix PR. I don't think we should complicate it now :)

https://api.github.com/repos/yeagerai/genlayer-simulator/releases/generate-notes \
-d '{"tag_name":"${{ steps.extract_tag.outputs.tag }}","target_commitish":"${{ steps.extract_branch.outputs.branch }}","previous_tag_name":"${{ steps.get_latest_release.outputs.tag}}"}' )
echo $response

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

First time I see that one, but I've researched a lot about tools to automate this and I didn't find anyone that would satisfy our needs. All of them had little to no flexibility to customize them.

For example, the one you are sharing here only works with "milestones"

Do you know how to use it for this use case?
We need to create release notes when there's a release branch created, and add those notes to a PR body

@AgustinRamiroDiaz AgustinRamiroDiaz merged commit c05b92e into staging Aug 12, 2024
34 of 43 checks passed
@cristiam86 cristiam86 deleted the 211-sim-ops-generate-pr-from-staging-to-main-with-changelog branch August 16, 2024 06:35
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.

SIM-OPS-Generate PR from staging to main with changelog
3 participants