-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Our new release workflow #3113
Comments
Q: The CHANGELOG can be the same on the main branch and the rel branch right? Doesn't matter if we have some unreleased additions on main and if we do a patch version. After all users will only see the main branch CHANGELOG. Another issue with the CHANGELOG is that it's no longer good for major or minor releases, because I have to edit it manually to link the features to the docs as on https://github.com/PostgREST/postgrest/releases/tag/v12.0.0 Maybe we should no longer update the CHANGELOG manually on PRs (this is easy to forget too). Whenever a For this we can stick to a commit convention (similar to the one Wolfgang suggested before), but that also includes a link to the latest docs. For this #2814 is a must. Not sure about the cabal version, I think for now we can just duplicate it. Although this would matter more if #2275 was done. Perhaps the correct thing for main would be to have the highest version plus the date as the cabal version, like we did on the nightlies. So right now it'd be 12.0.1.20231215. |
But then the version number would again not reflect which kind of changes have happened since 12.0.1. What about the following?
Yes, we should do that. We could do it as follows:
Additionally, once the docs are in the main repo, the btw. regarding back-patching on release branches, I think we should do the following:
|
Hm, the downside of this is, that we still don't reflect what's really happening on main. I researched a lot of other projects, to see what they do. Here's a different idea now. First, some key goals:
The best way to achieve this, is to do what GHC and node.js are doing: They have uneven version numbers as pre-releases/development, and even version as real releases/stable. Node is doing it on the major, GHC on the minor. I think we already discussed this a while back, but haven't done so, yet (we still have 11.1 and 11.2 released). My proposal is this:
I think this could work pretty well. |
@wolfgangwalther Agree, I like the idea. That way main would be always 1 step ahead of the latest release instead of perpetually stuck in an older version.
+1 they gave more headaches than anything. |
Hm, will we do that for pure docs commits too? (it doesn't seem right) That should happen once #3120 is merged. For now I'm thinking that nightlies should also be manual. Our Maybe we should finish #3120 before settling on a new release model. It will simplify a lot of things. |
We already do docs releases on each commit. The latest tag on the docs is the version from the postgrest-docs main branch. That should stay the same in the future. We just need to also make nightly releases on every commit, so that docs and latest nightly are actually in sync. For the release branches, whether to release on each commit as we do right now, or only after tagging a new release would be up for debate, I guess.
Why? That will just bring us back to where we were before - and I don't want to go there. Currently, it's much harder than we need it to be to get the latest main branch for a quick test in an actual project repo. If we build a nightly image after each commit, all I need to do is to open a PR in my project, where I change the postgrest version to the latest nightly. Then I can test everything we currently have on main and provide feedback before we actually make a new release. Hopefully this would cut down on the number of bugs we have to fix after each release.
The opposite! We need to first have a clear idea on how we want to do releases, including the docs, before we should actually move the docs over. We need to get the docs migration right from the beginning. And we need to know what to merge into which branches. But for that we need to know how we want to proceed later on. Extending the proposal from #3113 (comment) with docs:
I don't see any problem integrating the docs here. I do find it a bit strange, that we currently list all minor releases on readthedocs: Maybe we can think about only having one version of the docs online for each major version? The latest minor release of that, ofc. I think that should be enough - after all, the idea is that upgrading through minors should always be easily possible, because it's not breaking. So there should be no "this feature is only available on 11.2, but I am still on 11.1". No need to stay there. Taking the "publish docs on each commit on release branches" idea one step further: I think we should do the same for bugfixes. Here's how:
This would leave us with only minor and major releases which we need to do manually via WDYT? |
Right, forgot about that - docs do get a release for each commit on main.
Agree.
That sounds perfect/ideal.. though I don't know the effort it takes. It seems considerable with the bot and all.
I think we should avoid that. Having too many releases will create notification fatigue and we'll lose watchers on the repo. The way we did nightlies before would be good for this https://github.com/PostgREST/postgrest/releases/tag/nightly. (Related #2997)
Agree overall 👍 |
We'll be far away from that, if we just release every bugfix immediately.
Well, yes. I was not planning to create a new release for every nightly, but instead update the existing one. But bugfixes should get their own release, for sure. |
Ok, so now that we agree on the idea, here are the steps I think we should take to actually implement this: Cleanup / Preparation
Migrate the docs repo
Prepare the next release
Further improvements
@laurenceisla @steve-chavez, anything I forgot? |
Going forward, an uneven minor version will be a development version, while an even minor will be considered a stable version to be released. This is similar to what GHC does and was discussed in #3113. This bump should have happened after branching off v12.0.0, but obviously we didn't know about it back then. This will happen immediately after branching off a new release from now on.
Did both of that already. |
Is it necessary to migrate the docs to older branches? Will they not stay as they are right now in RTD? Otherwise, everything LGTM. |
If we do that, then we can't archive the docs repo. And then we risk running out of sync. The cleanest solution is to clearly move everything over. |
rel-X.Y
branches
I dealt with all open PRs to the postgrest-docs repo. |
I archived the docs repo to allow working on #3120 etc. without getting out of sync again. |
I added "Write docs for new features." to the section of preparing a new release. The changelog tells me we might need docs for those items?
Not sure if those have been written already. |
True. Those are missing. |
While experimenting with different strategies to merge the two repos, I realized that the v9 branches in both repos don't pass CI anymore - it seems like the nix-related github actions are too old by now and thus our nix tooling doesn't work anymore. I didn't dig deeper - but instead decided to just remove the v9 branch from the docs. Given that we haven' touched that branch for more than 1 1/2 years, I think it's ok to not show it anymore going forward. IIRC, the last time we discussed this, our policy was to say we show the current latest major and two more older majors - so that would mean we are going back to v10 only. |
All done. |
Prime example here: I had to use a latest development snapshot of postgrest to kickstart development of a new feature in our project, while the next PostgREST version is not released, yet. This took more effort than I wanted it to take. When I finally gave it a test-run in our project's CI, I identified the following bugs:
With the current manual workflow, I won't repeat this often. But with a nightly... that would be much easier. |
I am currently working on the release tooling and there is one question that comes up for me around nightly releases: Do we want to persist nightly releases forever or do we want to replace them with every new nightly release? In the past, we had kind of a mix:
So the old nightly releases were not really consistent, the pre-releases were consistent and kept everything. I don't like keeping the old prereleases, though. This makes it basically impossible to use the release page as kind of a changelog to the project, because all the pre-releases keep repeating the same changes over and over again. Just have a look at page two: https://github.com/PostgREST/postgrest/releases?page=2 Ultimately the question is: Why do we want to provide nightly releases? Imho, we should provide them to allow users to try out new features before an official release is made - but not to depend long-term on those pre-releases. So once the new release is made, I don't think we need those pre-releases anymore. Thus, I suggest:
At first I thought it would be helpful to have the version in the docker tag like @steve-chavez any objections? |
Uhm, that won't work - all releases need a tag. So we'd do a |
Yeah, don't like that too. Too much noise.
No objections.. |
Did both of that. |
While going through the docker images, I noticed that we have the newer releases all with an additional Our postgrest/.github/scripts/arm/docker-publish.sh Lines 36 to 39 in e5aee49
But we don't delete the tag, so far. We could easily do so, the actual image is part of the multi-layer image under the regular version tag. @laurenceisla since you wrote this script, can you shine light on why we still keep the |
The latter.
Awesome!
Yeah, no need to keep those |
This changes the postgrest-release tool to work with our new workflow. It can be run on main and the v* release branches. When on a release branch, it will bump a patch version and push to that branch only. When on main, it will bump a minor version by default. To bump a major version, pass --major. This first bump will be force-pushed to the v<major> branch. A second bump to the current development version will then be pushed to the main branch. The tool will not tag commits anymore - this happens in CI automatically. References PostgREST#3113 Resolves PostgREST#3082
This changes the postgrest-release tool to work with our new workflow. It can be run on main and the v* release branches. When on a release branch, it will bump a patch version and push to that branch only. When on main, it will bump a minor version by default. To bump a major version, pass --major. This first bump will be force-pushed to the v<major> branch. A second bump to the current development version will then be pushed to the main branch. The tool will not tag commits anymore - this happens in CI automatically. References #3113 Resolves #3082
Was going to comment on #3082, it's kinda related but out of the scope of that issue.
Problem
When doing a release from a
rel-X.Y
branch, then thebump to vA.B
commit is only present in therel-A.B
branch. That's why we have to manually create a CHANGELOG commit inmain
, but not bump thepostgrest.cabal
version. This causes 2 things:postgrest.cabal
version inmain
is permanently outdated (right now it's11.2.0
when12.0.1
is the latest release)Proposal
Before the release is done, verify if the
rel-A.B
andmain
branches are pointing to the same commit ( the samegit rev-parse <branch>
), if so, then the bump commit can be merged intomain
and pushed too (pushesrel-A.B
,main
andvA.B.C
). This could be done automatically or ask if it's OK to merge.If the branches are not pointing to the same commit, then automatically add only the CHANGELOG update to main, or ask if it's OK, or just inform to do it (I almost forgot to do that for
v12.0.1
). This will keep the version inmain
behind of the patch releases, but I think it's OK since the commits diverge until the next minor/major release fixes this.The text was updated successfully, but these errors were encountered: