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

Add a warning to remember how to configure a custom Gitlab host #2816

Merged

Conversation

paolomainardi
Copy link
Contributor

@paolomainardi paolomainardi commented Mar 16, 2023

Resolves #2730

Summary

Add a warning to explain how to use a custom Gitlab host.
I've also changed fmt.Fprintlnwith ui.Infof where applicable.

Release Note

NONE

Documentation

NO

refs sigstore#2730

Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
@paolomainardi paolomainardi force-pushed the feature/2730_gitlab_host_warning branch from 07e4ae4 to 13bd977 Compare March 16, 2023 23:34
@paolomainardi paolomainardi changed the title Resolves sigstore/cosign#2730 Add a warning to remember how to configure a custom Gitlab host Mar 16, 2023
Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #2816 (d27522c) into main (7d2549e) will increase coverage by 0.52%.
The diff coverage is n/a.

❗ Current head d27522c differs from pull request most recent head 5668f2f. Consider uploading reports for the commit 5668f2f to get more accurate results

@@            Coverage Diff             @@
##             main    #2816      +/-   ##
==========================================
+ Coverage   28.99%   29.51%   +0.52%     
==========================================
  Files         151      151              
  Lines        9655     9655              
==========================================
+ Hits         2799     2850      +51     
+ Misses       6436     6366      -70     
- Partials      420      439      +19     

see 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -70,6 +71,7 @@ func (g *Gl) PutSecret(ctx context.Context, ref string, pf cosign.PassFunc) erro
EnvironmentScope: gitlab.String("*"),
})
if err != nil {
ui.Infof(ctx, "WARNING: if you want to use a custom Gitlab host, set the \"GITLAB_HOST\" environment variable.")
Copy link
Member

Choose a reason for hiding this comment

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

maybe, we can say something like: "if you are using a self-hosted gitlab please set the GITLAB_HOST your server name"

thanks for this PR!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for suggestion, changed!

@cpanato cpanato requested a review from znewman01 March 17, 2023 08:39
Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
hectorj2f
hectorj2f previously approved these changes Mar 17, 2023
znewman01
znewman01 previously approved these changes Mar 17, 2023
@@ -70,6 +71,7 @@ func (g *Gl) PutSecret(ctx context.Context, ref string, pf cosign.PassFunc) erro
EnvironmentScope: gitlab.String("*"),
})
if err != nil {
ui.Warnf(ctx, "if you are using a self-hosted gitlab please set the \"GITLAB_HOST\" your server name.")
Copy link
Member

Choose a reason for hiding this comment

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

nit: if in capital letter "If you are using a self-hosted ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
@paolomainardi paolomainardi dismissed stale reviews from znewman01 and hectorj2f via 5668f2f March 17, 2023 14:05
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

thank you

@znewman01 znewman01 merged commit cb60908 into sigstore:main Mar 17, 2023
@github-actions github-actions bot added this to the v1.14.0 milestone Mar 17, 2023
dmitris pushed a commit to dmitris/cosign that referenced this pull request Mar 24, 2023
…tore#2816)

* feat: add warning for gitlab host

refs sigstore#2730

Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>

* Use ui lib where applicable

Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>

* fix: change the message of the warning when the host is not gitlab.com

Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>

* fix: use ui.Warnf instead of ui.Infof

Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>

* fix: use a capitalized warning message

Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>

---------

Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
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.

cosign is not working with Gitlab self hosted
4 participants