Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Standardize and automate release flow #68

Closed
redeboer opened this issue Jun 17, 2020 · 10 comments · Fixed by #113
Closed

Standardize and automate release flow #68

redeboer opened this issue Jun 17, 2020 · 10 comments · Fixed by #113
Assignees
Labels
🖱️ DX Improvements to the Developer Experience

Comments

@redeboer
Copy link
Member

redeboer commented Jun 17, 2020

Problem description

Have had a few times that pushing a tag results in a failed deploy job, e.g. https://travis-ci.com/github/ComPWA/expertsystem/jobs/350476070, because I forgot to bump the version in the setup.py file. There are better tools for that, like bumpversion.

Also, we haven't really thought about how to deal with releases. Linear commit history already provides some sort of clean versioning, now it's just a matter of summarising the most important changes for each release. For now, I follow the release style that tensorflow uses. Although we're unclear about Semantic Versioning.

Summary

  • Should we use Semantic Versioning?
  • How to decide about whether a release is a patch or a minor version update?
  • How to make that as effortless (automatic) as possible?
  • Which (adr: choose packaging system and versioning scheme #70) conventions to use for the release draft?
  • How to keep Git tags in sync with the (single source of truth)
  • Should we reconsider our packaging tool/setup (i.e.setup.cfg, pyproject.toml, ...)

This differs from #70 in the sense that in this repository we want to try out and illustrate some tools for a nice release flow. In the PWA Pages we describe that release flow after it turns out to work well. The PWA Pages then serve more as a guideline.

Some resources

@redeboer redeboer added 📝 Docs Improvements or additions to documentation 🔨 Maintenance Refactoring that doesn't affect the interface Priority: Low labels Jun 17, 2020
@redeboer redeboer self-assigned this Jun 18, 2020
@redeboer redeboer modified the milestones: Finalize dev environment, Release 0.1-alpha Jun 18, 2020
@spflueger
Copy link
Member

Regarding the version of setup.py: The current situation is not ideal, but its fairly ok. Not sure if bumpversion is foolproof. Some kind of hook in github would almost be best, that has access to the tag stage and will deny a tag if the version does not match. Don't know what state of the art is here.

Regarding the versioning: Semantic versioning is nice and I would love to do that (to get some hands on experience with this). But for me that would imply that you keep several major version branches that are maintained simultaneously. So I think that will add to much workload.

@spflueger
Copy link
Member

Lets turn this into an ADR, to keep our decision fixed. I think this should almost be ComPWA global, decision...

@redeboer redeboer modified the milestones: Release 0.1.1-alpha, Finalize dev environment Jun 18, 2020
@redeboer
Copy link
Member Author

If it's global, imho the best place would be
https://github.com/ComPWA/PWA-pages
For instance, a section with thoughts on linear commit history (particularly its use in a research settings), how that facilitates the release flow (the linear commit messages neatly summarise changes), how to tag and bump a version (as you say, probably best through a git hook), and how to draft a release note.

@spflueger
Copy link
Member

Yeah exactly. That was my idea. Do you think this decision should be global or project local?

@redeboer
Copy link
Member Author

So a description of the conventions can best be placed in some global place and I can only think of the PWA Pages (even if they're experimental). Git hooks and all have to be implemented for each repo, ofc, but the expertsystem can serve as a nice try-out (particularly with the upcoming pre-releases).

@redeboer redeboer modified the milestones: Finalize dev environment, Release 0.1.2-alpha Jun 18, 2020
@spflueger
Copy link
Member

spflueger commented Jun 18, 2020

I meant if the conventions we decide based on the versioning will apply to all subprojects within ComPWA? Also we should keep in mind that tensorwaves will be closely coupled to AmplitTF and zfit.

@redeboer
Copy link
Member Author

Maybe 'guideline' is a better word than 'convention' here.
Anyway, main point is: create an ADR under the expertsystem or under the PWA Pages?

@redeboer redeboer changed the title Improve and formulate release flow Standardize release flow Jun 18, 2020
@redeboer redeboer modified the milestones: Release 0.1.2-alpha, Finalize dev environment Jun 18, 2020
@redeboer redeboer changed the title Standardize release flow Standardize and automatize release flow Jun 19, 2020
@redeboer redeboer assigned spflueger and unassigned redeboer Jun 19, 2020
@redeboer redeboer added Difficulty: Hard and removed 📝 Docs Improvements or additions to documentation 🔨 Maintenance Refactoring that doesn't affect the interface labels Jun 20, 2020
@redeboer redeboer added 🖱️ DX Improvements to the Developer Experience ❔ Question Discuss this matter in the team labels Jun 20, 2020
@redeboer redeboer changed the title Standardize and automatize release flow Standardize and automate release flow Jun 25, 2020
@redeboer
Copy link
Member Author

redeboer commented Jul 7, 2020

Now that #102 is through, I think this issue can be fixed by creating something like a __version__ file at the script stage of the Travis deploy job. That file can then be used in the setup.cfg (we have to make sure this doesn't cause errors for users). So the version determination would happen somewhere this stage:

expertsystem/.travis.yml

Lines 56 to 65 in a438784

- name: "Deploy PyPI package"
install: echo "Skipping install stage"
script: echo "Skipping script stage"
deploy:
edge: true
provider: pypi
on:
tags: true
distributions: sdist
skip_existing: false

And we have to make sure this job is only performed when triggered by a tag.

@redeboer redeboer assigned redeboer and unassigned spflueger Jul 7, 2020
@spflueger
Copy link
Member

https://pypi.org/project/setuptools-scm/ this cant help?

@redeboer
Copy link
Member Author

redeboer commented Jul 8, 2020

Yes good one, looks promising, I'll check it out later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🖱️ DX Improvements to the Developer Experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants