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

add parsing yaml log in caicloud.yaml ; increase more check when clone code #72

Merged
merged 4 commits into from
Nov 24, 2016

Conversation

xiaomuqiao
Copy link
Contributor

1、increase the check to prevent crashes
2、set service status according event's status
3、add log info about parsing yaml

@@ -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")
Copy link
Contributor

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."

Copy link
Contributor Author

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")
Copy link
Contributor

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'"

Copy link
Contributor Author

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")
Copy link
Contributor

Choose a reason for hiding this comment

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

as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@superxi911-zz superxi911-zz dismissed gaocegege’s stale review November 24, 2016 07:17

xiaomuqiao has modified his codes according to your comments.

@superxi911-zz
Copy link
Contributor

LGTM

@superxi911-zz superxi911-zz merged commit fe19fc2 into caicloud:master Nov 24, 2016
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.

None yet

3 participants