fix: when branch name is invalid, report a error message#328
Conversation
|
@mangoGoForward: The label(s) DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/assign @LinuxSuRen |
Codecov Report
@@ Coverage Diff @@
## master #328 +/- ##
=========================================
+ Coverage 7.70% 7.75% +0.04%
=========================================
Files 94 94
Lines 21443 21449 +6
=========================================
+ Hits 1652 1663 +11
+ Misses 19667 19662 -5
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Thanks for your quick fixing. /area devops |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mangoGoForward The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Thanks a lot, I have changed, could you help me to review it? |
Nice job! But I'm curious about is, why not use |
The penny drops, and the code is more elegant. |
|
/lgtm |
|
IMO, if there's no perfect solution for some special character in the git branch, then we can exclude (AKA do not show) them. So, we can claim that no support for those git branches which are Chinese words. How does that sound like? @mangoGoForward @JohnNiang |
I think so, when I try to translate git branch name to english when it is invalid, but found that I don't know the words is Chinese, and if it is other language such as Japanese, it also can not solve. |
|
So, I'd like to suggest we exclude those branches that have invalid characters (not match with the Kubernetes label naming rule). I believe the following code lines: |
Done |
There was a problem hiding this comment.
/lgtm
Thanks for your patient.
I'm wondering if you have the same email address between GitHub and your git config. Your avatars' color is gray, and it might be caused by the email setting. This would block the merge process if you don't mind it.
By the way, you can join our WeChat group of the DevOps SIG if you are interested in it. My WeChat ID is linuxsuren.
Thanks, Both use same email address between Github and git config correctly. And I'm glad to join the group. |
JohnNiang
left a comment
There was a problem hiding this comment.
Hi @mangoGoForward , I've left a potential solution in #104 (comment). Please take a moment to have a look.
hi @JohnNiang , I prefer to take your solution in a new PR instead of this one. This PR can avoid the necessary errors with small changes. But it will make big changes with your solution. |
Agree with you. /lgtm |


What type of PR is this?
/kind bug
/kind hacktoberfest
/kind hacktoberfest-accepted
What this PR does / why we need it:
Before save resource, we should check branch name whether is valid, and build the label selector to query target PipelineRuns, we should check the branch name of request also.
Which issue(s) this PR fixes:
Fixes #104