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

New release system #3249

Merged
merged 25 commits into from
Sep 19, 2023
Merged

New release system #3249

merged 25 commits into from
Sep 19, 2023

Conversation

Saransh-cpp
Copy link
Member

@Saransh-cpp Saransh-cpp commented Aug 8, 2023

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #2881

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

.github/workflows/publish_pypi.yml Outdated Show resolved Hide resolved
.github/workflows/publish_pypi.yml Outdated Show resolved Hide resolved
.github/workflows/publish_pypi.yml Outdated Show resolved Hide resolved
.github/workflows/update_version.yml Outdated Show resolved Hide resolved
.github/workflows/update_version.yml Outdated Show resolved Hide resolved
@Saransh-cpp Saransh-cpp marked this pull request as draft August 8, 2023 04:26
@Saransh-cpp Saransh-cpp mentioned this pull request Aug 8, 2023
8 tasks
Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Just realised that these file paths were not changed earlier, it's good that we caught them before the 23.9 release:

https://github.com/pybamm-team/PyBaMM/blob/develop/scripts/update_version.py#L43-L47

should point to docs/_static/versions.json instead of docs/source/_static/versions.json

@Saransh-cpp
Copy link
Member Author

This should be ready to review. Copying release_workflow.md here as this PR's description -


Release workflow

rc0 releases (automated)

  1. The update_version.yml workflow will run on every 1st of January, May and September, creating 2 PRs -

    1. Incrementing the version to YY.MMrc0 by running scripts/update_version.py in the following files -

      • pybamm/version.py
      • docs/conf.py
      • CITATION.cff
      • vcpkg.json
      • docs/source/_static/versions.json
    2. A PR from develop to main

    The version PR should be merged into develop, and then the develop-to-main PR should be merged into main.

  2. Once the tests pass, create a new GitHub pre-release with the same tag (YY.MMrc0) from the main branch and a description copied from CHANGELOG.md.

  3. This release will automatically trigger publish_pypi.yml and create a pre-release on PyPI.

rcX releases (manual)

If a new release candidate is required after the release of rc0 -

  1. Fix a bug in main (no new features should be added to main once rc0 is released) and develop individually.

  2. Run update_version.yml manually while using append_to_tag to specify the release candidate version number (rc1, rc2, ...).

  3. This will create a PR incrementing the version to YY.MMrcX by running scripts/update_version.py in the following files -

    • pybamm/version.py
    • docs/conf.py
    • CITATION.cff
    • vcpkg.json
    • docs/source/_static/versions.json

    The version PR should be merged into main, because merging it into develop would require merging develop into main, something we don't want (develop will have new features).

  4. Once the tests pass, create a new GitHub pre-release with the same tag from the main branch and a description copied from CHANGELOG.md.

  5. This release will automatically trigger publish_pypi.yml and create a pre-release on PyPI.

  6. Manually merge main back to develop if any conflicts arise.

Actual release (manual)

Once satisfied with the release candidates -

  1. Run update_version.yml manually, leaving the append_to_tag field blank ("") for an actual release.

  2. This will create a PR incrementing the version to YY.MM by running scripts/update_version.py in the following files -

    • pybamm/version.py
    • docs/conf.py
    • CITATION.cff
    • vcpkg.json
    • docs/source/_static/versions.json

    The version PR should be merged into main, because merging it into develop would require merging develop into main, something we don't want (develop will have new features).

  3. Once the tests pass, create a new GitHub release with the same tag from the main branch and a description copied from CHANGELOG.md.

  4. This release will automatically trigger publish_pypi.yml and create a release on PyPI.

Other checks

Some other essential things to check throughout the release process -

  • Update baseline of registries in vcpkg-configuration.json as the latest commit id from pybamm-team/sundials-vcpkg-registry
  • Update CHANGELOG.md with a summary of the release
  • Update jax and jaxlib to the latest version in pybamm.util and fix any bugs that arise
  • If building wheels on Windows gives a vcpkg related error - revert the baseline of default-registry to a stable commit in vcpkg-configuration.json
  • Make sure the URLs in docs/source/_static/versions.json are valid

@Saransh-cpp Saransh-cpp marked this pull request as ready for review August 8, 2023 20:34
@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (c1c7c29) 99.70% compared to head (2e5b04f) 99.70%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3249   +/-   ##
========================================
  Coverage    99.70%   99.70%           
========================================
  Files          248      248           
  Lines        18894    18894           
========================================
  Hits         18839    18839           
  Misses          55       55           

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

Copy link
Sponsor Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Looks good to me, but let's wait to merge until the others are happy with it as this is quite a major point. Two main questions/comments:

  1. Is the CHANGELOG updated automatically or do we need to do it manually (I couldn't quite tell)?
  2. With this approach we will not have a separate branch for a specific version. Not sure we need it, but that's a major change from what we discussed in Reduce release frequency #2881 so just wanted to highlight it.

@Saransh-cpp
Copy link
Member Author

Oh, I see, I missed incorporating a few points. I'll look into that. Thanks for the review!

@Saransh-cpp Saransh-cpp marked this pull request as draft August 9, 2023 14:29
Copy link
Contributor

@martinjrobins martinjrobins left a comment

Choose a reason for hiding this comment

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

Looks great :) I just had one suggestion.

.github/release_workflow.md Outdated Show resolved Hide resolved
@Saransh-cpp
Copy link
Member Author

New logic with the branch stuff below! Here are some links from my fork -

  • The v23.8 branch - this should be created automatically on scheduled runs
  • Commit updating the version to rc1 - this was created by manually running update_version.yml
  • Commit updating the version to v23.8 and a PR from 23.8 to main - this was created by manually running update_version.yml

rc0 releases (automated)

  1. The update_version.yml workflow will run on every 1st of January, May and September, updating incrementing the version to YY.MMrc0 by running scripts/update_version.py in the following files -

    • pybamm/version.py

    • docs/conf.py

    • CITATION.cff

    • vcpkg.json

    • docs/_static/versions.json

      These changes will be automatically pushed to a new branch YY.MM.

  2. Create a new GitHub pre-release with the tag YY.MMrc0 from the YY.MM branch and a description copied from CHANGELOG.md.

  3. This release will automatically trigger publish_pypi.yml and create a pre-release on PyPI.

rcX releases (manual)

If a new release candidate is required after the release of rc0 -

  1. Fix a bug in YY.MM (no new features should be added to YY.MM once rc0 is released) and develop individually.

  2. Run update_version.yml manually while using append_to_tag to specify the release candidate version number (rc1, rc2, ...).

  3. This will increment the version to YY.MMrcX by running scripts/update_version.py in the following files -

    • pybamm/version.py

    • docs/conf.py

    • CITATION.cff

    • vcpkg.json

    • docs/_static/versions.json

      These changes will be automatically pushed to the existing branch YY.MM.

  4. Create a new GitHub pre-release with the same tag (YY.MMrcX) from the YY.MM branch and a description copied from CHANGELOG.md.

  5. This release will automatically trigger publish_pypi.yml and create a pre-release on PyPI.

Actual release (manual)

Once satisfied with the release candidates -

  1. Run update_version.yml manually, leaving the append_to_tag field blank ("") for an actual release.

  2. This will increment the version to YY.MMrcX by running scripts/update_version.py in the following files -

    • pybamm/version.py

    • docs/conf.py

    • CITATION.cff

    • vcpkg.json

    • docs/_static/versions.json

      These changes will be automatically pushed to the existing branch YY.MM.

  3. Next, a PR from YY.MM to main will be generated that should be merged once all the tests pass.

  4. Create a new GitHub release with the same tag from the main branch and a description copied from CHANGELOG.md.

  5. This release will automatically trigger publish_pypi.yml and create a release on PyPI.

Other checks

Some other essential things to check throughout the release process -

  • If updating our custom vcpkg registory entries pybamm-team/sundials-vcpkg-registry or pybamm-team/casadi-vcpkg-registry (used to build Windows wheels), make sure to update the baseline of the registories in vcpkg-configuration.json to the latest commit id.
  • Update CHANGELOG.md with a summary of the release
  • Update jax and jaxlib to the latest version in pybamm.util and setup.py, fixing any bugs that arise
  • Make sure the URLs in docs/_static/versions.json are valid

@Saransh-cpp Saransh-cpp marked this pull request as ready for review August 20, 2023 03:52
Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Thanks, @Saransh-cpp, this looks good! I added some minor review comments that you can address.

.github/workflows/release_reminder.yml Outdated Show resolved Hide resolved
.github/workflows/update_version.yml Outdated Show resolved Hide resolved
.github/workflows/update_version.yml Outdated Show resolved Hide resolved
scripts/update_version.py Outdated Show resolved Hide resolved
@agriyakhetarpal
Copy link
Member

There is also a draft PR for adding towncrier (#3278) that we would need to address before the next release, just a heads up

Copy link
Sponsor Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
@Saransh-cpp
Copy link
Member Author

Thanks for the reviews, @agriyakhetarpal and @brosaplanella!

@Saransh-cpp
Copy link
Member Author

A gentle bump for a review on this, @martinjrobins. We would be able to test this new system if the PR is merged before 1st September.

agriyakhetarpal added a commit to agriyakhetarpal/PyBaMM that referenced this pull request Sep 4, 2023
Copy link
Contributor

@martinjrobins martinjrobins left a comment

Choose a reason for hiding this comment

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

looks great, happy to merge

@Saransh-cpp
Copy link
Member Author

Thanks, @martinjrobins!

@Saransh-cpp Saransh-cpp merged commit 8da245e into pybamm-team:develop Sep 19, 2023
31 of 34 checks passed
@Saransh-cpp Saransh-cpp deleted the new-release branch September 19, 2023 09:21
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this pull request Aug 12, 2024
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.

Reduce release frequency
4 participants