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

Add bumpver pre-commit #688

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Conversation

danielhollas
Copy link
Contributor

@danielhollas danielhollas commented Apr 25, 2024

This is the last piece in the release workflow.

The newly added bumpver_pre_commit.sh script is configured to run automatically by bumpver
before it creates the release commit.
We check for common mistakes, such as making a release commit
in a wrong branch, or trying to push to a wrong remote.

For now, only two checks are implemented:

  1. Check that the current branch name matches either release/* or support/*

  2. Check that the remote origin is pointing to the origin repository,
    and not a fork. Note however that this assumes that origin is the default remote
    where new branches are pushed. If the user configured a different default remote,
    this check will not save them in the current implementation.

Future work:

  • make sure the main branch is up-to-date with origin/main
  • make sure the HEAD commit was branched off of main branch,
    although this rule should only apply to release/* branches, not support/* branches
  • check what is the default push branch

It would be great if at least some of these checks were handled by bumpver itself:

Restricting releases from branch: mbarkhau/bumpver#198
Restricting releases to specified remote: mbarkhau/bumpver#234

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.79%. Comparing base (f63da7d) to head (8022f49).
Report is 73 commits behind head on main.

❗ Current head 8022f49 differs from pull request most recent head 00873c0. Consider uploading reports for the commit 00873c0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #688      +/-   ##
==========================================
- Coverage   80.73%   75.79%   -4.95%     
==========================================
  Files          49       59      +10     
  Lines        3415     4767    +1352     
==========================================
+ Hits         2757     3613     +856     
- Misses        658     1154     +496     
Flag Coverage Δ
python-3.10 75.79% <ø> (-4.95%) ⬇️
python-3.8 ?
python-3.9 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@danielhollas danielhollas force-pushed the bumpver-pre-commit branch 2 times, most recently from 5be8367 to 1000569 Compare April 25, 2024 15:29
@danielhollas danielhollas marked this pull request as ready for review April 25, 2024 15:32
@danielhollas danielhollas changed the title WIP: Add bumpver pre-commit Add bumpver pre-commit Apr 25, 2024
@danielhollas
Copy link
Contributor Author

@unkcpz @superstar54 friendly ping (I know you're busy) to review this so that we can start testing this for the releases. Thanks!

Copy link
Member

@superstar54 superstar54 left a comment

Choose a reason for hiding this comment

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

Hi @danielhollas I looked it this morning. I am not very familiar with this. But LGTM!

@danielhollas
Copy link
Contributor Author

@superstar54 thanks for taking a look. Feel free to merge so you can test it while doing releases.
I think you will want to recreate the rc2 release PR #701 anyway to pick up the most recent commits on main, so this might be a good opportunity for a test.

This bumpver is configured to automatically run
bumpver_pre_commit.sh script before it makes the release commit.
The script checks for common mistakes, such as making a release commit
in a wrong branch, or trying to push to a wrong remote.

This is an initial implementation that should be
made more robust in the future.
@superstar54 superstar54 merged commit 61d000b into aiidalab:main Apr 30, 2024
14 checks passed
@danielhollas danielhollas deleted the bumpver-pre-commit branch April 30, 2024 05:02
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.

2 participants