-
Notifications
You must be signed in to change notification settings - Fork 474
Project Branches API #153
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
Project Branches API #153
Conversation
@lamdav
|
|
@@ -33,8 +32,7 @@ public static String getReaderContentAsString(Reader reader) throws IOException | |||
static { | |||
|
|||
testProperties = new Properties(); | |||
File path = new File(System.getProperty("user.home"), "test-gitlab4j.properties"); |
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.
https://stackoverflow.com/questions/5529532/how-to-get-a-test-resource-file
To keep the resource under the test directory of the project. If this is undesired, I can remove it.
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.
A few things here:
- Not a fan of having it down in a src/test/resource directory, it leads to the potential of secrets being accidentally checked in. I would prefer it in the root of the project, and name it:
example-test-gitlab4j.properties
When moved to the root the code in TestUtils would need to look something like:
try (InputStream input = new FileInputStream("test-gitlab4j.properties")) {
-
Include test-gitlab4j.properties in the .gitignore file so it is not accidentally checked in.
-
There are about 10 additional properties that need to be set to fully test things, I'll get you those when I have some time tomorrow afternoon.
Last but not least. I am working on a GitLab server docker image that will be used to test GitLab4J, this way the test-gitlab4j.properties file can actually be created and left as is. I expect to have this finished and checked in within the next 2-3 weeks.
TEST_NAMESPACE=some-namespace | ||
TEST_PROJECT_NAME=some-project-name | ||
TEST_HOST_URL=some-gitlab-url | ||
TEST_PRIVATE_TOKEN=some-private-token |
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.
Goes along with the above comment. Gives a new contributor an idea of how to setup for testing.
README.md
Outdated
@@ -155,6 +155,7 @@ The API has been broken up into sub APIs classes to make it easier to learn and | |||
[SessionApi](#sessionapi)<br/> | |||
[SystemHooksApi](#systemhooksapi)<br/> | |||
[UserApi](#userapi) | |||
[ProtectedBranchesApi](#protectedbranchesapi) |
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.
Try to keep this list and the examples in alphabetical order.
@@ -33,8 +32,7 @@ public static String getReaderContentAsString(Reader reader) throws IOException | |||
static { | |||
|
|||
testProperties = new Properties(); | |||
File path = new File(System.getProperty("user.home"), "test-gitlab4j.properties"); |
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.
A few things here:
- Not a fan of having it down in a src/test/resource directory, it leads to the potential of secrets being accidentally checked in. I would prefer it in the root of the project, and name it:
example-test-gitlab4j.properties
When moved to the root the code in TestUtils would need to look something like:
try (InputStream input = new FileInputStream("test-gitlab4j.properties")) {
-
Include test-gitlab4j.properties in the .gitignore file so it is not accidentally checked in.
-
There are about 10 additional properties that need to be set to fully test things, I'll get you those when I have some time tomorrow afternoon.
Last but not least. I am working on a GitLab server docker image that will be used to test GitLab4J, this way the test-gitlab4j.properties file can actually be created and left as is. I expect to have this finished and checked in within the next 2-3 weeks.
@lamdav |
@gmessner Sounds good to me! |
@lamdav |
The Gitlab docs list other methods of gathering information or updating protected branches.
https://docs.gitlab.com/ce/api/protected_branches.html#list-protected-branches