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

fileUpdate hook does not respect encoding #490

Closed
dzikoysk opened this issue Jun 8, 2022 · 20 comments
Closed

fileUpdate hook does not respect encoding #490

dzikoysk opened this issue Jun 8, 2022 · 20 comments

Comments

@dzikoysk
Copy link
Contributor

dzikoysk commented Jun 8, 2022

Hooks applied to files (like e.g. README) with e.g. emojis replace content with question marks:

obraz

I also don't see any possibility to change the encoding in configuration:

@bgalek
Copy link
Member

bgalek commented Jun 8, 2022

Hi @dzikoysk, we should fix this, do you want to make a PR?

@bgalek
Copy link
Member

bgalek commented Jun 8, 2022

also, what java version are you using? (I'm asking to see if maybe you're stuck with something other than at least utf-8)

bgalek added a commit that referenced this issue Jun 8, 2022
@bgalek
Copy link
Member

bgalek commented Jun 8, 2022

@dzikoysk check out https://github.com/allegro/axion-release-plugin/pull/491/files :)

@dzikoysk
Copy link
Contributor Author

dzikoysk commented Jun 8, 2022

also, what java version are you using? (I'm asking to see if maybe you're stuck with something other than at least utf-8)

The minimal JDK version is 11, but I'm running the task on 17.

Hmm I'll take a look on that tomorrow, to be honest, I got stuck trying to configure gpg signed commits. It's my first attemp to release a new version using axios-release plugin 😬

@bgalek
Copy link
Member

bgalek commented Jun 8, 2022

sure, you can check this repository workflows and build.gradle for inspirations ;)

@dzikoysk
Copy link
Contributor Author

dzikoysk commented Jun 8, 2022

Can I somehow run this test without configuring the authentication part of axios? :)

Stacktrace
$ :integrationTest --tests "pl.allegro.tech.build.axion.release.SimpleIntegrationTest.should update file in pre release hook"

> Task :compileGroovy
Note: P:\OpenSource\axion-release-plugin\src\main\java\pl\allegro\tech\build\axion\release\domain\hooks\CommitHookAction.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :compileKotlin
w: P:\OpenSource\axion-release-plugin\src\main\kotlin\pl\allegro\tech\build\axion\release\domain\KotlinDslExtensions.kt: (87, 54): Parameter 'previousVersion' is never used, could be renamed to _
w: P:\OpenSource\axion-release-plugin\src\main\kotlin\pl\allegro\tech\build\axion\release\domain\KotlinDslExtensions.kt: (87, 71): Parameter 'context' is never used, could be renamed to _
w: P:\OpenSource\axion-release-plugin\src\main\kotlin\pl\allegro\tech\build\axion\release\domain\KotlinDslExtensions.kt: (88, 58): Parameter 'currentVersion' is never used, could be renamed to _
w: P:\OpenSource\axion-release-plugin\src\main\kotlin\pl\allegro\tech\build\axion\release\domain\KotlinDslExtensions.kt: (88, 74): Parameter 'context' is never used, could be renamed to _
> Task :compileJava NO-SOURCE
> Task :pluginDescriptors
> Task :processResources
> Task :classes
> Task :compileTestKotlin NO-SOURCE
> Task :compileTestJava NO-SOURCE
> Task :compileTestGroovy
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :compileIntegrationKotlin NO-SOURCE
> Task :compileIntegrationJava NO-SOURCE
> Task :compileIntegrationGroovy
> Task :processIntegrationResources NO-SOURCE
> Task :integrationClasses
> Task :pluginUnderTestMetadata
> Task :integrationTest
cze 09, 2022 1:29:45 AM org.junit.platform.launcher.core.EngineDiscoveryOrchestrator lambda$logTestDescriptorExclusionReasons$7
INFO: 0 containers and 6 tests were Method or class mismatch

Unexpected build execution failure in C:\Users\dzikoysk\AppData\Local\Temp\spock_should_update_file__0_temporaryFolder8739600586323546812 with arguments [release, -Prelease.version=1.0.0, -Prelease.localOnly, -Prelease.disableChecks, -s]

Output:

> Task :verifyRelease
Skipping uncommitted changes check
Skipping ahead of remote check
Skipping snapshot dependencies check

> Task :release FAILED
Replacing pattern "0.1.0" with "1.0.0" in C:\Users\dzikoysk\AppData\Local\Temp\spock_should_update_file__0_temporaryFolder8739600586323546812\version-file

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':release'.
> Failed to parse secret key file C:\Users\dzikoysk\.gnupg\private-keys-v1.d\E79F224BACA9012E6F69F7D167947B810C7BBCBC.key. Is the entered passphrase correct?

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':release'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$3(ExecuteActionsTaskExecuter.java:186)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:268)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:411)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:398)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:391)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:377)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.eclipse.jgit.api.errors.JGitInternalException: Failed to parse secret key file C:\Users\dzikoysk\.gnupg\private-keys-v1.d\E79F224BACA9012E6F69F7D167947B810C7BBCBC.key. Is the entered passphrase correct?
	at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgSigner.signObject(BouncyCastleGpgSigner.java:211)
	at org.eclipse.jgit.api.CommitCommand.sign(CommitCommand.java:294)
	at org.eclipse.jgit.api.CommitCommand.call(CommitCommand.java:247)
	at pl.allegro.tech.build.axion.release.infrastructure.git.GitRepository.commit(GitRepository.java:217)
	at pl.allegro.tech.build.axion.release.domain.scm.ScmService.commit(ScmService.java:56)
	at pl.allegro.tech.build.axion.release.domain.hooks.HookContext.commit(HookContext.java:65)
	at pl.allegro.tech.build.axion.release.domain.hooks.CommitHookAction.act(CommitHookAction.java:20)
	at pl.allegro.tech.build.axion.release.domain.hooks.ReleaseHooksRunner.lambda$runPreReleaseHooks$0(ReleaseHooksRunner.java:25)
	at pl.allegro.tech.build.axion.release.domain.hooks.ReleaseHooksRunner.runPreReleaseHooks(ReleaseHooksRunner.java:25)
	at pl.allegro.tech.build.axion.release.domain.Releaser.release(Releaser.java:34)
	at pl.allegro.tech.build.axion.release.domain.Releaser.releaseAndPush(Releaser.java:49)
	at pl.allegro.tech.build.axion.release.domain.Releaser$releaseAndPush.call(Unknown Source)
	at pl.allegro.tech.build.axion.release.ReleaseTask.release(ReleaseTask.groovy:24)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:494)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:479)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:462)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$400(ExecuteActionsTaskExecuter.java:105)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:273)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:251)
	at org.gradle.internal.execution.steps.ExecuteStep.lambda$executeOperation$1(ExecuteStep.java:66)
	at org.gradle.internal.execution.steps.ExecuteStep.executeOperation(ExecuteStep.java:66)
	at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:34)
	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:47)
	at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:44)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
	at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:34)
	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:72)
	at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:42)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:53)
	at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:39)
	at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:44)
	at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:77)
	at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:58)
	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:54)
	at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:32)
	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:57)
	at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:38)
	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:63)
	at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:30)
	at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:176)
	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:76)
	at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:47)
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:43)
	at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:32)
	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:39)
	at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:25)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:102)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:95)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
	at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:83)
	at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:44)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:96)
	at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:52)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:83)
	at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:54)
	at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:88)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:88)
	at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
	at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:46)
	at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:34)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:43)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$3.withWorkspace(ExecuteActionsTaskExecuter.java:286)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:43)
	at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:33)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:40)
	at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:30)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:54)
	at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:40)
	at org.gradle.internal.execution.impl.DefaultExecutionEngine.rebuild(DefaultExecutionEngine.java:46)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$0(ExecuteActionsTaskExecuter.java:182)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:182)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:411)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:398)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:391)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:377)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.bouncycastle.openpgp.PGPException: Failed to parse secret key file C:\Users\dzikoysk\.gnupg\private-keys-v1.d\E79F224BACA9012E6F69F7D167947B810C7BBCBC.key. Is the entered passphrase correct?
	at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyLocator.findSecretKeyForKeyBoxPublicKey(BouncyCastleGpgKeyLocator.java:487)
	at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyLocator.findSecretKey(BouncyCastleGpgKeyLocator.java:366)
	at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgSigner.locateSigningKey(BouncyCastleGpgSigner.java:120)
	at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgSigner.signObject(BouncyCastleGpgSigner.java:146)
	... 132 more
Caused by: org.bouncycastle.openpgp.PGPException: missing credentials provider
	at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyPassphrasePrompt.getPassphrase(BouncyCastleGpgKeyPassphrasePrompt.java:85)
	at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyLocator.lambda$0(BouncyCastleGpgKeyLocator.java:483)
	at org.eclipse.jgit.gpg.bc.internal.keys.SecretKeys.readSecretKey(SecretKeys.java:144)
	at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyLocator.attemptParseSecretKey(BouncyCastleGpgKeyLocator.java:153)
	at org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgKeyLocator.findSecretKeyForKeyBoxPublicKey(BouncyCastleGpgKeyLocator.java:482)
	... 135 more


* Get more help at https://help.gradle.org

BUILD FAILED in 4s
2 actionable tasks: 2 executed

Looks like this lookup is trying to use some secrets from ~/.gnugp directory, so I guess there is no like a dedicated auth config for test scenarios and it just depends on user's setup? Tbh it's the same error I have in my project during an attemp to configure the auth, even if I try to specify custom key it's trying to use those from .gpgng. In general I use Git Bash for Windows, I guess it might be related.

@bgalek
Copy link
Member

bgalek commented Jun 8, 2022

yeah it looks like some kind of problem with test setup that somehow tries to use your global .gitconfig (where I assume you have gpg provider configured?)

@dzikoysk
Copy link
Contributor Author

dzikoysk commented Jun 9, 2022

Well, I have a standard gpgsign configuration for Windows that is properly handled by Git:

[commit]
gpgsign = true
[user]
name = dzikoysk
email = dzikoysk@dzikoysk.net
[gpg]
program = C:/Program Files/Git/usr/bin/gpg.exe

I'm not sure if there's anything more than that needed for the auth setup here, but I guess it should be fine.

@bgalek
Copy link
Member

bgalek commented Jun 9, 2022

ok, i'm sure that tests are detecing your settings (gpgsign = true) so they want to use singatory - this should be fixed in tests setup

@dzikoysk
Copy link
Contributor Author

dzikoysk commented Jun 9, 2022

Well, that's another issue anyway, speaking of this one, having a clean install (& disabled gpg), I finally launched the test and it fails on my setup:

> Task :integrationTest
cze 09, 2022 11:27:53 AM org.junit.platform.launcher.core.EngineDiscoveryOrchestrator lambda$logTestDescriptorExclusionReasons$7
INFO: 0 containers and 6 tests were Method or class mismatch

Condition not satisfied:

versionFile.text == "🚀 Version: 1.0.0"
|           |    |
|           |    false
|           |    2 differences (88% similarity)
|           |    (?-) Version: 1.0.0
|           |    (🚀) Version: 1.0.0
|           ? Version: 1.0.0
C:\Users\dzikoysk\AppData\Local\Temp\spock_should_update_file__0_temporaryFolder4485522512129409666\version-file

Condition not satisfied:

versionFile.text == "🚀 Version: 1.0.0"
|           |    |
|           |    false
|           |    2 differences (88% similarity)
|           |    (?-) Version: 1.0.0
|           |    (🚀) Version: 1.0.0
|           ? Version: 1.0.0
C:\Users\dzikoysk\AppData\Local\Temp\spock_should_update_file__0_temporaryFolder4485522512129409666\version-file

	at pl.allegro.tech.build.axion.release.SimpleIntegrationTest.should update file in pre release hook(SimpleIntegrationTest.groovy:83)

As far as I see, the CI runs tests only on Linux and I assume you use Linux/macOS? I wonder if it might be related to some kind of OS-dependent impl 🤔

@bgalek
Copy link
Member

bgalek commented Jun 9, 2022

That's actually good news! We have a way to reproduce the problem. I'll check if there are windows based runners at GitHub :)

@dzikoysk
Copy link
Contributor Author

dzikoysk commented Jun 9, 2022

You can create OS matrix just like with the JDK versions:

Btw, I'm currently wondering if it's not caused by Groovy?

Java sources:

obraz

Groovy sources:

obraz

Both files are encoded as UTF-8. Anyway, it means that in theory it should work if the file already exists 🤔

@dzikoysk
Copy link
Contributor Author

dzikoysk commented Jun 9, 2022

I think this is a problem, because during a debug I lost encoding in the affected file after FileWriter flushed changes to fs:

FileWriter is built on top of the OutputStreamWriter that requires charset declaration OutputStreamWriter(OutputStream out, Charset cs) and on Windows it's probably using one of the windows-* charsets by default. Unfortunately, FileWriter was enhanced with charset in JDK11:

obraz

So I think it might be just a better option to fully replace this method with a NIO Files.write() method.

Edit: Yup:

obraz

@bgalek
Copy link
Member

bgalek commented Jun 9, 2022

nice! want to do a PR? also, eventually we will need to move to JDK11 ;)

@dzikoysk
Copy link
Contributor Author

dzikoysk commented Jun 9, 2022

Sure, but I wonder what might be the best solution for the project - hardcoding UTF-8 might not be the best idea, because in general there are projects that may use Windows/other encoding. Maybe some kind of an configuration option: if not set it'll still use the default charset (+ we wouldn't change the default behavior with such change).

@bgalek
Copy link
Member

bgalek commented Jun 9, 2022

what do you think about additional paramter with default "system" (Charset.defaultCharset()) but ability to provide target i.e. "utf-8"?:)

@dzikoysk
Copy link
Contributor Author

dzikoysk commented Jun 9, 2022

Hmm... I think that encoding of project files is a part of repository metadata and it should be probably located in the plugin/build setup rather than in the task parameters that refers to some user specific properties - also, we don't really want to touch this before each release or sth. That's how I see it, but I guess it's up to you to decide about the final impl 😛

@bgalek
Copy link
Member

bgalek commented Jun 9, 2022

In the end, we need to decide are we going to do anything about it. For your exact case I would try to pass jvm option -Dfile.encoding=utf-8 and see if it helps

@bgalek
Copy link
Member

bgalek commented Jun 9, 2022

and one thing is for sure - we wanted to replace X character to an Y - without breaking existing file encoding

@dzikoysk
Copy link
Contributor Author

dzikoysk commented Jun 9, 2022

I feel like sth like that would be a great enhancement as it's fully optional and backwards compatible:

pre 'fileUpdate', [files: ['version-file'], pattern: { v, p -> v }, replacement: { v, p -> v }, encoding: 'utf-8']

But like I said, it's just a suggestion, feel free to close/modify it as you prefer to :)

@bgalek bgalek closed this as completed in cf7caf2 Jun 20, 2022
bgalek added a commit that referenced this issue Aug 3, 2022
* #387 Gradle configuration cache compatibility

* #387 attempt to fix mysterious CI build failure

* fixing maven jar publication problems

* Update ci.yml

* fixing maven jar publication problems

* fixing maven jar publication problems

* Update build.gradle

* setAutomatedPublishing set to default (true) (#486)

* MavenPublication artifact changed

* publishing artifact configuration changed

* Bump mkdocs-material from 8.2.16 to 8.3.2 (#485)

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.2.16 to 8.3.2.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@8.2.16...8.3.2)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update README.md

* Update README.md

* fix: customize pom, not create another publication (#487)

* Update publish.yml

* Implement #480: handle empty overriddenBranchName same as not set (#489)

* Bump pl.allegro.tech.build.axion-release from 1.13.9 to 1.13.14 (#496)

Bumps [pl.allegro.tech.build.axion-release](https://github.com/allegro/axion-release-plugin) from 1.13.9 to 1.13.14.
- [Release notes](https://github.com/allegro/axion-release-plugin/releases)
- [Commits](v1.13.9...v1.13.14)

---
updated-dependencies:
- dependency-name: pl.allegro.tech.build.axion-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mkdocs-material from 8.3.2 to 8.3.4 (#494)

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.3.2 to 8.3.4.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@8.3.2...8.3.4)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mkdocs-material from 8.3.4 to 8.3.6 (#498)

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.3.4 to 8.3.6.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@8.3.4...8.3.6)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* GH-490 Support encoding in `fileUpdate` hook (Fix #490) (#493)

* Bump com.coditory.integration-test from 1.4.0 to 1.4.2 (#508)

Bumps com.coditory.integration-test from 1.4.0 to 1.4.2.

---
updated-dependencies:
- dependency-name: com.coditory.integration-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mkdocs-material from 8.3.6 to 8.3.9 (#504)

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.3.6 to 8.3.9.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@8.3.6...8.3.9)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump objenesis from 3.2 to 3.3 (#514)

Bumps [objenesis](https://github.com/easymock/objenesis) from 3.2 to 3.3.
- [Release notes](https://github.com/easymock/objenesis/releases)
- [Commits](easymock/objenesis@3.2...3.3)

---
updated-dependencies:
- dependency-name: org.objenesis:objenesis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mkdocs from 1.3.0 to 1.3.1 (#512)

Bumps [mkdocs](https://github.com/mkdocs/mkdocs) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/mkdocs/mkdocs/releases)
- [Commits](mkdocs/mkdocs@1.3.0...1.3.1)

---
updated-dependencies:
- dependency-name: mkdocs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump org.jetbrains.kotlin.jvm from 1.4.0 to 1.7.10 (#507)

Bumps [org.jetbrains.kotlin.jvm](https://github.com/JetBrains/kotlin) from 1.4.0 to 1.7.10.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.7.10/ChangeLog.md)
- [Commits](JetBrains/kotlin@v1.4.0...v1.7.10)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin.jvm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sshd-git from 2.8.0 to 2.9.0 (#511)

Bumps [sshd-git](https://github.com/apache/mina-sshd) from 2.8.0 to 2.9.0.
- [Release notes](https://github.com/apache/mina-sshd/releases)
- [Changelog](https://github.com/apache/mina-sshd/blob/master/CHANGES.md)
- [Commits](apache/mina-sshd@sshd-2.8.0...sshd-2.9.0)

---
updated-dependencies:
- dependency-name: org.apache.sshd:sshd-git
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump sshd-core from 2.8.0 to 2.9.0 (#513)

Bumps [sshd-core](https://github.com/apache/mina-sshd) from 2.8.0 to 2.9.0.
- [Release notes](https://github.com/apache/mina-sshd/releases)
- [Changelog](https://github.com/apache/mina-sshd/blob/master/CHANGES.md)
- [Commits](apache/mina-sshd@sshd-2.8.0...sshd-2.9.0)

---
updated-dependencies:
- dependency-name: org.apache.sshd:sshd-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: Chris Lee <chris@cloudshiftconsulting.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Artur Frysiak <artur@frysiak.net>
Co-authored-by: David <david0@users.noreply.github.com>
Co-authored-by: Dzikoysk <dzikoysk@dzikoysk.net>
bgalek pushed a commit that referenced this issue Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants