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

Put secrets on github organizations #3567

Merged
merged 6 commits into from Mar 21, 2024
Merged

Conversation

fnxpt
Copy link
Contributor

@fnxpt fnxpt commented Feb 29, 2024

closes #3566

Summary

Currently is only possible to set secrets on a repo, adding the possibility to set it in an organization is pretty useful, since it allows to control secrets per organization instead of adding multiple secrets to individual repos.

Release Note

Allows secret creation on github organizations

@fnxpt fnxpt changed the title Fnxpt/GitHub org secret Put secrets on github organizations Feb 29, 2024
@cpanato
Copy link
Member

cpanato commented Feb 29, 2024

please sign the dco

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.41%. Comparing base (2ef6022) to head (00ae247).
Report is 54 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3567      +/-   ##
==========================================
+ Coverage   40.10%   40.41%   +0.31%     
==========================================
  Files         155      155              
  Lines       10044    10087      +43     
==========================================
+ Hits         4028     4077      +49     
+ Misses       5530     5517      -13     
- Partials      486      493       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fnxpt
Copy link
Contributor Author

fnxpt commented Feb 29, 2024

please sign the dco

@cpanato should be signed now
looks like the codecov was done on a previous commit

@fnxpt
Copy link
Contributor Author

fnxpt commented Feb 29, 2024

@cpanato can you approve the flows again? I had a lint issue

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 1, 2024

just noticed that the lint check failed again, however this doesn't seem to be related with my changes since its failing on prepare environment

@cpanato
Copy link
Member

cpanato commented Mar 1, 2024

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.

see my comment

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 1, 2024

@fnxpt please take a look at https://github.com/sigstore/cosign/pull/3567/files#annotation_18715975046

@cpanato its weird I had it without the else and got errors on the lint... anyways Im going to revert that change

@biehl1
Copy link

biehl1 commented Mar 1, 2024

@cpanato are changes made by @fnxpt sufficient?

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 2, 2024

Not really sure why lint keeps complicating, I will try to run it locally but if you have any clues let me know

@cpanato
Copy link
Member

cpanato commented Mar 3, 2024

please rebase and see if that fix it

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 4, 2024

@cpanato rebase done

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 4, 2024

@cpanato runned lint locally and manage to find the issue... I hope now it works (still no clues why its giving a lot of errors on the prepare phase)

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 4, 2024

looks ok now

@@ -145,6 +151,20 @@ func (g *Gh) PutSecret(ctx context.Context, ref string, pf cosign.PassFunc) erro
return nil
}

func (g *Gh) getPublicKey(ctx context.Context, client *github.Client, owner string, repo string) (*github.PublicKey, *github.Response, error) {
Copy link
Member

Choose a reason for hiding this comment

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

sorry, I would like to understand why you are doing the (g *Gh). What is the benefit of doing that and not using a internal pure function?

Suggested change
func (g *Gh) getPublicKey(ctx context.Context, client *github.Client, owner string, repo string) (*github.PublicKey, *github.Response, error) {
func getPublicKey(ctx context.Context, client *github.Client, owner string, repo string) (*github.PublicKey, *github.Response, error) {

same for the other one

Copy link
Member

Choose a reason for hiding this comment

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

if the g had the github client that makes more sense, but it does not have, and you are passing as paramenter, i think you can drop the g thing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no reason at all, I converted the methods to functions... initially I duplicated the original function and they I cleaned the code to avoid duplicated code and I ended up by leaving this as a method

Copy link
Member

Choose a reason for hiding this comment

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

functions are ok, but that does not need to be part of (g *Gh) please drop that

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.

check my comment, otherwise lgtm

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.

thanks

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 7, 2024

e2e tests are failing no space left on device

@cpanato
Copy link
Member

cpanato commented Mar 7, 2024

@fnxpt can you please rebase? we merged this to free space #3579

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 8, 2024

rebase done

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 9, 2024

seems like the tests are still failing.... but it doesnt seem to be from the code
open ../../../go/pkg/mod/github.com/!azure/azure-sdk-for-go@v68.0.0+incompatible/services/preview/containerregistry/runtime/2019-08-15-preview/containerregistry/accesstokens.go: no such file or directory

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 12, 2024

@cpanato any update/guidance on this?

@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 21, 2024

Hey guys any inputs on this? From the logs this doesn't look like an issue with the code

@haydentherapper
Copy link
Contributor

Can you rebase off HEAD and we'll try to run them again?

Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Marlon Pina Tojal added 5 commits March 21, 2024 18:25
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
Signed-off-by: Marlon Pina Tojal <marlont@backbase.com>
@fnxpt
Copy link
Contributor Author

fnxpt commented Mar 21, 2024

@haydentherapper rebased

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.

thx

@cpanato cpanato merged commit 1ea2154 into sigstore:main Mar 21, 2024
29 checks passed
@github-actions github-actions bot added this to the v2.3.0 milestone Mar 21, 2024
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.

Allow provisioning key-pair to a GitHub organisation's secrets
4 participants