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

Hanging forever while tagging the release if git is configured to sign tags #3065

Open
sheerlox opened this issue Nov 18, 2023 · 6 comments
Open

Comments

@sheerlox
Copy link
Member

sheerlox commented Nov 18, 2023

Description

The release process will hang forever while creating the git tag for the release if git is configured to sign tags.

I tried running the git tag v0.2.0 4d4917b17558245c1046f70f3e6bb73c9ee65a15 command myself and got this warning, so that confirms the git tag command is the issue:

File /home/sherlox/workspace/TALENT_IDEAL/semantic_release_hex_test/.git/TAG_EDITMSG is being edited by sherlox (with VIM 8.2, PID 305634); open anyway?

Cause

The documentation for git tag states:

If one of -a, -s, or -u is passed, the command creates a tag object, and requires a tag message. Unless -m or -F is given, an editor is started for the user to type in the tag message.

Because having tag.gpgsign set to true is equivalent to passing the -s/--sign option to the git command, the command yields a dialog in the background and hangs the process forever.

Possible solutions

See lib/git.js:226.

  1. Force not signing the tags by adding the --no-sign option. Probably isn't a breaking change since signing tags is currently not working. There is already an open PR about this: #1589
  2. Use annotated tags instead of lightweight tags by adding the -m {tagName} option. There are a few discussions about this already (see related issues below). There is also already an open PR about this: #1871

For now, I'll just set tag.gpgsign to false in the repository I need to release manually (which was just for preparing a demo repository for my semantic-release-hex plugin I'm planning to present on the Elixir forum soon).

The annotated tag feature seems to be of interest to a few users, and #1871 looks pretty good overall, so I think we should push it forward sometime in the future.

Related issues

Tags signing

Annotated tags

@sheerlox sheerlox self-assigned this Nov 18, 2023
@sheerlox
Copy link
Member Author

My bad, this belongs to semantic-release, could someone who has the right to please transfer this issue there?

@sheerlox sheerlox changed the title Process hanging forever while creating tag Process hanging forever while creating tag (local run) Nov 18, 2023
@sheerlox
Copy link
Member Author

Adding "-m", tagName, to the git tag options in lib/git.js fixed the issue.

@travi travi transferred this issue from semantic-release/git Nov 19, 2023
@travi
Copy link
Member

travi commented Nov 19, 2023

The hanging seems to come from the git tag command.

could you describe this behavior in a bit more detail and maybe what caused you to notice it? i've never noticed this sort of problem and dont recall anyone else reporting previously. is this when running locally, or within your ci pipeline?

@sheerlox
Copy link
Member Author

I finally identified the root of the issue after you pointed out in #3064 the difference between lightweight and annotated tags.

I have tag.gpgsign set in my .gitconfig, and the git tag documentation states:

If one of -a, -s, or -u is passed, the command creates a tag object, and requires a tag message. Unless -m or -F is given, an editor is started for the user to type in the tag message.

I've tried adding --no-sign to the command in semantic-release, and it solved the issue. I'm updating the original issue description to add more detailed information as well as some initial thoughts on various approaches to solving this.

@sheerlox sheerlox changed the title Process hanging forever while creating tag (local run) Process hanging forever while creating tag if git is configured to sign tags Nov 19, 2023
@sheerlox sheerlox changed the title Process hanging forever while creating tag if git is configured to sign tags Hanging forever while tagging the release if git is configured to sign tags Nov 19, 2023
@sheerlox
Copy link
Member Author

Issue updated ✅

@kennedykori
Copy link

Experiencing the same issue,

kennedykori added a commit to kennedykori/jutils that referenced this issue Jan 23, 2024
Currently, signing tags on the CI using the [@semantic-release/git](https://github.com/semantic-release/git)
plugin leads to the CI hanging indefinitely.

See [this](semantic-release/semantic-release#3065)
issue for more details.
kennedykori added a commit to kennedykori/jutils that referenced this issue Jan 23, 2024
Currently, the use of the [@semantic-release/git](https://github.com/semantic-release/git)
plugin for signing tags in CI causes the process to hang indefinitely.

Refer to [this](semantic-release/semantic-release#3065)
issue for more details.
kennedykori added a commit to kennedykori/jutils that referenced this issue Jan 23, 2024
Currently, the use of the [@semantic-release/git](https://github.com/semantic-release/git)
plugin for signing tags in CI causes the process to hang indefinitely.

Refer to [this](semantic-release/semantic-release#3065)
issue for more details.
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 a pull request may close this issue.

3 participants