Expose repository_object_format via Project API#1125
Expose repository_object_format via Project API#1125slonopotamus wants to merge 1 commit intogitlab4j:mainfrom
Conversation
GitLab 16.9 introduced an option to create repositories with SHA256 instead of SHA1. This commit exposes object format used by particular repository via Project API. See https://gitlab.com/gitlab-org/gitlab/-/issues/419887 Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
8c07922 to
bb9445c
Compare
There was a problem hiding this comment.
Can you please also update the json file /gitlab4j-api/src/test/resources/org/gitlab4j/api/project.json that corresponds to this model and that is used in the TestGitLabApiBeans test.
| .withMergeRequestsEnabled(true) | ||
| .withWikiEnabled(true) | ||
| .withSnippetsEnabled(true) | ||
| .withRepositoryObjectFormat("sha1") |
There was a problem hiding this comment.
If I am not mistaken this test is using the GitLab installation started in Docker while the integration tests are running.
This version is very old and this test will fail.
There was a problem hiding this comment.
Hmm... Is there any reference test that I could use for this new field?
There was a problem hiding this comment.
The pipeline in GitHub action is failing as expected:
Error: Failures:
Error: TestProjectApi.testCreate:239 expected: <sha1> but was: <null>
[INFO]
Error: Tests run: 308, Failures: 1, Errors: 0, Skipped: 14
There was a problem hiding this comment.
Some tests are using Mockito but this feels also wrong.
I started to experiment to use testcontainers to run a newer GitLab version (there is some work in a PR).
But I am wondering if we should not just Mock the GitLab server in order to run the unit-test quickly.
I would say that for now TestProjectApi.testCreate() remains unchanged and we merge your change.
|
@jmini is it ok that repositoryObjectFormat is a string? Or it would be better if it was a enum, like project vsibility? |
I am always not really sure about the String vs enum… In the docs they just mention |
Yes,
Ok. |
|
Converting to draft until I fix test issues. |
GitLab 16.9 introduced an option to create repositories with SHA256 instead of SHA1.
This commit exposes object format used by particular repository via Project API.
See https://gitlab.com/gitlab-org/gitlab/-/issues/419887