diff --git a/mylyn.docs/wikitext/core/org.eclipse.mylyn.wikitext.tracwiki/src/main/java/org/eclipse/mylyn/wikitext/tracwiki/TracWikiLanguage.java b/mylyn.docs/wikitext/core/org.eclipse.mylyn.wikitext.tracwiki/src/main/java/org/eclipse/mylyn/wikitext/tracwiki/TracWikiLanguage.java index 3a7dee06ff..823f536765 100644 --- a/mylyn.docs/wikitext/core/org.eclipse.mylyn.wikitext.tracwiki/src/main/java/org/eclipse/mylyn/wikitext/tracwiki/TracWikiLanguage.java +++ b/mylyn.docs/wikitext/core/org.eclipse.mylyn.wikitext.tracwiki/src/main/java/org/eclipse/mylyn/wikitext/tracwiki/TracWikiLanguage.java @@ -48,6 +48,7 @@ * An implementation of the TracWiki markup language. * * @author David Green + * @since 4.6 */ public class TracWikiLanguage extends AbstractMarkupLanguage { diff --git a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/src/org/eclipse/mylyn/gitlab/core/test/RestfulGitlabClientTest.java b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/src/org/eclipse/mylyn/gitlab/core/test/RestfulGitlabClientTest.java index 83efd4d1cc..5803bb16d8 100644 --- a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/src/org/eclipse/mylyn/gitlab/core/test/RestfulGitlabClientTest.java +++ b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/src/org/eclipse/mylyn/gitlab/core/test/RestfulGitlabClientTest.java @@ -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) @@ -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()); @@ -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", "gitlab_admin_e5012d@example.com"); + } + if (jsonObject.get("commit_email").getAsString().startsWith("gitlab_admin_")) { + jsonObject.addProperty("commit_email", "gitlab_admin_e5012d@example.com"); + } + } techUsers.sort(Comparator.naturalOrder()); String fName = "testdata/getUsers" + (techUsers.size() > 0 ? "_" : "") + String.join("_", techUsers) + ".json"; @@ -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$ @@ -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); @@ -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); diff --git a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/configuration.json b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/configuration.json index 8366567180..72b693d200 100644 --- a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/configuration.json +++ b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/configuration.json @@ -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, @@ -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", diff --git a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getGroups.json b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getGroups.json index 1cdb9abb57..f4a98b32e3 100644 --- a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getGroups.json +++ b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getGroups.json @@ -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", @@ -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", diff --git a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getUsers.json b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getUsers.json index 0c8b1d82d0..611a15a012 100644 --- a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getUsers.json +++ b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getUsers.json @@ -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, @@ -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 } diff --git a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getUsers_alert-bot_support-bot.json b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getUsers_alert-bot_support-bot.json index 2321fe90e3..0317b67158 100644 --- a/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getUsers_alert-bot_support-bot.json +++ b/mylyn.tasks/connectors/gitlab/org.eclipse.mylyn.gitlab.core.test/testdata/getUsers_alert-bot_support-bot.json @@ -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, @@ -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 } diff --git a/org.eclipse.mylyn.releng/multipass/mylyn_setup.yml b/org.eclipse.mylyn.releng/multipass/mylyn_setup.yml index 048aba1961..6905817089 100644 --- a/org.eclipse.mylyn.releng/multipass/mylyn_setup.yml +++ b/org.eclipse.mylyn.releng/multipass/mylyn_setup.yml @@ -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: