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

Python client -- issues with version coupling and automatic releases #1296

Closed
melange396 opened this issue Oct 2, 2023 · 4 comments · Fixed by #1465
Closed

Python client -- issues with version coupling and automatic releases #1296

melange396 opened this issue Oct 2, 2023 · 4 comments · Fixed by #1465
Assignees
Labels
help wanted python client changes the Python client user experience things that affect users of our software or services

Comments

@melange396
Copy link
Collaborator

The version of the delphi_epidata python client is bound to the version of the repository. This means that a new version of the client is automatically published to PyPI whenever we do a release of delphi-epidata, even if the client code has not actually changed. This can confuse or annoy users, as it might encourage them to do frequent but unnecessary upgrades. There are also concerns regarding what to do if we make changes to the client interface that might break users' existing workflows -- in such a case, Semantic Versioning necessitates incrementing the "major" version number, but this may be undesirable to apply to the entire repository.

We can address this in a number of ways:

  • Uncouple versions between the two, which lets us number the client version however we need or want. This would involve removing the client from the existing "bumpversion" configuration, and would require creating a different release process (either automatic or manual -- automatic being more work up front, while manual requires remembering to perform some number of extra steps when changing the client).
  • Keep the versions coupled, but only do the PyPI release if/when the client code actually changes (again, either automatic or manual with the same caveats). Changes to the client (other than just version number) would be found in the file https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.py and anything under the directory https://github.com/cmu-delphi/delphi-epidata/tree/dev/src/client/packaging/pypi . I suggest this path, at least initially.

This discussion came up in #1288. Additional points are made and details listed in that PR, starting with comment #1288 (comment) .

Similar concerns may exist for the other clients in this repo.

@melange396 melange396 added help wanted python client changes the Python client user experience things that affect users of our software or services labels Oct 2, 2023
@melange396
Copy link
Collaborator Author

We are going to do the second bullet point above, as it integrates well with checking against the most current PyPI release as mentioned in #1281 (comment)

@melange396 melange396 mentioned this issue May 29, 2024
4 tasks
@rzats
Copy link
Contributor

rzats commented May 31, 2024

@melange396 one quick question before I create a PR for this!

Ideally I'd like to automatically release the Python and JS clients if the relevant files have been changed, and there are GitHub Actions that enable this. However:

Changes to the client (other than just version number) would be found in the file https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.py and anything under the directory https://github.com/cmu-delphi/delphi-epidata/tree/dev/src/client/packaging/pypi

Currently, a couple files in these paths have bumpversion enabled:

[bumpversion:file:src/client/delphi_epidata.py] (recently changed)

[bumpversion:file:src/client/packaging/npm/package.json] (managed by bumpversion before)

[bumpversion:file:src/client/packaging/pypi/setup.py] (managed by bumpversion before)

So they would be changed with every release either way.

I have two potential solutions for this:

  1. Do not automate the client release, instead simply decouple the Python & JS release steps as an extra manual workflow (and modify the release guide to mention this)
  • This decoupled workflow would simply work like create-release.yml - put in a version number to get a Python and/or JS release.
  1. Rethink how we single-source the version again. This would mean excluding delphi_epidata.py, package.json and setup.py from bumpversion, and figuring out another way to update the versions there.
  • As Dmitry has mentioned, there are a couple suggested ways of doing this. The 4th suggestion (a separate VERSION file) might make sense, as it is supported by JavaScript as well.

Which do you think is preferable?

@melange396
Copy link
Collaborator Author

There are other possibilities too:

  • (1) Make the python client release steps a conditional part of the regular release process, but only when there are changes to https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/packaging/pypi/CHANGELOG.md . This will have a side-effect benefit of ensuring people properly document changes to the client before it gets released.
  • (2) Allow the python client to have its own version progression, not linked to the version of the acquisition and server code. This is how it is done for the delphi_utils package in covidcast-indicators. I dont love this (and im not exactly sure why, besides the drawback i mention below), but there is some logic to having the separation.
    • There are two .bumpversion.cfg files, one for delphi_utils and one for the rest.
    • The delphi_utils version bumping and PyPI release are conditional on changes to those files (here and here).
    • AFAICT this solution has a drawback in that its not currently possible to do anything but a "patch" release for delphi_utils and not the rest, or vice-versa.
  • (3) Semi-detatch the versioning, syncing the client version to the base version and doing the PyPI release only on client code changes. This can be accomplished like so:

I like the last one best but i could be convinced to go along with the CHANGELOG-dependent one.

@rzats
Copy link
Contributor

rzats commented Jun 3, 2024

@melange396 I've implemented your last idea in #1465!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted python client changes the Python client user experience things that affect users of our software or services
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants