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

Solves #345 : optional signing #346

Merged
merged 2 commits into from
May 23, 2018

Conversation

Baccata
Copy link
Contributor

@Baccata Baccata commented May 22, 2018

  • Made gpgPassphrase optional for publishing
  • Added a flag to remove signing of published artifacts altogether

#345

@Baccata Baccata changed the title Solves 345 : optional signing Solves #345 : optional signing May 22, 2018
* Made gpgPassphrase optional for publishing
* Added a flag to remove signing of published artifacts altogether
@Baccata Baccata force-pushed the issue-345-optional-signing branch from 43015ac to 63e49f9 Compare May 22, 2018 07:54
@lihaoyi
Copy link
Member

lihaoyi commented May 23, 2018

@rockjam want to review this? Since this is mostly your code

@rockjam
Copy link
Collaborator

rockjam commented May 23, 2018

Sure, will do

@@ -73,32 +73,35 @@ trait PublishModule extends JavaModule { outer =>
}

def publish(sonatypeCreds: String,
gpgPassphrase: String,
gpgPassphrase: String = "",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to make this argument optional? Same applies to publishAll command

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's possible to write a ScoptReader for "absence of values" tbh. However your suggestion to default to null is better than empty string. Addressed : ec362d8

release: Boolean): define.Command[Unit] = T.command {
val PublishModule.PublishData(artifactInfo, artifacts) = publishArtifacts()
new SonatypePublisher(
sonatypeUri,
sonatypeSnapshotUri,
sonatypeCreds,
gpgPassphrase,
Some(gpgPassphrase).filter(_.nonEmpty),
Copy link
Collaborator

Choose a reason for hiding this comment

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

If having gpgPassphrase parameter optional is not possible, I guess we could have default value as null and wrap it in Option(gpgPassphrase) instead of filtering out an empty string, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed ec362d8

case Some(passphrase) =>
%("gpg", "--passphrase", passphrase, "--batch", "--yes", "-a", "-b", fileName)
case None =>
%("gpg", "--batch", "--yes", "-a", "-b", fileName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it useful to sign artifacts without gpgPassphrase ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I honestly don't know if it's useful, but I'm following Haoyi's comment :

#345 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, I didn't notice that. All good then

@rockjam
Copy link
Collaborator

rockjam commented May 23, 2018

@Baccata left some comments

better than using empty string as default param.
@rockjam
Copy link
Collaborator

rockjam commented May 23, 2018

@Baccata everything seems to be fine. Will merge once CI goes green

@rockjam rockjam merged commit ab2a8b3 into com-lihaoyi:master May 23, 2018
@Baccata Baccata deleted the issue-345-optional-signing branch May 23, 2018 15:26
@lefou lefou added this to the 0.2.3 milestone Apr 30, 2019
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.

None yet

4 participants