Repository navigation
Bump failing after commitizen upgrade to 2.21.0 #19
Copy link
Copy link
Closed
Description
When commitizen was upgraded to 2.21.0, my job started to fail with No tag found to do an incremental changelog. Here are the logs from the workflow:
Run commitizen-tools/commitizen-action@master
with:
github_token: ***
changelog_increment_filename: body.md
branch: main
commit: true
push: true
changelog: true
git_name: github-actions[bot]
git_email: github-actions[bot]@users.noreply.github.com
/usr/bin/docker run --name db2d75cd135537dca42949a8bba04dc640a1c_2a63e9 --label 7db2d7 --workdir /github/workspace --rm -e INPUT_GITHUB_TOKEN -e INPUT_CHANGELOG_INCREMENT_FILENAME -e INPUT_BRANCH -e INPUT_DRY_RUN -e INPUT_COMMIT -e INPUT_PUSH -e INPUT_PRERELEASE -e INPUT_CHANGELOG -e INPUT_REPOSITORY -e INPUT_EXTRA_REQUIREMENTS -e INPUT_GIT_NAME -e INPUT_GIT_EMAIL -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/dialexa-python-cookiecutter/dialexa-python-cookiecutter":"/github/workspace" 7db2d7:5cd135537dca42949a8bba04dc640a1c
Repository: datanrd/dialexa-python-cookiecutter
Actor: datanrd
Installing requirements...
WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting commitizen
Downloading commitizen-2.21.0-py3-none-any.whl (44 kB)
Collecting termcolor<2.0,>=1.1
Downloading termcolor-1.1.0.tar.gz (3.9 kB)
Collecting jinja2>=2.10.3
Downloading Jinja2-3.0.3-py3-none-any.whl ([13](https://github.com/datanrd/dialexa-python-cookiecutter/runs/5259326201?check_suite_focus=true#step:4:13)3 kB)
Collecting pyyaml>=3.08
Downloading PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (701 kB)
Collecting questionary<2.0.0,>=1.4.0
Downloading questionary-1.10.0-py3-none-any.whl (31 kB)
Collecting decli<0.6.0,>=0.5.2
Downloading decli-0.5.2-py3-none-any.whl (7.7 kB)
Collecting packaging<22,>=19
Downloading packaging-21.3-py3-none-any.whl (40 kB)
Collecting colorama<0.5.0,>=0.4.1
Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting typing-extensions<5.0.0,>=4.0.1
Downloading typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Collecting argcomplete<2.0.0,>=1.12.1
Downloading argcomplete-1.12.3-py2.py3-none-any.whl (38 kB)
Collecting tomlkit<1.0.0,>=0.5.3
Downloading tomlkit-0.10.0-py3-none-any.whl (33 kB)
Collecting MarkupSafe>=2.0
Downloading MarkupSafe-2.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux20[14](https://github.com/datanrd/dialexa-python-cookiecutter/runs/5259326201?check_suite_focus=true#step:4:14)_x86_64.whl (25 kB)
Collecting pyparsing!=3.0.5,>=2.0.2
Downloading pyparsing-3.0.7-py3-none-any.whl (98 kB)
Collecting prompt_toolkit<4.0,>=2.0
Downloading prompt_toolkit-3.0.28-py3-none-any.whl (380 kB)
Collecting wcwidth
Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Building wheels for collected packages: termcolor
Building wheel for termcolor (setup.py): started
Building wheel for termcolor (setup.py): finished with status 'done'
Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4848 sha256=798398deb6ba012869b562e9e66ba52d214a099d0cf6132f1ff269d81104ce27
Stored in directory: /tmp/pip-ephem-wheel-cache-5mm7a4mv/wheels/a0/[16](https://github.com/datanrd/dialexa-python-cookiecutter/runs/5259326201?check_suite_focus=true#step:4:16)/9c/5473df82468f958445479c59e784896fa24f4a5fc024b0f501
Successfully built termcolor
Installing collected packages: wcwidth, pyparsing, prompt-toolkit, MarkupSafe, typing-extensions, tomlkit, termcolor, questionary, pyyaml, packaging, jinja2, decli, colorama, argcomplete, commitizen
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Successfully installed MarkupSafe-2.1.0 argcomplete-1.12.3 colorama-0.4.4 commitizen-2.[21](https://github.com/datanrd/dialexa-python-cookiecutter/runs/5259326201?check_suite_focus=true#step:4:21).0 decli-0.5.2 jinja2-3.0.3 packaging-21.3 prompt-toolkit-3.0.28 pyparsing-3.0.7 pyyaml-6.0 questionary-1.10.0 termcolor-1.1.0 tomlkit-0.10.0 typing-extensions-4.1.1 wcwidth-0.2.5
WARNING: You are using pip version 21.2.4; however, version [22](https://github.com/datanrd/dialexa-python-cookiecutter/runs/5259326201?check_suite_focus=true#step:4:22).0.3 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Commitizen version:
2.21.0
Configuring git user and email...
Git name: github-actions[bot]
Git email: github-actions[bot]@users.noreply.github.com
Running cz: --changelog
bump: version 0.1.0 → 0.1.1
tag to create: 0.1.1
increment detected: PATCH
No tag found to do an incremental changelog
When running cz bump --yes --changelog locally it completes without error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
floredelasteyrie commentedon Feb 21, 2022
I'm having the same issue.
Also, it's a problem that it breaks existing CIs in which I have fixed the version - which worked fine until the underlying package changed.
Using the action:
Logs from my failing workflow:
woile commentedon Feb 21, 2022
That's very strange, gonna take a look, thanks for reporting!
woile commentedon Feb 21, 2022
Could you share some samples of the commits that are not being detected?
thanks!
floredelasteyrie commentedon Feb 21, 2022
I think I didn't give enough details, sorry about that !
For my part the problem isn't that the commit isn't detected, but rather that now the action fails for a specific case when before it didn't :)
So
featorfixcommits work fine, butciorperfcommits make the whole CI fail.I solved it for the moment by using
continue-on-error: truein my workflow, but I'm afraid of the other errors this could lead to.I assume it's due to this patch : commitizen-tools/commitizen#473
But the fact that the version of the action (v0.11.0) can use different package versions is a problem - shouldn't we choose to update the action to use a new version of Commitizen ?
woile commentedon Feb 21, 2022
I think we could make the action point to
latestby default, or manually enter the version.I think the problem here is that I introduced a change that I didn't think was gonna break commitizen.
It should've been a major release if I had known better, I apologise for that 🙏🏻
woile commentedon Feb 21, 2022
I've created a PR to introduce the version, if you could review I'd appreciate
#20
floredelasteyrie commentedon Feb 21, 2022
Great idea to be able to manually enter the version while keeping the original
latestby default :)Thanks a lot for the quick fix ! I looked at the PR and added a comment - I'm not very familiar with the codebase but can review if needed !
datanrd commentedon Mar 2, 2022
@floredelasteyrie I've proposed another option in #21 that may be useful to your situation as well.
woile commentedon Mar 7, 2022
New changes to revert back the version were introduced already in this action.
I'm working on this PR as well: commitizen-tools/commitizen#489 which I'll then integrate into this action
woile commentedon Apr 29, 2022
Please review #25 it should solve the issue and bring back functionality
Kurt-von-Laven commentedon May 19, 2022
@datanrd,
No tag found to do an incremental changelogsuggests to me that you may have started doing a sparse checkout by failing to passfetch-depth: 0toactions/checkout. A sparse checkout does not include tags, so Commitizen cannot do its job.adam-grant-hendry commentedon Oct 7, 2022
@woile Is this not fixed yet? I am having the same issue on:
commitizen:
2.35.0commitizen-tools/commitizen-action:
0.15.0woile commentedon Oct 7, 2022
What happens if you do
git tagin the CI? Does any version appear?adam-grant-hendry commentedon Oct 7, 2022
@Kurt-von-Laven @woile I'm not thinking; I'm sorry. I need
fetch-depthto checkout the last version tag, not the new one I'm trying to create.Kurt-von-Laven commentedon Oct 7, 2022
Yeah, and just to be clear for the sake of anyone following this thread, my understanding is that passing
fetch-depth: nfor any value ofnother than0, retrieves no tags at all since you are still doing a sparse checkout.adam-grant-hendry commentedon Oct 7, 2022
@woile @Kurt-von-Laven How can I push without triggering CI? GitHub supports adding a comment to the commit message, like
[skip ci]that will skip CI.Can I do this somehow with the
commitizen-action?adam-grant-hendry commentedon Oct 7, 2022
@Kurt-von-Laven @woile I suppose for now, I can add
to the beginning of those workflow jobs I don't want to run when this happens.
Just wondering if there's another way to do this?
woile commentedon Oct 7, 2022
You could customize the bump commit message to include skip ci and use that condition with skip ci instead of
bump:adam-grant-hendry commentedon Oct 7, 2022
@woile How do you customize the message from within a GitHub Actions workflow?
Kurt-von-Laven commentedon Oct 7, 2022
Do the official Commitizen docs answer your question?
adam-grant-hendry commentedon Oct 7, 2022
No because that gives you general information about how to customize all commit messages, but we would need to customize the message to have a comment if the
bump:is in the message.This probably involves some form of a regular expression I'm sure...
Kurt-von-Laven commentedon Oct 7, 2022
Oh, I see your point. Maybe this is a feature request for commitizen-tools/commitizen in that case? @woile will know better than I though.
adam-grant-hendry commentedon Oct 7, 2022
No worries at all. I'm sure I could figure it out if I devoted more time to it, but it's more time than I have to commit at the given moment. It would be nice as an example added to the documentation, so a feature request sounds appropriate.
adam-grant-hendry commentedon Oct 7, 2022
@Kurt-von-Laven @woile I need to
I'm trying to figure out how to do this. I'm not able to update a release once it's created, but I'm also not finding a way to pass
${{ env.REVISION }}from the bump version step to the release step (${{ github.ref_name }}ismainfor me, not my tag).How can I achieve this?
adam-grant-hendry commentedon Oct 7, 2022
@Kurt-von-Laven @woile nvm, I figured it out. I had to use your repo plus
https://github.com/ncipollo/release-action. See this runmetya commentedon Feb 27, 2023
Any news about the issue?
I have the same problem and don't know how to fix.
Kurt-von-Laven commentedon Feb 28, 2023
@metya, are you already passing
fetch-depth: 0to actions/checkout? I'm actually not sure why this issue is still open. @woile, did you envision some further change beyond #20 and #25?@adam-grant-hendry, I recently learned of semantic-release, which may be helpful to you or others in the future with more complex use cases.
woile commentedon Feb 28, 2023
No, it should've been closed. @metya this ticket discusses multiple different problems, please open a new issue with your problem and provide more information.
In github actions if you use the
GITHUB_TOKEN, it behaves as using[skip-ci].If you need to add
[skip-ci]it won't solve anything in github actions, because it doesn't care about it. But you can add it by using:Alternatively, you can skip a commit in github actions using:
see commitizen action
If you need to make a release, look at commitizen's documentation
I'm closing this as it's off-topic, please open new issues for other problems