Skip to content

Commit

Permalink
Update Gitlab Test Server to 17.7.0 #658
Browse files Browse the repository at this point in the history
  • Loading branch information
BeckerFrank committed Jan 7, 2025
1 parent f0fb7fa commit 58e99d8
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
* An implementation of the <a href="http://trac.edgewall.org/wiki/TracWiki">TracWiki</a> markup language.
*
* @author David Green
* @since 4.6
*/
public class TracWikiLanguage extends AbstractMarkupLanguage {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ void testGetNamespaces() throws Exception {
jsonObject.addProperty("avatar_url", //$NON-NLS-1$
"https://secure.gravatar.com/avatar/42?s\u003d80\u0026d\u003didenticon"); //$NON-NLS-1$
}
// Adapt repository URL if necessary
if (!"https://gitlab.mylyn.local".equals(GitlabTestFixture.current().getRepositoryUrl())) {
String webURL = jsonObject.get("web_url")
.getAsString()
.replace(GitlabTestFixture.current().getRepositoryUrl(), "https://gitlab.mylyn.local");
jsonObject.addProperty("web_url", webURL);
}
}
techUsers.sort(Comparator.naturalOrder());
String fName = "testdata/getNamespaces" + (techUsers.size() > 0 ? "_" : "") + String.join("_", techUsers)
Expand All @@ -167,6 +174,14 @@ void testGetUser() throws Exception {
userObj.remove("current_sign_in_at"); //$NON-NLS-1$
// The avatar_url can change with a newer Gitlab version
userObj.remove("avatar_url"); //$NON-NLS-1$

// Adapt repository URL if necessary
if (!"https://gitlab.mylyn.local".equals(GitlabTestFixture.current().getRepositoryUrl())) {
String webURL = userObj.get("web_url")
.getAsString()
.replace(GitlabTestFixture.current().getRepositoryUrl(), "https://gitlab.mylyn.local");
userObj.addProperty("web_url", webURL);
}
String actual = new GsonBuilder().setPrettyPrinting().create().toJson(user);
String expectedStr = IOUtils.toString(CommonTestUtil.getResource(this, "testdata/getUser.json"), //$NON-NLS-1$
Charset.defaultCharset());
Expand All @@ -193,6 +208,22 @@ void testGetUsers() throws Exception {
jsonObject.remove("current_sign_in_at"); //$NON-NLS-1$
// The avatar_url can change with a newer Gitlab version
jsonObject.remove("avatar_url"); //$NON-NLS-1$

// Adapt repository URL if necessary
if (!"https://gitlab.mylyn.local".equals(GitlabTestFixture.current().getRepositoryUrl())) {
String webURL = jsonObject.get("web_url")
.getAsString()
.replace(GitlabTestFixture.current().getRepositoryUrl(), "https://gitlab.mylyn.local");
jsonObject.addProperty("web_url", webURL);
}
// change administrator email
if (jsonObject.get("email").getAsString().startsWith("gitlab_admin_")) {
jsonObject.addProperty("email", "[email protected]");
}
if (jsonObject.get("commit_email").getAsString().startsWith("gitlab_admin_")) {
jsonObject.addProperty("commit_email", "[email protected]");
}

}
techUsers.sort(Comparator.naturalOrder());
String fName = "testdata/getUsers" + (techUsers.size() > 0 ? "_" : "") + String.join("_", techUsers) + ".json";
Expand All @@ -209,6 +240,13 @@ void testGetGroups() throws Exception {
for (JsonElement resultObj : resultElement.getAsJsonArray()) {
JsonObject jsonObject = resultObj.getAsJsonObject();
jsonObject.addProperty("created_at", "2024-02-14T11:11:11.111Z"); //$NON-NLS-1$ //$NON-NLS-2$
// Adapt repository URL if necessary
if (!"https://gitlab.mylyn.local".equals(GitlabTestFixture.current().getRepositoryUrl())) {
String webURL = jsonObject.get("web_url")
.getAsString()
.replace(GitlabTestFixture.current().getRepositoryUrl(), "https://gitlab.mylyn.local");
jsonObject.addProperty("web_url", webURL);
}
}
String actual = new GsonBuilder().setPrettyPrinting().create().toJson(resultElement);
String expected = IOUtils.toString(CommonTestUtil.getResource(this, "testdata/getGroups.json"), //$NON-NLS-1$
Expand All @@ -232,6 +270,13 @@ void testgetConfiguration() throws Exception {
user.remove("current_sign_in_at"); //$NON-NLS-1$
// The avatar_url can change with a newer Gitlab version
user.remove("avatar_url"); //$NON-NLS-1$
// Adapt repository URL if necessary
if (!"https://gitlab.mylyn.local".equals(GitlabTestFixture.current().getRepositoryUrl())) {
String webURL = user.get("web_url")
.getAsString()
.replace(GitlabTestFixture.current().getRepositoryUrl(), "https://gitlab.mylyn.local");
user.addProperty("web_url", webURL);
}

for (Integer integer : configuration.getProjectIDs()) {
JsonObject project = configuration.getProductWithID(integer);
Expand All @@ -245,13 +290,24 @@ void testgetConfiguration() throws Exception {
project.remove("open_issues_count"); //$NON-NLS-1$
project.remove("runners_token"); //$NON-NLS-1$
project.addProperty("auto_devops_enabled", true); //$NON-NLS-1$
// Adapt repository URL if necessary
if (!"https://gitlab.mylyn.local".equals(GitlabTestFixture.current().getRepositoryUrl())) {
String ssh_url_to_repo = project.get("ssh_url_to_repo")
.getAsString()
.replace(GitlabTestFixture.current().getRepositoryUrl().substring(8), "gitlab.mylyn.local");
project.addProperty("ssh_url_to_repo", ssh_url_to_repo);
}

}
for (String string : configuration.getGroupNames()) {
JsonObject group = configuration.getGroupDetail(string).getAsJsonObject();
group.remove("created_at"); //$NON-NLS-1$
group.remove("runners_token"); //$NON-NLS-1$
}
String actual = new GsonBuilder().setPrettyPrinting().create().toJson(configuration);
String actual = new GsonBuilder().setPrettyPrinting()
.create()
.toJson(configuration)
.replace(GitlabTestFixture.current().getRepositoryUrl(), "https://gitlab.mylyn.local");
String expected = IOUtils.toString(CommonTestUtil.getResource(this, "testdata/configuration.json"), //$NON-NLS-1$
Charset.defaultCharset());
assertEquals(expected, actual);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,21 @@
"ci_job_token_scope_enabled": false,
"ci_separated_caches": true,
"ci_allow_fork_pipelines_to_run_in_parent_project": true,
"ci_id_token_sub_claim_components": [
"project_path",
"ref_type",
"ref"
],
"build_git_strategy": "fetch",
"keep_latest_artifact": true,
"restrict_user_defined_variables": false,
"restrict_user_defined_variables": true,
"ci_pipeline_variables_minimum_override_role": "developer",
"group_runners_enabled": true,
"auto_cancel_pending_pipelines": "enabled",
"build_timeout": 3600,
"auto_devops_enabled": true,
"auto_devops_deploy_strategy": "continuous",
"ci_push_repository_for_job_token_allowed": false,
"public_jobs": true,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
Expand Down Expand Up @@ -164,7 +171,20 @@
"math_rendering_limits_enabled": true,
"lock_math_rendering_limits_enabled": false,
"default_branch_protection": 2,
"default_branch_protection_defaults": {},
"default_branch_protection_defaults": {
"allowed_to_push": [
{
"access_level": 40
}
],
"allow_force_push": false,
"allowed_to_merge": [
{
"access_level": 40
}
],
"developer_can_initial_push": false
},
"request_access_enabled": true,
"full_name": "eclipse-mylyn",
"full_path": "eclipse-mylyn",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,20 @@
"math_rendering_limits_enabled": true,
"lock_math_rendering_limits_enabled": false,
"default_branch_protection": 2,
"default_branch_protection_defaults": {},
"default_branch_protection_defaults": {
"allowed_to_push": [
{
"access_level": 40
}
],
"allow_force_push": false,
"allowed_to_merge": [
{
"access_level": 40
}
],
"developer_can_initial_push": false
},
"request_access_enabled": true,
"full_name": "eclipse-mylyn / ci-test",
"full_path": "eclipse-mylyn/ci-test",
Expand All @@ -44,7 +57,20 @@
"math_rendering_limits_enabled": true,
"lock_math_rendering_limits_enabled": false,
"default_branch_protection": 2,
"default_branch_protection_defaults": {},
"default_branch_protection_defaults": {
"allowed_to_push": [
{
"access_level": 40
}
],
"allow_force_push": false,
"allowed_to_merge": [
{
"access_level": 40
}
],
"developer_can_initial_push": false
},
"request_access_enabled": true,
"full_name": "eclipse-mylyn",
"full_path": "eclipse-mylyn",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"followers": 0,
"following": 0,
"is_followed": false,
"email": "admin@example.com",
"email": "gitlab_admin_e5012d@example.com",
"theme_id": 3,
"color_scheme_id": 1,
"projects_limit": 100000,
Expand All @@ -94,7 +94,7 @@
"two_factor_enabled": false,
"external": false,
"private_profile": false,
"commit_email": "admin@example.com",
"commit_email": "gitlab_admin_e5012d@example.com",
"is_admin": true,
"namespace_id": 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"followers": 0,
"following": 0,
"is_followed": false,
"email": "admin@example.com",
"email": "gitlab_admin_e5012d@example.com",
"theme_id": 3,
"color_scheme_id": 1,
"projects_limit": 100000,
Expand All @@ -162,7 +162,7 @@
"two_factor_enabled": false,
"external": false,
"private_profile": false,
"commit_email": "admin@example.com",
"commit_email": "gitlab_admin_e5012d@example.com",
"is_admin": true,
"namespace_id": 1
}
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.mylyn.releng/multipass/mylyn_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
- gitlab
vars:
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
gitlabImageVersion: "17.4.0"
gitlabImageVersion: "17.7.0"
gitlabHostURL: "gitlab.{{ hostvars['localhost'].mylyn_service_domain }}"
- role: jenkins
tags:
Expand Down

0 comments on commit 58e99d8

Please sign in to comment.