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

Release script for downstream OTP forks #6345

Open
wants to merge 2 commits into
base: dev-2.x
Choose a base branch
from

Conversation

t2gran
Copy link
Member

@t2gran t2gran commented Dec 18, 2024

Summary

This PR contain two scripts custom-release.py and changelog-diff.py to make a release in a DOWNSTREAM fork of OTP. These scripts are not intended for releasing the main OTP repository.

See the (CUSTOM_RELEASE_README)[script/CUSTOM_RELEASE_README.md] for documentation of custom-release.py.

The changelog-diff.py can be used to diff the changelog.md file for any two versions of OTP.

Issue

🟥 There is not issue for this. But, these scripts is requested from time to time. This PR provides a common place to maintain them. At Entur we now run the custom-release.py as the first step in our OTP CI/CD Pipeline.

Unit tests

🟥 No tests provided.

Documentation

✅ The scripts are documented in the readme, se above.

Changelog

✅ This is relevant for advanced deplyments.

Bumping the serialization version id

🟥 Not relevant.

@t2gran t2gran added the Improvement A functional improvement label Dec 18, 2024
@t2gran t2gran added this to the 2.7 (next release) milestone Dec 18, 2024
@t2gran t2gran requested a review from a team as a code owner December 18, 2024 19:58
@t2gran
Copy link
Member Author

t2gran commented Dec 19, 2024

I will add a check on the environment to the prepare_release - that the git repo is named correct. Other than that this is ready for review. The bash script is replaced with a pyton script with much better error handling.

@vpaturet vpaturet self-requested a review December 19, 2024 14:49
@optionsome optionsome self-requested a review December 19, 2024 14:57
@optionsome
Copy link
Member

There are formatting issues.

@leonardehrenfried leonardehrenfried changed the title Release script for downstream OTP forks. Release script for downstream OTP forks Dec 31, 2024
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.35%. Comparing base (e26cbb5) to head (2b03d81).
Report is 29 commits behind head on dev-2.x.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6345      +/-   ##
=============================================
+ Coverage      70.31%   70.35%   +0.03%     
- Complexity     18158    18170      +12     
=============================================
  Files           2058     2062       +4     
  Lines          76942    76931      -11     
  Branches        7773     7763      -10     
=============================================
+ Hits           54101    54123      +22     
+ Misses         20086    20051      -35     
- Partials        2755     2757       +2     

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

@t2gran
Copy link
Member Author

t2gran commented Jan 2, 2025

I have improved the error handling in the scripts and simplified a bit. Ready for review.

Copy link
Member

@optionsome optionsome left a comment

Choose a reason for hiding this comment

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

I would prefer if there was a directory under the script directory for these files so you can have just a regular README for it.

script/RELEASE_README.md Outdated Show resolved Hide resolved
script/RELEASE_README.md Outdated Show resolved Hide resolved
script/RELEASE_README.md Outdated Show resolved Hide resolved
script/prepare_release Outdated Show resolved Hide resolved
script/release Outdated Show resolved Hide resolved
@t2gran t2gran marked this pull request as draft January 7, 2025 09:04
@t2gran t2gran added Entur Test This is currently being tested at Entur and removed Entur Test This is currently being tested at Entur labels Jan 7, 2025
@t2gran t2gran force-pushed the release_scripts branch 2 times, most recently from e65c45e to 010f2ce Compare February 12, 2025 13:38
@t2gran t2gran marked this pull request as ready for review February 12, 2025 13:38
@t2gran t2gran requested a review from optionsome February 12, 2025 13:46
@t2gran t2gran force-pushed the release_scripts branch 3 times, most recently from e6b6b10 to 5dcecf9 Compare February 12, 2025 14:19
@habrahamsson-skanetrafiken habrahamsson-skanetrafiken requested review from tkalvas and removed request for optionsome February 13, 2025 14:04
@t2gran
Copy link
Member Author

t2gran commented Feb 13, 2025

At Entur we use this this in the GitHub workflow. You may copy the workflow scripts if you want. Here is how we want to set up our pipeline - we have a data pipeline as well, but that is not shown.

OTP GitHub Release Pipline

script/custom-release.py Outdated Show resolved Hide resolved
script/custom-release.py Outdated Show resolved Hide resolved
script/CUSTOM_RELEASE_README.md Outdated Show resolved Hide resolved
script/CUSTOM_RELEASE_README.md Outdated Show resolved Hide resolved
script/CUSTOM_RELEASE_README.md Outdated Show resolved Hide resolved
script/custom-release.py Outdated Show resolved Hide resolved
script/custom-release.py Outdated Show resolved Hide resolved
script/CUSTOM_RELEASE_README.md Show resolved Hide resolved
script/custom-release.py Outdated Show resolved Hide resolved
print(f'DEBUG {msg}', flush=True)


def crop(text):
Copy link
Contributor

Choose a reason for hiding this comment

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

Someone will come up with an error situation where they want the entire output.

Copy link
Member Author

Choose a reason for hiding this comment

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

Improvements are always welcome. For example dumping everything to a custom-release.log file and crop terminal output is fine with me. The script potentially print the 20 versions of the root pom.xml in addition to running Maven, so the log can be long - I prefer cropping some of it, so it is easier to find the important stuff. I have also modified the script to print everything a couple of times to debug.

@t2gran
Copy link
Member Author

t2gran commented Feb 14, 2025

Thank you for a good review @tkalvas, I renamed and rewrote a lot to make it generic (not Entur specific) - sorry for all the misstakes.

I have tested the script after my changes - it still works.

@t2gran t2gran requested a review from tkalvas February 14, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement A functional improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants