-
Notifications
You must be signed in to change notification settings - Fork 318
Cleans up "project" resource schema and testing framework #132
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
Cleans up "project" resource schema and testing framework #132
Conversation
Uses the *gitlab.Project struct and resource Schema to test the resulting values. removes the extra generate access token file and updates the access token value to be generated from a variable (with a default).
roidelapluie
left a comment
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.
Thank you for your high quality contribution!
Just a few remarks; but I could merge it directly.
| echo "Starting gitlab container..." | ||
| docker run -d -e GITLAB_ROOT_PASSWORD=adminadmin --rm -p 127.0.0.1:8080:80 --name gitlab gitlab/gitlab-ce | ||
| docker run -d --rm --name gitlab \ | ||
| -e GITLAB_ROOT_PASSWORD=adminadmin \ |
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.
Do you want this as a variable as well?
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.
It could potentially be. For the sake of automated tests it's not even necessary to set the root password since we're not even accessing the UI, but it might be useful if someone wasn't deleting the test resources and was trying to log in afterwards to view them.
| Type: schema.TypeString, | ||
| Required: true, | ||
| ValidateFunc: validation.StringInSlice([]string{ | ||
| "no one", "guest", "reporter", "developer", "maintainer"}, false), |
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.
Isn't there a slice in the gitlab library for this?
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.
The values are stored in the library as type gitlab.AccessLevelValue. Would need a method to convert them to type gitlab.AccessLevelValue and then another to check value against the type.
| "visibility_level": { | ||
| Type: schema.TypeString, | ||
| Optional: true, | ||
| ValidateFunc: validation.StringInSlice([]string{"private", "internal", "public"}, true), |
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.
Isn't there a slice in the gitlab library for this?
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.
The values are stored in the library as type gitlab.VisibilityValue. Would need a method to convert them to type gitlab.VisibilityValue and then another to check value against the type.
| "merge_method": { | ||
| Type: schema.TypeString, | ||
| Optional: true, | ||
| ValidateFunc: validation.StringInSlice([]string{"merge", "rebase_merge", "ff"}, true), |
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.
Isn't there a slice in the gitlab library for this?
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.
The values are stored in the library as type gitlab.MergeMethodValue. Would need a method to convert them to type gitlab.MergeMethodValue and then another possibly to check value against the type.
|
Thanks |
Uses the *gitlab.Project struct and resource Schema to test the resulting values.
Removes the extra generate access token file and updates the access token value to be generated from a variable (with a default).