Skip to content

Allow --no-tag to overwrite --commit #949

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
beatreichenbach opened this issue Jun 8, 2024 · 11 comments
Open

Allow --no-tag to overwrite --commit #949

beatreichenbach opened this issue Jun 8, 2024 · 11 comments
Labels
confirmed Prevent from becoming stale feature A new feature or a feature request

Comments

@beatreichenbach
Copy link

Description

This is related to the command semantic-release version:

I would like to run semantic-release without tags for this use case where another process creates a tag.
However as described in the documentation --no-tag doesn't apply to the --commit step.

Is there a reason that --no-tag only applies to the tagging step?
Would it be possible for --no-tag to also apply to the --commit step?

Use cases

With the current setup running --commit makes --tag/--no-tag useless as it will never create a tag different from the tag that is created by --commit, is that right? If that's the case, then there shouldn't be anything in the way for us to set it up so that --no-tag also applies to the tag created by --commit.

Possible implementation

I'd be happy of course to create a PR but wanted to check with what you all think.

@beatreichenbach beatreichenbach added the feature A new feature or a feature request label Jun 8, 2024
@codejedi365
Copy link
Contributor

Is there a reason that --no-tag only applies to the tagging step?

It's more of a historic thing that is not evaluated together. I added the --tag/--no-tag because my migration from v7 to v8 was broken while --commit/--no-commit existed already. I personally wanted to just use PSR to stamp the version into my codebase and run the build command and then stop which required --no-commit and --no-tag. Otherwise I had to manually remove the tag (I wasn't releasing yet). I made --tag/--no-tag mirror the commit option and separated the two actions and left commit as it was. I was not an advocate for the use of a version commit so I just left the commit options alone as I was fairly new to the project.

Would it be possible for --no-tag to also apply to the --commit step?

We already have the --push/--no-push action dependent on --tag and --commit so it would probably just be considered at the same point in the code. As for if it should...

With the current setup running --commit makes --tag/--no-tag useless as it will never create a tag different from the tag that is created by --commit, is that right? If that's the case, then there shouldn't be anything in the way for us to set it up so that --no-tag also applies to the tag created by --commit.

Yes, creating a commit with the version identified is kinda silly if you don't end up tagging it. PSR no longer reads commit messages to determine versions, so it would identify the same version from the same set of tags regardless if the last commit was a version commit or not. To be clear though, --commit does NOT create a tag.

To summarize the result:

  • --no-tag implies --no-commit
  • --tag does NOT imply --commit

which means:

Commit Tag Option Result
--commit --tag creates version commit & version tag on commit (default)
--no-commit --tag creates a tag on the last user commit of the branch, no commit made
--commit --no-tag No tag and no commit is made, versions are stamped & build_command executed
--no-commit --no-tag No tag and not commit made, versions are stamped & build_command executed

After writing this, yes I don't think this will cause any problems to have one imply the other, however, I do believe this will be a breaking change when added.

@beatreichenbach
Copy link
Author

Hi @codejedi365,
thank you so much for the detailed explanation. Sorry it took me a while to really grasp everything. I went though the code and made a pull request that I believe in the end actually makes some of these arguments more explicit.

Now it is possible to do really almost anything. It is possible to only create a tag, to only create a commit and to push those independently. The biggest change is really just that we can now create a commit without a tag which can be helpful in some very niche circumstances.

I did mark it with a breaking fix, as it changes the behavior of --commit --no-tag.

@codejedi365 codejedi365 removed the awaiting-reply Waiting for response label Jun 16, 2024
@codejedi365 codejedi365 mentioned this issue Jul 6, 2024
9 tasks
@github-actions github-actions bot added the stale label Sep 15, 2024
@codejedi365 codejedi365 added confirmed Prevent from becoming stale and removed stale labels Sep 15, 2024
@codejedi365
Copy link
Contributor

Looking to implement as part of the v10 release.

Copy link

It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?

@github-actions github-actions bot added the needs-update Needs status update from maintainers label Nov 15, 2024
@codejedi365
Copy link
Contributor

Still in backlog as I haven't done much of the v10 breaking change items yet but getting close

@github-actions github-actions bot removed the needs-update Needs status update from maintainers label Nov 16, 2024
Copy link

It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?

@github-actions github-actions bot added the needs-update Needs status update from maintainers label Jan 16, 2025
@codejedi365
Copy link
Contributor

Still in backlog but getting close to a v10 release so it will be published soon

@github-actions github-actions bot removed the needs-update Needs status update from maintainers label Jan 19, 2025
Copy link

It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?

@github-actions github-actions bot added the needs-update Needs status update from maintainers label Mar 20, 2025
@codejedi365
Copy link
Contributor

Still in backlog

@github-actions github-actions bot removed the needs-update Needs status update from maintainers label Mar 22, 2025
@codejedi365 codejedi365 mentioned this issue Feb 11, 2025
11 tasks
Copy link

It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?

@github-actions github-actions bot added the needs-update Needs status update from maintainers label May 21, 2025
@codejedi365
Copy link
Contributor

Still in backlog

@github-actions github-actions bot removed the needs-update Needs status update from maintainers label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Prevent from becoming stale feature A new feature or a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants