Skip to content

chore: Update changelog and version#2944

Merged
casperklein merged 2 commits intodocker-mailserver:masterfrom
casperklein:update-changelog-version
Dec 22, 2022
Merged

chore: Update changelog and version#2944
casperklein merged 2 commits intodocker-mailserver:masterfrom
casperklein:update-changelog-version

Conversation

@casperklein
Copy link
Copy Markdown
Member

@casperklein casperklein commented Dec 22, 2022

Description

One issue remains: the 11.3.1 image contains 11.3.0 in /VERSION.

Fixes #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change that does improve existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@casperklein casperklein self-assigned this Dec 22, 2022
@casperklein casperklein marked this pull request as ready for review December 22, 2022 00:25
@casperklein casperklein requested a review from a team December 22, 2022 00:25
@polarathene polarathene changed the title Update changelog and version chore: Update changelog and version Dec 22, 2022
@georglauterbach
Copy link
Copy Markdown
Member

georglauterbach commented Dec 22, 2022

Ooooooops.. Sorry 🫠

@polarathene
Copy link
Copy Markdown
Member

Just to confirm, I shouldn't merge anything for v12 until this is merged, and possibly something else is done?

@casperklein casperklein merged commit bbe3640 into docker-mailserver:master Dec 22, 2022
@casperklein
Copy link
Copy Markdown
Member Author

and possibly something else is done?

What do you mean?

@polarathene
Copy link
Copy Markdown
Member

What do you mean?

Wasn't this PR for an already released v11.3.1? Did the tag need to be updated or something? 😅

Just checking if I should hold off merging anything or not 👍 So all good to go ahead and merge now?

@casperklein
Copy link
Copy Markdown
Member Author

casperklein commented Dec 22, 2022

We could now (without merging other things) delete the tag and release 11.3.1 again to fix the image. But the cleanest solution probably would be to release 11.3.2.

@polarathene
Copy link
Copy Markdown
Member

Ok, so another PR just like this one then, that bumps the version and gets released? Then after that I can merge my PRs? 😅

@casperklein
Copy link
Copy Markdown
Member Author

Yes. Or we leave it as it is. The only issue the current image have is, that update-check.sh thinks it's running on 11.3.0.
What do you think?

@polarathene
Copy link
Copy Markdown
Member

What do you think?

I don't mind either way. If you don't think it's worth the hassle, then I'll just start merging my PRs 👍

@casperklein
Copy link
Copy Markdown
Member Author

I didn't think of the update notification email, that will trigger now every time DMS is started.

Any idea, how to fix that (without reverting all your merges)?

@polarathene
Copy link
Copy Markdown
Member

polarathene commented Dec 23, 2022

Any idea, how to fix that (without reverting all your merges)?

I believe in private maintainer discussions we did plan how to approach such fixes.

If you fork the tagged v11.3.1 commit (or in this case the one with this update), you could add a new commit with the relevant updates and tag it for v11.3.2. This tag and branch would live off master though (and could probably be deleted at some point).

This branch won't be merged into master. (EDIT: It'd be technically required for the update checker)

Just name the branch release/v11.3.2 or something? When tagged, it should trigger the CI workflows that monitor for tagged commits. Tags aren't tied to branches, so they will bypass anything that normally relies on master branch updates. That should trigger the workflows to build and publish an image to DockerHub.

@polarathene
Copy link
Copy Markdown
Member

That said, I think we could release a v12 early Janurary? So the minor annoyance wouldn't last long.

@casperklein
Copy link
Copy Markdown
Member Author

Like this? I've also create a release draft. Can you check and confirm, everything is okay?

@polarathene
Copy link
Copy Markdown
Member

polarathene commented Dec 23, 2022

default_on_push.yml should run upon tagging the commit:

Building the image, running tests and then if both pass publishing the image:

publish-images:
name: 'Publish AMD64 and ARM64 Image'
needs: [build-image, run-tests]
uses: docker-mailserver/docker-mailserver/.github/workflows/generic_publish.yml@master
with:
cache-key: ${{ needs.build-image.outputs.build-cache-key }}
secrets: inherit

During the publish workflow, it should apply the following image tags, and since we're not on master branch, the :edge tag is ignored (a workflow triggered by a pushed tag should always ignore that AFAIK, even if the commit is on master branch):

- name: 'Prepare tags'
id: prep
uses: docker/[email protected]
with:
images: |
${{ secrets.DOCKER_REPOSITORY }}
${{ secrets.GHCR_REPOSITORY }}
tags: |
type=edge,branch=master
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}

That said, these generic re-usable workflows may be a bit different and we may have to pay attention to what happens here:

- name: 'Acquire the image version'
id: get-version
shell: bash
run: echo "version=$(<VERSION)" >>"${GITHUB_OUTPUT}"

- name: 'Build and publish images'
uses: docker/[email protected]
with:
context: .
build-args: |
VCS_REVISION=${{ github.sha }}
VCS_VERSION=${{ steps.get-version.outputs.version }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache

As you can see that our default_on_push.yml on this branch does not run the generic_publish.yml I've shown above (with the old ARM support), but specifically the workflow from current master branch due to the @master at the end:

publish-images:
name: 'Publish AMD64 and ARM64 Image'
needs: [build-image, run-tests]
uses: docker-mailserver/docker-mailserver/.github/workflows/generic_publish.yml@master

This will result in publishing v11.3.2 without legacy ARM platform support, something we intended to drop from v12 onwards. This is just due to the workflow changes, other master branch changes like TLS support shouldn't be applied if these workflows work as I expect them to :)


Other than the above, our docs likewise have production deploy workflow trigger by pushing tags:

# Responds to tags being pushed (branches and paths conditions above do not apply to tags).
# Takes a snapshot of the docs from the tag (unaffected by branch or path restraints above),
# Stores build in a subdirectory with name matching the git tag `v<MAJOR>.<MINOR>` substring:
tags:
- 'v[0-9]+.[0-9]+*'

- name: 'Check if deploy is for a `v<major>.<minor>` tag version instead of `edge`'
if: startsWith(github.ref, 'refs/tags/')

add-version-to-docs:
permissions:
contents: write
name: 'Update `versions.json` if necessary'
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/')

No concerns with that, other than not being 100% sure if only the workflow is run from the master branch version, or if it ignores this branch/tagged commit and switches to master. I'm pretty sure that unlike workflows triggered by a workflow dispatch event, the initial context should be carried over, and our usage of these generic workflow files between master branch and PR branches/events should be a good indication of that.


Summary

  • Tagging a commit on this branch will trigger an image build, test, followed by deploying to container registries.
  • Docs will also be built and deployed for this tag.
  • Concern: Workflows used are master branch copies, not workflows on the active branch? ARMv7 will not be published for this patch version.

I don't anticipate the concern to be a real issue, seeing as we're dropping support with v12, and if we have any such users, they can remain on v11.3.1 as they'd continue to receive update notifications going forward anyway (unless they opt-out via ENV).


I've also create a release draft.

You can make a release on Github I think, but we would not be tagging the usual master branch. Is this a branch / history you'd like to keep around going forward? Or do you just want to publish the change for users?

The branch could be merged into master afterwards to update the changelog and version (required for the update checking feature?). If you do this I think it should be a merge commit not our usual squash merge.

Although I'm not sure if that will help with commit history, I think Github would interleave commits by timestamps, so it would appear after v12 commits have been merged, and even with non-linear history views that show the commit connected to a merge commit, it's not likely to look any better 😅

EDIT:

Ah yeah, so you'd want to merge this into master branch despite that:

VERSION_URL='https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/master/VERSION'
CHANGELOG_URL='https://github.com/docker-mailserver/docker-mailserver/blob/master/CHANGELOG.md'

@polarathene
Copy link
Copy Markdown
Member

polarathene commented Dec 23, 2022

Personally, I don't think it's worth the hassle if we get v12 out early?

You're welcome to go ahead and try tagging the commit if @georglauterbach green lights it as well. I just don't see it providing enough value to do so, looks like it'll risk some confusion or bug reports that we could avoid.

Better to advise using the ENV support to opt-out of update checks until v12 release if it bothers anyone? We can re-open and pin the related bug report until then for other users to be aware of?

@georglauterbach
Copy link
Copy Markdown
Member

Personally, I don't think it's worth the hassle if we get v12 out early?

You're welcome to go ahead and try tagging the commit if @georglauterbach green lights it as well. I just don't see it providing enough value to do so, looks like it'll risk some confusion or bug reports that we could avoid.

I'm very sorry for the inconvenience I've brought up here; but I agree with @polarathene. I don't think it is worth the hassle when we bringt out v12 in January, which is rather likely if you ask me :)
But I'll not be in the way if the proposed solution fixes the issue easily and in a safe manner.

@polarathene
Copy link
Copy Markdown
Member

It was still productive to evaluate how well the project can respond to this sort of thing. In particular for version updates it's a bit problematic due to implementation of the update checking requiring a commit on master related to the version update 😅

The main concern was due to the breaking change introduced to CI image publishing though, so this approach may still be viable in future 👍


I've relayed the decision on the related issue, and re-opened / pinned it, plus revised the initial report (I don't know why the form outputs markdown code fences instead of actual markdown :( )

#2952 (comment)

@casperklein
Copy link
Copy Markdown
Member Author

if the proposed solution fixes the issue easily and in a safe manner.

Alright, before we maybe mess up even more, lets withdraw this. This was just an attempt for an easy quick fix.

I am fine with releasing v12 in January.

@casperklein casperklein deleted the update-changelog-version branch March 13, 2023 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants