Skip to content
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

Setting changelog-type to "github" results in a new release on any type of commit #2096

Closed
bodgit opened this issue Oct 13, 2023 · 3 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@bodgit
Copy link

bodgit commented Oct 13, 2023

Environment details

  • OS: LInux
  • Node.js version: n/a
  • npm version: n/a
  • release-please version: Using v3 of the release-please-action so whatever version is used there.

Steps to reproduce

See #2078 for the background. I found that with any type of commit/merged PR, release-please was generating a new release, even for just chore commits, which I thought shouldn't happen.

My release-please-config.json was originally this:

{
  "changelog-type": "github",
  "packages": {
    ".": {
      "release-type": "go",
      "extra-files": [
        "README.md",
        "main.go"
      ]
    }
  }
}

I had added the changelog-type setting to see what the difference was in the generated changelog, removing it so my release-please-config.json looks like this:

{
  "packages": {
    ".": {
      "release-type": "go",
      "extra-files": [
        "README.md",
        "main.go"
      ]
    }
  }
}

And now normal behaviour is restored.

@bodgit bodgit added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Oct 13, 2023
@stutommi
Copy link

stutommi commented Oct 23, 2023

I'm puzzled by the same issue, I can see that with the configuration (below), seems like atleast commits starting with "chore:" and "docs:" (and probably all the others aswell, haven't tested) result in release-please action generating patch bumps:

name: release-please
on:
  push:
    branches:
      - main

permissions:
  contents: write
  pull-requests: write

jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: google-github-actions/release-please-action@v3
        with:
          token: ${{ secrets.MY_TOKEN }}
          release-type: go
          bump-minor-pre-major: true
          changelog-types: >
            [
              { "type": "build", "section": "Build System", "hidden": false },
              { "type": "ci", "section": "Continuous Integration", "hidden": false },
              { "type": "chore", "section": "Miscellaneous Chores", "hidden": false },
              { "type": "docs", "section": "Documentation", "hidden": false },
              { "type": "feat", "section": "Features", "hidden": false },
              { "type": "fix", "section": "Bug Fixes", "hidden": false },
              { "type": "perf", "section": "Performance Improvements", "hidden": false },
              { "type": "revert", "section": "Reverts", "hidden": false },
              { "type": "refactor", "section": "Code Refactoring", "hidden": false },
              { "type": "style", "section": "Styles", "hidden": false },
              { "type": "test", "section": "Tests", "hidden": false }
            ]

@stutommi
Copy link

I dug through the code how changelog-types swim in the code logic, and found out that it seems to be currently working as expected. Every type that is not marked as hidden will be treated as conventional commit and all of them will be treated as patch upgrade at the minimum.

Sorry @bodgit, I didn't have time to check changelog-type and how that goes. Just stating here that my confusion seems to be expected behavior (although don't really know if it's considered good design or well documented).

@chingor13
Copy link
Contributor

If you use the GitHub changelog type, it defers building the changelog to GitHub's logic which ignores any changelog-types configuration.

chingor13 added a commit to googleapis/release-please-action that referenced this issue Nov 6, 2023
…844)

<!--
Thank you for proposing a pull request! Please note that SOME TESTS WILL
LIKELY FAIL due to how GitHub exposes secrets in Pull Requests from
forks.
Someone from the team will review your Pull Request and respond.

Please describe your change and any implementation details below.
-->
Relating to [release-please
issue](googleapis/release-please#2096)

I was surprised that adding different changelog types result in patch
version bumps. I wasn't expecting this but going through the code it
seemed to be expected but undocumented behavior.

And this is why I would like to document the behavior here so other
people know and can plan whether to use it or not.

cheers!

---------

Signed-off-by: Tommi Tampio <46082658+stutommi@users.noreply.github.com>
Co-authored-by: Jeff Ching <chingor@google.com>
@chingor13 chingor13 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants