Skip to content

Conversation

@ecrupper
Copy link
Contributor

GitHub is case insensitive, while Vela is not. This causes issues when a user attempts to create an org or repo secret with the wrong casing. The secret is created and added to the database, which is unexpected behavior when the user navigates to their secrets page and does not see it there.

Example of the new casing check, given that EastonCrupper/myvela is the repo in Vela:

vela add secret --secret.engine native --secret.type repo --org EastonCrupper --repo MyVela --name example --value blahblahblah
DEBU[0000] parsing Vela client from provided configuration 
DEBU[0000] validating provided configuration for Vela client 
TRAC[0000] creating Vela client for http://localhost:8080 
TRAC[0000] setting token for Vela client                
DEBU[0000] validating secret configuration              
DEBU[0000] executing add for secret configuration       
DEBU[0000] capturing value for secret example           
TRAC[0000] adding secret native/repo/EastonCrupper/MyVela/example 
FATA[0000] unable to retrieve repository MyVela. Did you mean myvela? 

@ecrupper ecrupper self-assigned this Sep 22, 2022
@ecrupper ecrupper requested a review from a team as a code owner September 22, 2022 16:12
@codecov
Copy link

codecov bot commented Sep 22, 2022

Codecov Report

Merging #700 (5c31e41) into main (f0741c9) will decrease coverage by 0.04%.
The diff coverage is 46.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #700      +/-   ##
==========================================
- Coverage   55.09%   55.05%   -0.05%     
==========================================
  Files         210      211       +1     
  Lines       15912    15994      +82     
==========================================
+ Hits         8767     8805      +38     
- Misses       6768     6811      +43     
- Partials      377      378       +1     
Impacted Files Coverage Δ
api/secret.go 0.00% <0.00%> (ø)
scm/github/org.go 88.00% <88.00%> (ø)
scm/github/repo.go 74.77% <100.00%> (+1.25%) ⬆️

Copy link
Contributor

@KellyMerrick KellyMerrick left a comment

Choose a reason for hiding this comment

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

lgtm

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.

4 participants