-
Notifications
You must be signed in to change notification settings - Fork 90
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
fix: when branch name is invalid, report a error message #328
fix: when branch name is invalid, report a error message #328
Conversation
@mangoGoForward: The label(s) In 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if there's a better way to check the label, such as
I found a solution from the kubernetes project, we might be able to reuse it.
[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.
Needs 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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