-
Notifications
You must be signed in to change notification settings - Fork 168
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 parsing yaml log in caicloud.yaml ; increase more check when clone code #72
Conversation
@@ -59,9 +59,21 @@ func insert(url, insertion string, index int) string { | |||
func getUrlwithToken(url, subvcs, token string) string { | |||
switch subvcs { | |||
case api.GITHUB: | |||
if token == "" { | |||
log.Warn("subvcs is github, but the token is empty, there meybe exist error") |
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 think the log could be "Sub VCS is GitHub, but the token is empty, maybe there is an error."
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.
ok
position := strings.Index(url, "github.com") | ||
if position == -1 { | ||
log.Warn("subvcs is github and the token is not empty, but the url dosen't contain github.com") |
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 think the log could be "Sub VCS is GitHub, but the URL doesn't contain 'github.com'"
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.
done
url = insert(url, token+"@", position) | ||
case api.GITLAB: | ||
if token == "" { | ||
log.Warn("subvcs is gitlab, but the token is empty, there meybe exist error") |
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.
as above.
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.
done
xiaomuqiao has modified his codes according to your comments.
LGTM |
1、increase the check to prevent crashes
2、set service status according event's status
3、add log info about parsing yaml