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

#361 fixed preCommitText issue with whitespace and fixed failing unit… #381

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

peetkes
Copy link

@peetkes peetkes commented Jun 30, 2023

…Test for GitReleasePluginTests

…failing unitTest for GitReleasePluginTests
@@ -130,7 +130,8 @@ class GitReleasePluginTests extends Specification {
executor.exec(['git', 'checkout', 'myBranch'], failOnStderr: false, directory: remoteRepo, env: [:])
executor.exec(['git', 'reset', '--hard', 'HEAD'], failOnStderr: false, directory: remoteRepo, env: [:])
then:
newestCommit.contains("Signed-off-by: Unit Test <unit@test>")
// newestCommit.contains("Signed-off-by: Unit Test <unit@test>")
newestCommit.contains("[Gradle Release Plugin] - new version commit: '1.1'")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This renders the test useless. The point is, that it tests whether the -s is given to Git and thus the Signed-off-by line added.
Here this also works just fine.

Comment on lines +211 to +214
preCommitText = '[Gradle Release Plugin]'
preTagCommitMessage = 'pre tag commit: '
tagCommitMessage = 'creating tag: '
newVersionCommitMessage = 'new version commit: '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good idea.
This changes the result for everyone setting the preCommitText already which is a text that should be prepended additionally to the other configured messages.

@@ -22,8 +22,8 @@ class PreTagCommit extends BaseReleaseTask {
if (projectAttributes.usesSnapshot || projectAttributes.versionModified || projectAttributes.propertiesFileCreated) {
// should only be committed if the project was using a snapshot version.
String message = extension.preTagCommitMessage.get() + " '${tagName()}'."
if (extension.preCommitText) {
message = "${extension.preCommitText.get()} ${message}"
if (extension.preCommitText.get()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only line in the PR that I would second, as it also is the same I did in #384 not seeing this PR. :-D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which was merged just now, so my recommendation would be to close this PR unmerged. :-)

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