opensafely-actions / safetab

Safetab outputs two-way tables of descriptive statistics
Other
0 stars 0 forks source link

Configure bump2version to bump README.md #22

Closed iaindillingham closed 3 years ago

iaindillingham commented 3 years ago

Anyone copying-and-pasting from README.md will always copy-and-paste the latest version of safetab.

iaindillingham commented 3 years ago

Couple of responses...

And some questions...

  1. Does the confusing part relate to understanding where the canonical version string is stored? In which case, it's stored in action/VERSION as command line configuration takes precedence over .bumpversion.cfg configuration. We're incrementing the version strings in README.md as a convenience and in .bumpversion.cfg as a necessity (see above).

  2. Or to whether version strings will be out-of-sync? In which case they won't: make bump will update them everywhere, commit the changes, and create a tag.

  3. Or to whether version strings matter? In which case, not to job-runner: only tags matter to job-runner. But it's fiddly to extract a version string from a tag. Even then, we'd still like to commit the latest version string to README.md to reduce copy-paste errors.

  4. Or to having configuration split between Makefile and .bumpversion.cfg? In which case, this isn't limited to version bumping; the same is true of anything where local configuration may diverge from global configuration, such as Mypy, flake8, isort etc. It's useful for changes to cascade, though. (And we do this elsewhere too; changes to Justfiles, for example.)

  5. Or something else?

I think the confusing part relates to 1. but I think the problem is over-constrained:

How about incorporating .bumpversion.cfg into python-action-template and not passing the current version via the command line?

benbc commented 3 years ago

Yes, it's mostly 1, with a bit of 2 and 4.

Knowing that the version in .bumpversion.cfg gets bumped relieves most of my concern.

I think your suggestion of adding .bumpversion.cfg to the template is an excellent one and would completely pacify me. Could you even include a commented-out version of the [bumpversion:file:<some-file>] directive to show people how it's done?

iaindillingham commented 3 years ago

Thanks @benbc. I've commented both in this repo's and python-action-template's .bumpversion.cfg.