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

[deploy] Could not determine git HEAD null #963

Closed
maxandersen opened this issue Sep 22, 2022 · 7 comments
Closed

[deploy] Could not determine git HEAD null #963

maxandersen opened this issue Sep 22, 2022 · 7 comments
Assignees
Labels
bug Something isn't working Hack.Commit.Push released Issue has been released
Milestone

Comments

@maxandersen
Copy link

if you do:

mkdir test
cd test
jreleaser init
git init 
jreleaser deploy

you get this error:

Could not determine git HEAD
null

which I assume is failing as no commits. since when done a git commit it tells me:

Could not determine remote
repository doesn't have a remote named 'origin'
@maxandersen maxandersen added the bug Something isn't working label Sep 22, 2022
@aalmiray
Copy link
Member

aalmiray commented Sep 22, 2022

That's correct. The deploy step requires running inside a git repository with at least 1 commit. and a default remote set. The current expectation is that the project is in a releasable state.

We may have to review/relax this constraint in the future.

@maxandersen
Copy link
Author

To be clear I get it's expected to not work. It's just that the error message is not as informative "null" as it is in other cases.

@aalmiray
Copy link
Member

Aha. Did you get a stacktrace when the error occurred? Look into out/jreleaser/trace.log

@maxandersen
Copy link
Author

java.io.IOException: repository doesn't have a remote named 'origin'
	at org.jreleaser.sdk.git.GitSdk.lambda$getRemote$1(GitSdk.java:92)
	at java.base/java.util.Optional.orElseThrow(Optional.java:408)
	at org.jreleaser.sdk.git.GitSdk.getRemote(GitSdk.java:92)
	at org.jreleaser.engine.context.ModelConfigurer.configure(ModelConfigurer.java:58)
	at org.jreleaser.engine.context.ContextCreator.create(ContextCreator.java:79)
	at org.jreleaser.cli.AbstractModelCommand.createContext(AbstractModelCommand.java:141)
	at org.jreleaser.cli.AbstractModelCommand.execute(AbstractModelCommand.java:82)
	at org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:36)
	at org.jreleaser.cli.AbstractModelCommand.call(AbstractModelCommand.java:48)
	at org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:29)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
	at picocli.CommandLine.execute(CommandLine.java:2078)
	at org.jreleaser.cli.Main.execute(Main.java:72)
	at org.jreleaser.cli.Main.run(Main.java:57)
	at org.jreleaser.cli.Main.main(Main.java:48)
	at jreleaser_snapshot.main(jreleaser_snapshot.java:8)

@aalmiray aalmiray changed the title Could not determine git HEAD null [deploy] Could not determine git HEAD null Oct 2, 2022
@aalmiray
Copy link
Member

aalmiray commented Oct 2, 2022

Right now deploy has no dependencies to other steps (Maven deployers do not require previous cheksums, signing, changelog for example). However, other deployers might require checksums for example. Still, even if there were step dependencies the deploy step could be invoked without requiring a git repository. This is the case for the assemble step.

There are 2 issues here:

  • decouple deploy from git.
  • better error message when no git remote, git commit, or git repository is required.

@maxandersen thoughts?

@aalmiray aalmiray self-assigned this Nov 5, 2022
@aalmiray aalmiray added this to the v1.4.0 milestone Nov 5, 2022
@maxandersen
Copy link
Author

Sorry. Didnt see the message before now. All good fixes!

@aalmiray
Copy link
Member

@aalmiray aalmiray added the released Issue has been released label Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Hack.Commit.Push released Issue has been released
Projects
None yet
Development

No branches or pull requests

2 participants