This is a RFC for our current development process as it relates to branching, tagging, and ~releasing~ generating release artifacts. Specifically, it recommends adopting the Gitflow workflow. Everything old is new again.
The Gitflow workflow is a slight extension to our current feature and release branch workflow that adds a few more branches to the mix to improve our release [artifact generation] process
With whatever workflow we implement, our goals are:
Where our "leaf projects" right now are:
This RFC proposes that we implement a basic Gitflow branch structure, where:
edgeedgeedgerelease branch is cut from edgemastermaster is regular merged into edgemastermaster is taggedmaster is regular merged into edgeRead the Atlassian article above for a more in-depth discussion and diagrams. Please note that we don't necessarily need to treat the Atlassian (or any other) article as gospel; we're just looking to add a branch or two to make our releases a little more sane.
Things to note:
edge and/or the release branch in the pastPros
master means we get isolated release _and_ changelog generation tools don't get confusededgeedgeCons
Our other leaf projects (PD, LL+C) are web projects, and they have the following concerns:
For these projects, this RFC proposes we select one of these two options:
Keep doing basically what we're doing:
edgeedgeImplement a full Gitflow for each leaf project, where each leaf project has its own master branch (e.g. protocol-designer-master)
Pros to option (1):
master buildPros to option (2):
master and edge will be (more than likely) necessaryEdit 1: s/develop/edge per @sfoster1's suggestion
Edit 2: Tried to make it more clear that we're talking about our release artifact generation mechanisms, not our artifact deploy mechanisms
For our purposes we can probably s/develop/edge/, there's no need to change the name of the branch.
馃憤
Releases and release testing do not block merging work for that leaf project
Releases and release testing for one leaf project do not block anything (merges / releases) for another leaf project
Can we do this by separating artifact deploys from code merges, instead of making more code merges that mean different things?
Can we do this by separating artifact deploys from code merges, instead of making more code merges that mean different things?
@IanLondon Sorry this wasn't clear in the description, but this RFC is not meant to affect or dictate anything about artifact deploys. Artifact generation being tied to artifact deploy in the RA/API is a separate issue, but is also not the reason that merges are blocked. This RFC is concerned with artifact __generation__.
We have tried a few strategies with in terms of artifact generation:
edge. Block merges into edge during QAedge, do not block merges into edge during QAedge, by necessity picking up all other merges into edge into our release (potential new bugs and all)edgeedgeedgegit describeSo, this RFC is about extending option (3) to:
For the artifact generation approaches 2 and 3 above, I think they're trying to solve this: It can be a problem if we QA candidate No. 1, find some problems, merge some fixes, and in the mean time get "outside" changes from other PRs getting merged that don't directly address the project we're QA'ing and might mess it up. When we have candidate No. 2 ready to QA, we ideally want to only test the things that failed in the previous QA round. But since other things snuck in, we can't trust that things that passed will still pass, so we have to start QA from scratch.
One way out, number 3, is to isolate QA candidates so that they don't pick up "outside" changes, and git flow is a clear way to enable that isolation.
Isolating QA candidates speeds up QA of those projects. But if we isolate our release branches, it's likely that once in a while we'll have a situation where QA for a project passes, then the release branch gets merged back in to edge. As a result of the merge, that project no longer works right. That's a bad place to be in, especially considering that we wouldn't be QA'ing the merged-into-edge code, we are QA'ing it only before merging. We could release a dud even after it passed QA.
I'd rather take the route of not isolating QA candidates from the commits in edge. Generate an artifact every commit into edge, do QA on one of those artifacts, tag it if it passes. (This is pretty much what we're doing now for PD/LC, it's strategy 2 on the post above)
Hopefully we can make QA less time-consuming by automating more of it as we go. That would lower the con side here. IMO I'd rather we invest energy into making QA quicker and cheaper for us than to invest energy into developing tooling/automation that would make the gitflow multi-project workflow less error-prone.
I def might be missing something here! I am pretty biased b/c I'm not dealing directly with Run App / API release problems. For the web projects, the gitflow approach seems to me like it's making everything more complicated without any benefit.
@IanLondon Your proposed flow does require merge freezes during the timespan of someone declaring work on a pr to bump the version and generate changelogs and that pr getting merged, so we don't miss stuff in the changelog. That can actually stretch for a while between waiting for ci and making sure everybody gets eyes on it.
I also disagree with the sentiment of "let's just make our QA better". You're right, we should. But we also have a lot going on, and the key ways in which we can improve qa are not small tasks in and of themselves - end to end testing, browser automation, that sort of thing - so we're realistically not going to get to them for a while. In the meantime, we shouldn't just do nothing.
Maybe we should split this on a per-leaf-project basis? It makes sense to do this workflow for runapp/robot software, but it's separate from the pd and ll process to such an extent we already proposed having separate master branches. Once we're there we might as well just separate the processes entirely. PD and LL keep doing their artifact promotion strategy, runapp/robot software (gotta think of a punchier name here) do this kind of gitflow thing. They should work together just fine.
But if we isolate our release branches, it's likely that once in a while we'll have a situation where QA for a project passes, then the release branch gets merged back in to edge. As a result of the merge, that project no longer works right.
(Emphasis mine)
@IanLondon I _believe_ this is a misunderstanding of the flow. The process is as follows:
edgemaster (or proctocol-designer-master or whatever)master are exactly the previous releasemaster is taggedmaster is merged into edge@sfoster1 can correct me if I'm wrong here, but I was under the impression that the order of the merges is such that the contents of master must match the contents of the release branch exactly after the release > master merge. Then, if we choose to generate an artifact from master, it's the same source code as the build that just got QA'd). If that were not the case, then yes, the value of this flow would be dubious.
For the web projects, the gitflow approach seems to me like it's making everything more complicated without any benefit.
What's been the process thus far for a PD hotfix that needs a fix applied directly because of back-compat risks with changes to edge? Without gitflow, I'd imagine that based on the current process it would have to be something like:
edgeAs I'm working through this in my head, I'm starting to think that (no matter what we do) we're going to be forced to move the CHANGELOGs into GH releases instead of in-source (the tooling exists to do this). No matter what non-blocking flow we're doing, we're going to end up with weirdness about tags, commits, and ordering of log entries.
An advantage of Gitflow for __all__ or projects in this context is that, if we only ever tag master, we can then generate _all_ of our change logs from master. Because of Gitflow, our logs will then always be accurate. (Or rather, our logs will always contain the commits we are releasing. Logs will be accurate if we committed all our stuff properly).
I am ok with putting changelogs in to GH releases. We'd presumably be publishing alpha releases there also, right? Anything tagged?
And yeah your read on the master merge is correct, that should always be fast-forward.
We'd presumably be publishing alpha releases there also, right? Anything tagged?
Yup, and they'd be marked as prerelease
Re @sfoster1's comment about merge freezes for version bump + changelog:
IMO doing a bump to application version after QA is undesirable, b/c if the application is aware of its own version, it's going to behave differently after the bump, in ways that the pre-bump QA couldn't cover. I'm not aware of any version-self-aware behavior in RA/robot, but PD uses its own version to show update messages (not changelog) and to run migrations, so PD needs its version bumped before QA happens, and generally as soon as there is a PR that uses that version for a new behavior.
Have we talked about about moving away from committing the changelogs (keep them in a git tag message or something)? Edit: mentioned above
These are not trivial moves but they might be easier than moving to gitflow. If we don't need this extra process of PR'ing and merging a version bump + changelogs, then strategy 2 is non-gating and we don't have to build/find/cobble the tooling and automation for doing multi-project gitflow safely.
We'd still have the issue where QA may need to be repeated from scratch when commits came into edge and the first QA failed. I don't think we should do nothing, I think that now is the right time to begin incrementally automating QA and prioritizing that. If speedier QA is the main pain point which isolating release branches from edge is intended to solve, our time is better spent making QA better now instead of restructuring our git workflow to limit what code goes into releases. Gitflow isn't an inexpensive or fast solution, and I don't think it would be a long-term one.
Thanks for the clarification @mcous. As long as it's only fast-forwards to master, my reservation about releasing a thing we didn't QA isn't a concern. Thanks!
So just to rehash to make sure I understand: if we do gitflow with per-deploy-set master branches, we're tagging only per-deploy-set master branches. I'm calling them "deploy sets" because multiple projects: RA+robot, and LL+LC are deployed together. There's no real master branch (we can call the run app / robot deploy set master if we want but it's not authoritative over, or more complete than protocol-designer-master or labware-master or any other master branches). Is that right?
@mcous re hotfixes: correct, that's been the recent hotfix flow for PD, though sometimes the bugfix PR to edge was made before we decided it was bad enough to do a hotfix release, or no PR to edge was necessary because in edge the problem is no longer relevant (fast-changing feature, I think this happened with the deck map).
We did gitflow a while back, by the book with no special twists, and we abandoned it. Gitflow works against GitHub: it requires us to remove GitHub branch permissions and types of merges allowed, which is dangerous (https://github.com/petervanderdoes/gitflow-avh/issues/358); it requires us to sometimes use the git flow CLI instead of the GH merge button. It requires us to regularly push commits without going thru PR reviews (to keep branches in sync), which is fine until somebody makes a mistake when resolving a merge conflict. Gitflow requires us to spend more time fixing merge conflicts, cleaning the history, thinking about git flow diagrams, and thinking about when to squash vs normal merge. Doing gitflow for multiple "deploy sets" (RA+Robot, LC+L, PD) adds an additional dimension of complexity. Since release branches are isolated from edge, edge is prone to getting a big dump of changes after a release goes out, which might mess up other work in-flight and is anti-continuous-integration. Even after we all get over the initial learning curve, gitflow would require us to each take more care and thought day-to-day to accomplish git/GH tasks.
Thanks everyone for your thoughtful feedback! I've talked to everyone in person, and here's what we're going to move forward with:
master and tagged there once it has passed QAmaster branch to collect releases on top of our existing release QA branch processgit flow CLI is not required and nobody should need to install it3.12.0 will likely involve an amount of manual merging (and temporary removal of branch protections to do so). Automation of this process should be explored ASAP; maybe we can even beat 3.12.0
Marking this RFC accepted; will close when documentation is updated and 3.11.0 is on master
We are using this process to release the app as of 3.11.x
Most helpful comment
Thanks everyone for your thoughtful feedback! I've talked to everyone in person, and here's what we're going to move forward with:
masterand tagged there once it has passed QAmasterbranch to collect releases on top of our existing release QA branch processgit flowCLI is not required and nobody should need to install it3.12.0will likely involve an amount of manual merging (and temporary removal of branch protections to do so). Automation of this process should be explored ASAP; maybe we can even beat3.12.0Marking this RFC accepted; will close when documentation is updated and 3.11.0 is on
master