8000 feat!: Streamline the release process for Jekyll by mattr- · Pull Request #9760 · jekyll/jekyll · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat!: Streamline the release process for Jekyll #9760

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mattr-
Copy link
Member
@mattr- mattr- commented Jan 27, 2025

This is a 🙋 feature or enhancement.
This is a 🔨 code refactoring.

Summary

Improve and streamline our release processes with some extra automation and a bit more rigor around PRs/commits.

Context

With Jekyll 4.4 released, and under the assumption that the next release will indeed be 5.0, I think it makes a lot of sense to take some time and evaluate our development practices and streamline the process of shipping. We generally go a long time (four months between 4.3.4 and 4.4.0, two years between 4.3.0 and 4.4.0) between releases and this is my attempt at trying to improve that. While this PR is currently incomplete, if there's interest in going this direction, I'll make time over the next few days to clean it up and get it ready to actually ship.

In order to do this, I'm relying on the release-please action from Google to do the majority of the heavy lifting. Please read the release-please README in order to learn how release-please works and what it does. In order to make it easier to adopt release-please, I've made two additional changes. The first is to rename History.markdown to CHANGELOG.md since that's what release-please works with out of the box. The other is to add two new github actions workflows to run release-please and to enforce conventional commit conventions on PR titles. Because we squash merge, the PR title becomes the commit message and release-please uses the commit messages to know when to bump the version number.

One potential caveat with this is that it may become harder to maintain stable branches. My point of view on this is that we've done a relatively poor job of maintaining them regardless and I think it's more important to release often, even if we end up bumping major or minor version numbers more frequently than before. My stance on this is that version bumps have no inherent goodness or badness. They are a communication mechanism. We should let go of having to wait a certain amount of time to do major version bumps or avoid work because it would cause a major version bump, for example.

Process changes

The use of release-please means that we can stop using jekyllbot to do the merges and update History.markdown for us, as it will take care of that. We will also no longer need labels on PRs as the use of conventional commits will explain exactly what is changing.

The process for releasing becomes:

  • Merge the docs PR
  • Merge the automatically generated release-please PR, which will trigger the workflows to do the tagging, releasing, gem publishing, etc.

Remaining work to do:

  • Change the pull request settings to only allow squash merges, as jekyllbot enforces this for us today.
  • Update the site publishing process to pull from CHANGELOG.md instead of History.markdown No longer needed.
  • Integrate jekyllbot into release-please (the release-please PRs will be made by jekyllbot). This allows actions to be triggered on the release-please PRs.
  • Test the workflows to make sure they generate a PR correctly.
  • Integrate the release publishing workflow into release-please when it creates a release. Happens automatically with the existing workflows.

@ashmaroli
Copy link
Member

Hello Matt,

I have not yet completely processed this proposal but I would like to leave a few comments based on superficial understanding:

  • I am not yet entirely clear on the motivation behind this. Is it that we don't ship Jekyll releases as frequently like in the ol' days or is it how our History / changelog document is structured that the maintainer executing the release has to manually decide (whether a commit was correctly triaged as a bug-fix / correction / enhancement / breaking-change) at the time of release?
  • I am not entirely in favor of yielding control to a third-party application, (release-please action in this case), mainly because it means we will have to play by their rules. Why can't we simply upgrade JekyllBot do whatever is necessary instead?
  • Labelling is a form of quick visual communication. I am not in favor of ditching those and only infer intent from conventional commit messages.
  • It feels like JekyllBot is gradually being phased-out, onto retirement :p
  • Regardless, I wo 8000 uld like to see how this plays out in a real scenario. I suggest that you first implement this process at our repo jekyll/jekyll-test-gem-plugin, make dummy commits, publish dummy releases (and gems), and then port the final implementation to repo jekyll/jekyll.

P.S. Renaming History.markdown (should it be accepted) warrants a likewise change to our Rakefile as well.


My point of view on this is that we've done a relatively poor job of maintaining [stable branches]

I am quite surprised by this perspective. Could you please elaborate on why you feel so and how those branches should have been maintained?

@mattr-
Copy link
Member Author
mattr- commented Jan 28, 2025

I am not yet entirely clear on the motivation behind this. Is it that we don't ship Jekyll releases as frequently like in the ol' days or is it how our History / changelog document is structured that the maintainer executing the release has to manually decide (whether a commit was correctly triaged as a bug-fix / correction / enhancement / breaking-change) at the time of release?

Parts of all of that are true. I'd like to see us release more frequently. I'd like users to have more visibility into what the next release might be and have a central place to talk about why we haven't released yet. As a maintainer, I'd like to not have to think about what the next release might be, when with a small set of tweaks, the computer can do that for me. I think the structure of the history / changelog is fine. I do want better management of it, which I feel like release-please gives us by using the PR to update the changelog rather than jekyllbot coming through and updating it after every single merge.

I am not entirely in favor of yielding control to a third-party application, (release-please action in this case), mainly because it means we will have to play by their rules. Why can't we simply upgrade JekyllBot do whatever is necessary instead?

release-please, both the CLI and the action, are open-source under the Apache 2.0 license. I don't see a reason to keep maintaining our own code for this when it can be replaced by code someone else maintains that is also open source. This feels similar to saying that you have to write your own http client because you don't want to use a third-party library because you don't like their API.

Re: upgrading jekyllbot, i'll address that next.

It feels like JekyllBot is gradually being phased-out, onto retirement :p

That is exactly right. When the platform offers features that are just as good or better than maintaining our own code for something, I'm going to go with the platform every single time. The jekyllbot user still has tremendous value for us, but most of things jekyllbot does for us can now be done natively in GitHub, mostly with Actions.

Labelling is a form of quick visual communication. I am not in favor of ditching those and only infer intent from conventional commit messages.

I can keep the labelling. That's not a problem. It will be inferred from the PR title via conventional commits though.

Regardless, I would like to see how this plays out in a real scenario. I suggest that you first implement this process at our repo jekyll/jekyll-test-gem-plugin, make dummy commits, publish dummy releases (and gems), and then port the final implementation to repo jekyll/jekyll.

This is a good idea. I'll do more experimentation and implementation there before coming back to update this PR.

My point of view on this is that we've done a relatively poor job of maintaining [stable branches]

I am quite surprised by this perspective. Could you please elaborate on why you feel so and how those branches should have been maintained?

This is based on the fact that 4.4.0 contains double the number of bugfixes in the 4.3.x release series. Not to mention the toil of having to backport fixes and run releases for stable branches. Maintaining stable branches is extra work. If we don't violate semver in minor versions, why should we try so hard to maintain them?

@ashmaroli
Copy link
Member

I don't see a reason to keep maintaining our own code for this when it can be replaced by code someone else maintains that is also open source.

Not a strong argument in favour of my comment about having to play by their rules, but we need not have to switch to enforcing Conventional Commits if JekyllBot would be able to replicate the end-result of release-please handling changelog management via a single persisting pull-request. That said, I am not proficient in GoLang to even consider submitting a POC towards upgrading JekyllBot codebase. So......

most of things jekyllbot does for us can now be done natively in GitHub, mostly with Actions.

The downside I see regarding this is the time taken for GitHub Actions to execute the workflow (download action code > repository checkout > install dependencies > Run action) in contrast to JekyllBot finishing the action as soon as the underlying webhook is dispatched. But yes, it's just a matter of getting used to the new normal.

This is based on the fact that 4.4.0 contains double the number of bugfixes in the 4.3.x release series.

The reason for this is that there weren't enough changes to warrant shipping a 4.4.0 at the time 4.3.2 - 4.3.4 were shipped, at the same time master had changes that can only be considered for a Semver-minor-bump. So, shipping 4.3.x via the stable branches allowed providing beneficial patches to our users at an earlier time.

Maintaining stable branches is extra work. If we don't violate semver in minor versions, why should we try so hard to maintain them?

Sometimes UX-critical patches are merged only after the master branch has already acquired minor-version-bump worthy commits yet not enough of those for a release in the immediate future. (I agree that this is a non-ideal stance).

mattr- added a commit to jekyll/jekyll-test-gem-plugin that referenced this pull request Jan 30, 2025
As part of jekyll/jekyll#9760, I'm using this repo as a testbed for
streamlining automation.

The first step is to lint PR titles against the conventional commit spec
so that the release-please automation can do its work.
@mattr-
Copy link
Member Author
mattr- commented Jan 30, 2025

Going to dump updates here as I work on this:

Enforcing conventional commits at the PR level looks like so when the check fails:
PR check that failed when the PR title doesn't match the conventional commit format

It goes green if the format is correct (obviously 😄 )
PR check that succeeds when the PR title matches the conventional commit format

@jekyll jekyll deleted a comment from badbihh48 Jan 31, 2025
@mattr-
Copy link
Member Author
mattr- commented Feb 5, 2025

jekyll/jekyll-test-gem-plugin#8 has an example of the release-please workflow running. We can keep the existing History.markdown file, though it's format changes slightly.

We can keep the `History.markdown` file after all, if we're ok with the
small format differences.

This reverts commit f15a991.
Taking the lessons learned from doing this several times recently, here
are some changes/enhancements:
 - Keep History.markdown, as we can still use it.
 - Configure release-please via JSON, hiding the config away in the
   .github directory
 - Configure the release manifest so that release-please will pick the next best
   current release. release-please uses this for its own internal
   bookkeeping as well.
 - Remove a bunch of cruft from the workflow file that isn't needed. We
   don't need to check out the repo or set up node. Just run the
   release-please action with the correct configuration.
@ashmaroli
Copy link
Member

We can keep the existing History.markdown file, though it's format changes slightly.

For documentation / record purposes, could you please list all the changes? (This will help refactoring / altering our rake task used to generate docs/_docs/history.md in a future pull request)

@ashmaroli
Copy link
Member

Suggestions / Requests:

  • Move .github/release-please-*.json config and manifest to .github/release-please/*.json ?
  • Automated PR title to remain Release :gem: v${version}. (Skip conventional commit check on this commit) ?
  • Rename conventional commit enforce workflow name and job to Conventional Commit Check and commit_lint respectively ?
  • Rename release-please workflow name to Release, please! (since we're not releasing pleases 😛) ?

@mattr-
Copy link
Member Author
mattr- commented Feb 7, 2025

Move .github/release-please-.json config and manifest to .github/release-please/.json ?

I'm curious about this one. Why is that important to you?

Automated PR title to remain Release 💎 v${version}. (Skip conventional commit check on this commit) ?

AFAIK, that's not possible because of release-please's reliance on conventional commits. It won't know how to treat the release PR.

Rename conventional commit enforce workflow name and job to Conventional Commit Check and commit_lint respectively ?

Just to clarify, you want to see Conventional Commit Check / commit_lint in the merge box in place of what's there in the screenshot below?

image

If so, yeah, I can do that. Not particularly hung up on the names here.

Rename release-please workflow name to Release, please! (since we're not releasing pleases 😛) ?

hahahahaha, sure. i like that better. It's like there's some exasperation or something to go along with it.

@ashmaroli
Copy link
Member

Move .github/release-please-*.json config and manifest to .github/release-please/*.json ?

I'm curious about this one. Why is that important to you?

Not Important per se. I prefer having things organized into folders if those things share a singular yet common purpose.

Automated PR title to remain Release 💎 v${version}. (Skip conventional commit check on this commit) ?

AFAIK, that's not possible because of release-please's reliance on conventional commits. It won't know how to treat the release PR.

That's exactly the intention. Maintain existing pattern for release commits and simultaneously have it excluded from being logged as a chore in the History.markdown. (Again, not important; Nitpicking)

Just to clarify, you want to see Conventional Commit Check / commit_lint in the merge box in place of what's there in the screenshot below?

Yes, that's correct.

Rename release-please workflow name to Release, please! (since we're not releasing pleases 😛) ?

hahahahaha, sure. i like that better. It's like there's some exasperation or something to go along with it.

😆

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.

2 participants
0