diff --git a/Gemfile.lock b/Gemfile.lock index 94d91d75bf49..04bab7397589 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -141,6 +141,12 @@ PATH openproject-github_integration (1.0.0) openproject-webhooks +PATH + remote: modules/gitlab_integration + specs: + openproject-gitlab_integration (3.0.0) + openproject-webhooks + PATH remote: modules/grids specs: @@ -1226,6 +1232,7 @@ DEPENDENCIES openproject-documents! openproject-gantt! openproject-github_integration! + openproject-gitlab_integration! openproject-job_status! openproject-ldap_groups! openproject-meeting! diff --git a/Gemfile.modules b/Gemfile.modules index 6e8a38a26e85..1689af163585 100644 --- a/Gemfile.modules +++ b/Gemfile.modules @@ -33,6 +33,7 @@ group :opf_plugins do gem 'openproject-two_factor_authentication', path: 'modules/two_factor_authentication' gem 'openproject-webhooks', path: 'modules/webhooks' gem 'openproject-github_integration', path: 'modules/github_integration' + gem 'openproject-gitlab_integration', path: 'modules/gitlab_integration' gem 'openproject-ldap_groups', path: 'modules/ldap_groups' gem 'openproject-recaptcha', path: 'modules/recaptcha' gem 'openproject-job_status', path: 'modules/job_status' diff --git a/modules/gitlab_integration/LICENSE b/modules/gitlab_integration/LICENSE new file mode 100644 index 000000000000..312676ee55f3 --- /dev/null +++ b/modules/gitlab_integration/LICENSE @@ -0,0 +1,28 @@ +-- copyright + +OpenProject is an open source project management software. +Copyright (C) 2012-2024 the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. +++ diff --git a/modules/gitlab_integration/README.md b/modules/gitlab_integration/README.md new file mode 100644 index 000000000000..f48a136354f4 --- /dev/null +++ b/modules/gitlab_integration/README.md @@ -0,0 +1,234 @@ +## Introducing OpenProject GitLab Integration v2.1.6 GA + +
+ +Based on the OpenProject Github Integration, this plugin offers the same functionalities plus other new features. This is the first version that includes the visualization of the status of the *Pipelines* (by now, it is considered in Beta status). You can test it by activating the Pipelines event in the GitLab webhook. Just keep in mind that not all pipelines will be reflected in OpenProject, only Merge Request type pipelines (for more information see the GitLab issue https://gitlab.com/gitlab-org/gitlab/-/issues/345028). Any feedback about the pipelines feature would be very appreciated, whether it works or if issues arise (you can use this ticket https://github.com/btey/openproject-gitlab-integration/issues/43). + +In this version it has also been implemented that **all linked or referenced** Issues appear in the GitLab tab (https://github.com/btey/openproject-gitlab-integration/issues/34). The opportunity has also been taken to redesign how the information is presented so that it is visually easy to read and at the same time can continue to provide all the information, including labels and pipeline status. + +If there are labels related to the Issue or MR, a button with the label icon will appear. By clicking the button you can show/hide the associated labels. + + +

+ + +## Overview + +OpenProject module for integration with GitLab: +* Latest Gitlab release tested: **16.6.2** +* Latest OpenProject release tested: **13.1.2** (for OP v13.0.X use v2.1.2) + +The reference system is based on the same system as for GitHub integration. You can use a link to the work package or just use “OP#87” or "PP#87" in the title/description of the Issue/MR in GitLab. + +> **Note about the references.** Whether or not to include the reference in certain places depends on the information that GitLab sends through its webhook. If you include the reference in the title/description of an issue, the comments on the issue do not need to include the reference. The same will happen when you generate a Merge Request based on an Issue that already includes the reference; comments from that MR need not include the reference. + +#### Difference between OP and PP + +If you use `OP#` as a reference in an Issue or MR title, all comments will be replicated in OpenProject. However, sometimes you may only want to keep information about the status of an Issue/MR in OpenProject, but you don't want your comments to be published. In this case, you can use `PP#` as a reference. This way the comments will not be published in OpenProject. But if at any time one of your comments in a private Issue/MR is of interest to you to be published in OpenProject you can use `OP#` *directly in that comment*. So only that comment will be published in OpenProject. The rest of the comments will remain private and will not be published. + +## Available events captured in OpenProject + +OpenProject will **add comments** to work package for the following events: + +* Merge Request (Opened, Closed and Merged) +* Issue (Opened, Closed) +* Push commits in Merge Requests + * Since v2.1.5 of the plugin you can activate system hooks for Push events. +* Comments (on Issues, Merge Request, Commits and Snippets) +* Pipelines (Beta feature) + +OpenProject will **update WP status** in this events: + +* Merge Request (opened) - Status: In progress (currently ID=7) +* Merge Request (merged) - Status: Developed (currently ID=8) + +> **Note about the status.** If you want to change the ID of the status you can do this in this section of the [code](https://github.com/btey/openproject-gitlab-integration/blob/master/lib/open_project/gitlab_integration/notification_handler/merge_request_hook.rb#L40-L41). By default is *disabled*, you can enable it by setting to `true` this [lines](https://github.com/btey/openproject-gitlab-integration/blob/master/lib/open_project/gitlab_integration/notification_handler/merge_request_hook.rb#L38-L39). + +## Example workflow + +A typical workflow on GitLab side would be: + +1. **Create Issue.** + + + + > **Issue Opened:** Issue 6 New contact form - OP#18 for Scrum project has been opened by Administrator. + +2. **Comment on issue.** + + If the reference is included in the title, the comments will not need a reference. By default, all comments will use the title as a reference. + + + + > **Commented in Issue:** Administrator commented this WP in Issue 6 New contact form - OP#18 on Scrum project: + > + > New comment on the issue with attachment. + +3. **Create Merge Request.** + + + + > **MR Opened:** Merge request 25 Draft: Resolve "New contact form - OP#18" for Scrum project has been opened by Administrator. + > + > **Status** changed from _Specified_ + > **to** _In progress_ + +4. **Comment in Merge Request.** + + + + > **Commented in MR:** Administrator commented this WP in Merge request 25 Draft: Resolve "New contact form - OP#18" on Scrum project: + > + > New comment on MR. + +5. **Reference in other Issues or Merge Request (comments).** + + If the reference is NOT included in the title of the Issue/MR, the comments will need a reference. In OpenProject the comment will be saved as "referenced" in Issue/MR. + + + + > **Referenced in Issue:** Administrator referenced this WP in Issue 2 New backend pipeline on Scrum project: + > + > OP#18 New comment about... + > + > **Note:** If you use the reference `PP#` in the title of the Issue/MR, you can use `OP#` in the comment to generate the same type of comment in OpenProject. + +6. **New commit in Merge Request.** + + + + > **Pushed in MR:** Administrator pushed fca3d6fb to Scrum project at 2021-03-08T08:01:57+00:00: + > + > Update readme.md OP#18 + +7. **Comment in a new commit of the Merge Request.** + + + + > **Referenced in Commit:** Administrator referenced this WP in a Commit Note 0bf0e3e9 on Scrum project: + > + > This change is for OP#18. + +8. **Merge Request merged (generates up to 3 events).** + + + + > **Pushed in MR:** Administrator pushed 1da09cb4 to Scrum project at 2021-03-05T14:57:37+00:00: + > + > Merge branch '5-new-contact-form-op-18' into 'master' + > + > Resolve "New contact form - OP#18" + > + > Closes #6 + > + > See merge request root/scrum!9 + + + + > **MR Merged:** Merge request 24 Resolve "New contact form - OP#18" for Scrum project has been merged by Administrator. + > + > **Status** changed from _In progress_ + > **to** _Developed_ + + + + > **Issue Closed:** Issue 6 New contact form - OP#18 for Scrum project has been closed by Administrator. + +## Configuration + +You will have to configure both **OpenProject** and **Gitlab** for the integration to work. + +In case of **Docker** installation, follow the official OpenProject documentation [here](https://www.openproject.org/docs/installation-and-operations/installation/docker/#openproject-plugins). If for some reason the installation with Docker described in the official documentation does not work for you, you can try building your own docker image: +* Clone from the Openproject Repo: `git clone https://github.com/opf/openproject.git --branch=stable/13 --depth=1 .` +* Clone the plugin inside the modules folder: `git clone https://github.com/btey/openproject-gitlab-integration.git --depth=1 modules/gitlab_integration` +* Apply the changes below in Gemfile.lock and Gemfile.modules (the same ones you would do in a manual install). +* Build the container: `docker build -t openproject-docker --file=docker/prod/Dockerfile .` +* Now run the image following the official documentation. + +In case of **DEB/RPM** based instalation, follow the official OpenProject documentation [here](https://www.openproject.org/docs/installation-and-operations/configuration/plugins/). + +In case of [**manual**](https://www.openproject.org/docs/installation-and-operations/installation/manual/) installation, this plugin should be installed in the same place as the Github plugin that comes bundled with OpenProject. + +- **Github plugin path:** `modules/github_integration` + +- **Path to put Gitlab plugin:** `modules/gitlab_integration` + +But first you must modify **Gemfile.lock** and **Gemfile.modules** so that OpenProject detects the new module. + +Add the following in **Gemfile.lock**: + +```yml +PATH + remote: modules/gitlab_integration + specs: + openproject-gitlab_integration (2.1.6) + openproject-webhooks +``` + +And add this other line in DEPENDENCIES section: + +```yml +DEPENDENCIES +... + openproject-github_integration! + openproject-gitlab_integration! + openproject-job_status! +... +``` + +Add the following in **Gemfile.modules**: + +```yml +group :opf_plugins do +... + gem 'openproject-gitlab_integration', path: 'modules/gitlab_integration' +... +end +``` + +**Note:** It's possible that you need to use these commands before and after the `bundle install` if you get an error in this step warning about a change in the Gemfile: + +```shell +bundle config unset deployment +bundle install --deployment --without mysql2 sqlite development test therubyracer docker +bundle config set deployment +``` + +### The GitLab Bot user in OpenProject + +First you will need to create a user in OpenProject that will make the comments. The user will have to be added to each project with a role that allows them to comment on work packages and change status. + +Once the user is created you need to generate an OpenProject API token for it to use later on the Gitlab side: + +* Login as the newly created user. +* Go to My Account (click on Avatar in top right corner). +* Go to Access Token. +* Click on generate in the API row. +* Copy the generated key. You can now configure the necessary webhook in Gitlab. + +### The webhook in GitLab + +In GitLab you have to [set up a webhook](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#configure-a-webhook-in-gitlab) in each project or in a group ([Premium Users](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#group-webhooks)) to be integrated with OpenProject. + +You need to configure just two things in the webhook: + +1. The URL must point to your OpenProject server’s GitLab webhook endpoint (/webhooks/gitlab). Append it to the URL as a simple GET parameter named key. In the end the URL should look something like this: + + ``` + http://openproject-url.com/webhooks/gitlab?key=[previous_generated_access_token_key] + ``` + +2. Enable the required triggers: + 1. Push events (project hooks or systems hooks) + 2. Comments + 3. Issues events + 4. Merge request events + 5. Pipeline events + +Now the integration is set up on both sides and you can use it. + +> **Note:** If you are installing and configuring OpenProject on the same server as GitLab you will need to enable in Gitlab the option [`Allow requests to the local network from web hooks and services`](https://docs.gitlab.com/ee/security/webhooks.html#allow-requests-to-the-local-network-from-webhooks-and-integrations) so that it can send the data locally to the OpenProject webhook since they will be on the same machine. + +## How to report bugs or issues + +Any error, bug or issue can be reported by creating a new [issue](https://github.com/btey/openproject-gitlab-integration/issues/new). diff --git a/modules/gitlab_integration/app/models/gitlab_issue.rb b/modules/gitlab_integration/app/models/gitlab_issue.rb new file mode 100644 index 000000000000..61ad3c59f112 --- /dev/null +++ b/modules/gitlab_integration/app/models/gitlab_issue.rb @@ -0,0 +1,86 @@ +#-- encoding: UTF-8 + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +class GitlabIssue < ApplicationRecord + LABEL_KEYS = %w[color title].freeze + + has_and_belongs_to_many :work_packages + belongs_to :gitlab_user, optional: true + + enum state: { + opened: 'opened', + closed: 'closed' + } + + validates_presence_of :gitlab_html_url, + :number, + :repository, + :state, + :title, + :gitlab_updated_at + validates_presence_of :body, + unless: :partial? + validate :validate_labels_schema + + scope :without_work_package, -> { where.missing(:work_packages) } + + def self.find_by_gitlab_identifiers(id: nil, url: nil, initialize: false) + raise ArgumentError, "needs an id or an url" if id.nil? && url.blank? + + found = where(gitlab_id: id).or(where(gitlab_html_url: url)).take + + if found + found + elsif initialize + new(gitlab_id: id, gitlab_html_url: url) + end + end + + def partial? + [body].all?(&:nil?) + end + + private + + def validate_labels_schema + return if labels.nil? + return if labels.all? { |label| label.keys.sort == LABEL_KEYS } + + errors.add(:labels, :invalid_schema) + end + + def with_logging + yield if block_given? + rescue StandardError => e + Rails.logger.error "Error at gitlab issue: #{e} #{e.message}" + raise e + end +end diff --git a/modules/gitlab_integration/app/models/gitlab_merge_request.rb b/modules/gitlab_integration/app/models/gitlab_merge_request.rb new file mode 100644 index 000000000000..ae02a147a74a --- /dev/null +++ b/modules/gitlab_integration/app/models/gitlab_merge_request.rb @@ -0,0 +1,100 @@ +#-- encoding: UTF-8 + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +class GitlabMergeRequest < ApplicationRecord + LABEL_KEYS = %w[color title].freeze + + has_and_belongs_to_many :work_packages + has_many :gitlab_pipelines, dependent: :destroy + belongs_to :gitlab_user, optional: true + belongs_to :merged_by, optional: true, class_name: 'GitlabUser' + + enum state: { + opened: 'opened', + merged: 'merged', + closed: 'closed' + } + + validates_presence_of :gitlab_html_url, + :number, + :repository, + :state, + :title, + :gitlab_updated_at + validates_presence_of :body, + unless: :partial? + validate :validate_labels_schema + + scope :without_work_package, -> { where.missing(:work_packages) } + + def self.find_by_gitlab_identifiers(id: nil, url: nil, initialize: false) + raise ArgumentError, "needs an id or an url" if id.nil? && url.blank? + + found = where(gitlab_id: id).or(where(gitlab_html_url: url)).take + + if found + found + elsif initialize + new(gitlab_id: id, gitlab_html_url: url) + end + end + + ## + # When a MR lives long enough and receives many pushes, the same pipeline CI can be run multiple times. + # This method only returns the latest. + + def latest_pipelines + with_logging do + gitlab_pipelines.select("DISTINCT ON (gitlab_pipelines.project_id, gitlab_pipelines.name) *") + .order(project_id: :asc, name: :asc, started_at: :desc) + end + end + + def partial? + [body].all?(&:nil?) + end + + private + + def validate_labels_schema + return if labels.nil? + return if labels.all? { |label| label.keys.sort == LABEL_KEYS } + + errors.add(:labels, :invalid_schema) + end + + def with_logging + yield if block_given? + rescue StandardError => e + Rails.logger.error "Error at latest_pipeline: #{e} #{e.message}" + raise e + end +end diff --git a/modules/gitlab_integration/app/models/gitlab_pipeline.rb b/modules/gitlab_integration/app/models/gitlab_pipeline.rb new file mode 100644 index 000000000000..24b4c1633122 --- /dev/null +++ b/modules/gitlab_integration/app/models/gitlab_pipeline.rb @@ -0,0 +1,58 @@ +#-- encoding: UTF-8 + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +class GitlabPipeline < ApplicationRecord + belongs_to :gitlab_merge_request, touch: true + + # TODO: confirm with the gitlab documentation what are the different statuses. + enum status: { + created: 'created', + running: 'running', + success: 'success', + waiting: 'waiting', + preparing: 'preparing', + failed: 'failed', + pending: 'pending', + canceled: 'canceled', + skipped: 'skipped', + manual: 'manual', + scheduled: 'scheduled' + } + + validates_presence_of :gitlab_user_avatar_url, + :gitlab_html_url, + :gitlab_id, + :status, + :name, + :ci_details, + :commit_id, + :username +end diff --git a/modules/gitlab_integration/app/models/gitlab_user.rb b/modules/gitlab_integration/app/models/gitlab_user.rb new file mode 100644 index 000000000000..1e0015824da7 --- /dev/null +++ b/modules/gitlab_integration/app/models/gitlab_user.rb @@ -0,0 +1,40 @@ +#-- encoding: UTF-8 + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +class GitlabUser < ApplicationRecord + has_many :gitlab_merge_requests + + validates_presence_of :gitlab_id, + :gitlab_name, + :gitlab_username, + :gitlab_email, + :gitlab_avatar_url +end diff --git a/modules/gitlab_integration/app/workers/cron/clear_old_merge_requests_job.rb b/modules/gitlab_integration/app/workers/cron/clear_old_merge_requests_job.rb new file mode 100644 index 000000000000..fa30113be3af --- /dev/null +++ b/modules/gitlab_integration/app/workers/cron/clear_old_merge_requests_job.rb @@ -0,0 +1,41 @@ +#-- encoding: UTF-8 + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module Cron + class ClearOldMergeRequestsJob < ApplicationJob + priority_number :low + + def perform + GitlabMergeRequest.without_work_package + .find_each(&:destroy!) + end + end +end diff --git a/modules/gitlab_integration/config/locales/crowdin/ar.yml b/modules/gitlab_integration/config/locales/crowdin/ar.yml new file mode 100644 index 000000000000..4640bb302244 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/ar.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ar: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/bg.yml b/modules/gitlab_integration/config/locales/crowdin/bg.yml new file mode 100644 index 000000000000..ac16b593442b --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/bg.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +bg: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/ca.yml b/modules/gitlab_integration/config/locales/crowdin/ca.yml new file mode 100644 index 000000000000..7c4b926621bb --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/ca.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ca: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/cs.yml b/modules/gitlab_integration/config/locales/crowdin/cs.yml new file mode 100644 index 000000000000..5f7350af23d0 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/cs.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +cs: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/da.yml b/modules/gitlab_integration/config/locales/crowdin/da.yml new file mode 100644 index 000000000000..f275e1d3ae93 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/da.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +da: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/de.yml b/modules/gitlab_integration/config/locales/crowdin/de.yml new file mode 100644 index 000000000000..7b9219629559 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/de.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +de: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/el.yml b/modules/gitlab_integration/config/locales/crowdin/el.yml new file mode 100644 index 000000000000..f98c9606f96b --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/el.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +el: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/es.yml b/modules/gitlab_integration/config/locales/crowdin/es.yml new file mode 100644 index 000000000000..964afa0aeb38 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/es.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +es: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/fi.yml b/modules/gitlab_integration/config/locales/crowdin/fi.yml new file mode 100644 index 000000000000..c6c1df440e7b --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/fi.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +fi: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/fil.yml b/modules/gitlab_integration/config/locales/crowdin/fil.yml new file mode 100644 index 000000000000..b2a456b5c216 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/fil.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +fil: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/fr.yml b/modules/gitlab_integration/config/locales/crowdin/fr.yml new file mode 100644 index 000000000000..fef1f113818c --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/fr.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +fr: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/hr.yml b/modules/gitlab_integration/config/locales/crowdin/hr.yml new file mode 100644 index 000000000000..308f94c45cd7 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/hr.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +hr: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/hu.yml b/modules/gitlab_integration/config/locales/crowdin/hu.yml new file mode 100644 index 000000000000..a95e80575304 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/hu.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +hu: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/id.yml b/modules/gitlab_integration/config/locales/crowdin/id.yml new file mode 100644 index 000000000000..bb4954d3c5ef --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/id.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +id: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/it.yml b/modules/gitlab_integration/config/locales/crowdin/it.yml new file mode 100644 index 000000000000..a10cdf8223a1 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/it.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +it: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/ja.yml b/modules/gitlab_integration/config/locales/crowdin/ja.yml new file mode 100644 index 000000000000..cd098bdacdc9 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/ja.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ja: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/js-ar.yml b/modules/gitlab_integration/config/locales/crowdin/js-ar.yml new file mode 100644 index 000000000000..f575fa9efb78 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-ar.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ar: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-bg.yml b/modules/gitlab_integration/config/locales/crowdin/js-bg.yml new file mode 100644 index 000000000000..78c2bb6ec51a --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-bg.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +bg: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-ca.yml b/modules/gitlab_integration/config/locales/crowdin/js-ca.yml new file mode 100644 index 000000000000..723b26e95bc5 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-ca.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ca: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-cs.yml b/modules/gitlab_integration/config/locales/crowdin/js-cs.yml new file mode 100644 index 000000000000..a8905380a2be --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-cs.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +cs: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-da.yml b/modules/gitlab_integration/config/locales/crowdin/js-da.yml new file mode 100644 index 000000000000..c168aaeb6d57 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-da.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +da: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-de.yml b/modules/gitlab_integration/config/locales/crowdin/js-de.yml new file mode 100644 index 000000000000..066a38968913 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-de.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +de: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-el.yml b/modules/gitlab_integration/config/locales/crowdin/js-el.yml new file mode 100644 index 000000000000..6ae410420ed6 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-el.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +el: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-es.yml b/modules/gitlab_integration/config/locales/crowdin/js-es.yml new file mode 100644 index 000000000000..4955957a802d --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-es.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +es: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-fi.yml b/modules/gitlab_integration/config/locales/crowdin/js-fi.yml new file mode 100644 index 000000000000..007068090482 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-fi.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +fi: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-fil.yml b/modules/gitlab_integration/config/locales/crowdin/js-fil.yml new file mode 100644 index 000000000000..5df298917221 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-fil.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +fil: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-fr.yml b/modules/gitlab_integration/config/locales/crowdin/js-fr.yml new file mode 100644 index 000000000000..a4cc350aacd5 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-fr.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +fr: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-hr.yml b/modules/gitlab_integration/config/locales/crowdin/js-hr.yml new file mode 100644 index 000000000000..cb34ab81c26f --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-hr.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +hr: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-hu.yml b/modules/gitlab_integration/config/locales/crowdin/js-hu.yml new file mode 100644 index 000000000000..b584ba1d94d4 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-hu.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +hu: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-id.yml b/modules/gitlab_integration/config/locales/crowdin/js-id.yml new file mode 100644 index 000000000000..922c5bf1d2d2 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-id.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +id: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-it.yml b/modules/gitlab_integration/config/locales/crowdin/js-it.yml new file mode 100644 index 000000000000..f1c7409c29bb --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-it.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +it: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-ja.yml b/modules/gitlab_integration/config/locales/crowdin/js-ja.yml new file mode 100644 index 000000000000..40a8e5fb36ce --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-ja.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ja: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-ko.yml b/modules/gitlab_integration/config/locales/crowdin/js-ko.yml new file mode 100644 index 000000000000..3f58d75b8801 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-ko.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ko: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-lt.yml b/modules/gitlab_integration/config/locales/crowdin/js-lt.yml new file mode 100644 index 000000000000..b612d1be67dc --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-lt.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +lt: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-nl.yml b/modules/gitlab_integration/config/locales/crowdin/js-nl.yml new file mode 100644 index 000000000000..b0c8d39b54b9 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-nl.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +nl: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-no.yml b/modules/gitlab_integration/config/locales/crowdin/js-no.yml new file mode 100644 index 000000000000..d8983e51a0c5 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-no.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +"no": + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-pl.yml b/modules/gitlab_integration/config/locales/crowdin/js-pl.yml new file mode 100644 index 000000000000..35e9c52f07b7 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-pl.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +pl: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-pt.yml b/modules/gitlab_integration/config/locales/crowdin/js-pt.yml new file mode 100644 index 000000000000..b265a3a11bc2 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-pt.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +pt: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-ro.yml b/modules/gitlab_integration/config/locales/crowdin/js-ro.yml new file mode 100644 index 000000000000..fc8bbb0003e6 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-ro.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ro: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-ru.yml b/modules/gitlab_integration/config/locales/crowdin/js-ru.yml new file mode 100644 index 000000000000..e1877b525340 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-ru.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ru: + js: + gitlab_integration: + work_packages: + tab_name: GitLab + tab_header_issue: + title: Обсуждения + tab_header_mr: + title: Запросы на слияние + create_mr: + label: Создать запрос на слияние + description: Создать запрос на слияние + copy_menu: + label: Git-подсказки + description: Скопипастить Git-подсказки + git_actions: + branch_name: Имя ветки + commit_message: Описание коммита + cmd: Создать ветку с пустым коммитом + title: Git-подсказки + copy_success: ✅ Скопировано + copy_error: ❌ Не получилось скопировать + tab_issue: + empty: Нет связанных обсуждений. Привязать обсуждение можно путём вставки кода OP#%{wp_id} (или PP#%{wp_id} для приватных ссылок) в заголовке/описании при создании/редактировании обсуждения. + tab_mrs: + empty: Нет связанных запросов на слияние. Привязать запрос на слияние можно путём вставки кода OP#%{wp_id} (или PP#%{wp_id} для приватных ссылок) в заголовке/описании при создании/редактировании запроса на слияние. + gitlab_pipelines: Сборочные линии (pipelines) + updated_on: Обновлено diff --git a/modules/gitlab_integration/config/locales/crowdin/js-sk.yml b/modules/gitlab_integration/config/locales/crowdin/js-sk.yml new file mode 100644 index 000000000000..2899069e371c --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-sk.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +sk: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-sl.yml b/modules/gitlab_integration/config/locales/crowdin/js-sl.yml new file mode 100644 index 000000000000..3cbbfd9a6415 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-sl.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +sl: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-sv.yml b/modules/gitlab_integration/config/locales/crowdin/js-sv.yml new file mode 100644 index 000000000000..48f132e89919 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-sv.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +sv: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-tr.yml b/modules/gitlab_integration/config/locales/crowdin/js-tr.yml new file mode 100644 index 000000000000..c5e59b0d4668 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-tr.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +tr: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-uk.yml b/modules/gitlab_integration/config/locales/crowdin/js-uk.yml new file mode 100644 index 000000000000..b3088532bdd7 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-uk.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +uk: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-vi.yml b/modules/gitlab_integration/config/locales/crowdin/js-vi.yml new file mode 100644 index 000000000000..e1dffccfdeb5 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-vi.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +vi: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-zh-CN.yml b/modules/gitlab_integration/config/locales/crowdin/js-zh-CN.yml new file mode 100644 index 000000000000..59d1d96f0233 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-zh-CN.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +zh-CN: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/js-zh-TW.yml b/modules/gitlab_integration/config/locales/crowdin/js-zh-TW.yml new file mode 100644 index 000000000000..2b5dddb91aa6 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/js-zh-TW.yml @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +zh-TW: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/config/locales/crowdin/ko.yml b/modules/gitlab_integration/config/locales/crowdin/ko.yml new file mode 100644 index 000000000000..cff63d5f4b2c --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/ko.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ko: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/lt.yml b/modules/gitlab_integration/config/locales/crowdin/lt.yml new file mode 100644 index 000000000000..1fe1bc3535bc --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/lt.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +lt: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/nl.yml b/modules/gitlab_integration/config/locales/crowdin/nl.yml new file mode 100644 index 000000000000..2af08592ddc6 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/nl.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +nl: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/no.yml b/modules/gitlab_integration/config/locales/crowdin/no.yml new file mode 100644 index 000000000000..37d905e95408 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/no.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +"no": + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/pl.yml b/modules/gitlab_integration/config/locales/crowdin/pl.yml new file mode 100644 index 000000000000..1be5da1f1162 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/pl.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +pl: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/pt.yml b/modules/gitlab_integration/config/locales/crowdin/pt.yml new file mode 100644 index 000000000000..473327d92560 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/pt.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +pt: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/ro.yml b/modules/gitlab_integration/config/locales/crowdin/ro.yml new file mode 100644 index 000000000000..2032891af2d9 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/ro.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ro: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/ru.yml b/modules/gitlab_integration/config/locales/crowdin/ru.yml new file mode 100644 index 000000000000..829c50e3fcbd --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/ru.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +ru: + project_module_gitlab: GitLab + permission_show_gitlab_content: Показывать GitLab-контент + gitlab_integration: + merge_request_opened_comment: > + **MR Открыт:** Запрос на слияние %{mr_number} [%{mr_title}](%{mr_url}) в [%{repository}](%{repository_url}) + был открыт [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Закрыт:** Запрос на слияние %{mr_number} [%{mr_title}](%{mr_url}) в [%{repository}](%{repository_url}) + был закрыт by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Смержен:** Запрос на слияние %{mr_number} [%{mr_title}](%{mr_url}) в [%{repository}](%{repository_url}) + был смержен [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Переоткрыт:** Запрос на слияние %{mr_number} [%{mr_title}](%{mr_url}) в [%{repository}](%{repository_url}) + был переоткрыт [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Упомянут в коммите:** [%{gitlab_user}](%{gitlab_user_url}) отметил эту задачу в + a коммите [%{commit_id}](%{commit_url}) в [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Упомянут в MR:** [%{gitlab_user}](%{gitlab_user_url}) отметил эту задачу в + запросе на слияние %{mr_number} [%{mr_title}](%{mr_url}) в [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Комментарий в MR:** [%{gitlab_user}](%{gitlab_user_url}) комментировал эту задачу в + запросе на слияние %{mr_number} [%{mr_title}](%{mr_url}) в [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Упомянут в обсуждении:** [%{gitlab_user}](%{gitlab_user_url}) отметил эту задачу в + Обсуждение %{issue_number} [%{issue_title}](%{issue_url}) в [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Комментарий в обсуждении:** [%{gitlab_user}](%{gitlab_user_url}) комментировал эту задачу в + обсуждении %{issue_number} [%{issue_title}](%{issue_url}) в [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Упомянут в Snippet:** [%{gitlab_user}](%{gitlab_user_url}) отметил эту задачу в + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) в [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Обсуждение открыто:** Обсуждение %{issue_number} [%{issue_title}](%{issue_url}) в [%{repository}](%{repository_url}) + был открыт [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Обсуждение закрыто:** Обсуждение %{issue_number} [%{issue_title}](%{issue_url}) в [%{repository}](%{repository_url}) + был закрыт [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Обсуждение переоткрыто:** Обсуждение %{issue_number} [%{issue_title}](%{issue_url}) в [%{repository}](%{repository_url}) + было переоткрыто [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Коммит:** [%{gitlab_user}](%{gitlab_user_url}) закоммитил [%{commit_number}](%{commit_url}) + в [%{repository}](%{repository_url}) %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Коммит в MR:** [%{gitlab_user}](%{gitlab_user_url}) закоммитил несколько коммитов [%{commit_number}](%{commit_url}) + в [%{repository}](%{repository_url}) %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/sk.yml b/modules/gitlab_integration/config/locales/crowdin/sk.yml new file mode 100644 index 000000000000..424d97842e61 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/sk.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +sk: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/sl.yml b/modules/gitlab_integration/config/locales/crowdin/sl.yml new file mode 100644 index 000000000000..e25178e640a9 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/sl.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +sl: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/sv.yml b/modules/gitlab_integration/config/locales/crowdin/sv.yml new file mode 100644 index 000000000000..34fed669dcd9 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/sv.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +sv: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/tr.yml b/modules/gitlab_integration/config/locales/crowdin/tr.yml new file mode 100644 index 000000000000..0c8fd994f742 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/tr.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +tr: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/uk.yml b/modules/gitlab_integration/config/locales/crowdin/uk.yml new file mode 100644 index 000000000000..039c8ca03e44 --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/uk.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +uk: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/vi.yml b/modules/gitlab_integration/config/locales/crowdin/vi.yml new file mode 100644 index 000000000000..0f293629c13b --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/vi.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +vi: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/zh-CN.yml b/modules/gitlab_integration/config/locales/crowdin/zh-CN.yml new file mode 100644 index 000000000000..57a96873f18d --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/zh-CN.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +zh-CN: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/crowdin/zh-TW.yml b/modules/gitlab_integration/config/locales/crowdin/zh-TW.yml new file mode 100644 index 000000000000..2361760b3f2c --- /dev/null +++ b/modules/gitlab_integration/config/locales/crowdin/zh-TW.yml @@ -0,0 +1,93 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +zh-TW: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/de.yml b/modules/gitlab_integration/config/locales/de.yml new file mode 100644 index 000000000000..af758b73f718 --- /dev/null +++ b/modules/gitlab_integration/config/locales/de.yml @@ -0,0 +1,95 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +de: + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge Request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge Request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/en.yml b/modules/gitlab_integration/config/locales/en.yml new file mode 100644 index 000000000000..ce7058e0c16f --- /dev/null +++ b/modules/gitlab_integration/config/locales/en.yml @@ -0,0 +1,107 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +en: + activerecord: + errors: + models: + gitlab_issue: + attributes: + labels: + invalid_schema: "must be an array of hashes with keys: color, title" + gitlab_merge_request: + attributes: + labels: + invalid_schema: "must be an array of hashes with keys: color, title" + + project_module_gitlab: "Gitlab" + permission_show_gitlab_content: "Show Gitlab content" + + gitlab_integration: + merge_request_opened_comment: > + **MR Opened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_closed_comment: > + **MR Closed:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_merged_comment: > + **MR Merged:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been merged by [%{gitlab_user}](%{gitlab_user_url}). + merge_request_reopened_comment: > + **MR Reopened:** Merge request %{mr_number} [%{mr_title}](%{mr_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + note_commit_referenced_comment: > + **Referenced in Commit:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + a Commit Note [%{commit_id}](%{commit_url}) on [%{repository}](%{repository_url}): + + %{commit_note} + note_mr_referenced_comment: > + **Referenced in MR:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Merge Request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_mr_commented_comment: > + **Commented in MR:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Merge Request %{mr_number} [%{mr_title}](%{mr_url}) on [%{repository}](%{repository_url}): + + %{mr_note} + note_issue_referenced_comment: > + **Referenced in Issue:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_issue_commented_comment: > + **Commented in Issue:** [%{gitlab_user}](%{gitlab_user_url}) commented this WP in + Issue %{issue_number} [%{issue_title}](%{issue_url}) on [%{repository}](%{repository_url}): + + %{issue_note} + note_snippet_referenced_comment: > + **Referenced in Snippet:** [%{gitlab_user}](%{gitlab_user_url}) referenced this WP in + Snippet %{snippet_number} [%{snippet_title}](%{snippet_url}) on [%{repository}](%{repository_url}): + + %{snippet_note} + issue_opened_referenced_comment: > + **Issue Opened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been opened by [%{gitlab_user}](%{gitlab_user_url}). + issue_closed_referenced_comment: > + **Issue Closed:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been closed by [%{gitlab_user}](%{gitlab_user_url}). + issue_reopened_referenced_comment: > + **Issue Reopened:** Issue %{issue_number} [%{issue_title}](%{issue_url}) for [%{repository}](%{repository_url}) + has been reopened by [%{gitlab_user}](%{gitlab_user_url}). + push_single_commit_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} + push_multiple_commits_comment: > + **Pushed in MR:** [%{gitlab_user}](%{gitlab_user_url}) pushed multiple commits [%{commit_number}](%{commit_url}) + to [%{repository}](%{repository_url}) at %{commit_timestamp}: + + %{commit_note} diff --git a/modules/gitlab_integration/config/locales/js-en.yml b/modules/gitlab_integration/config/locales/js-en.yml new file mode 100644 index 000000000000..fac3b06a28ff --- /dev/null +++ b/modules/gitlab_integration/config/locales/js-en.yml @@ -0,0 +1,57 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +en: + js: + gitlab_integration: + work_packages: + tab_name: "GitLab" + tab_header_issue: + title: "Issues" + tab_header_mr: + title: "Merge requests" + create_mr: + label: Create MR + description: Create a Merge Request + copy_menu: + label: Git snippets + description: Copy git snippets to clipboard + git_actions: + branch_name: Branch name + commit_message: Commit message + cmd: Create branch with empty commit + title: Quick snippets for Git + copy_success: ✅ Copied! + copy_error: ❌ Copy failed! + tab_issue: + empty: There are no issues linked yet. Link an existing issue by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the issue title/description or create a new issue. + tab_mrs: + empty: There are no merge requests linked yet. Link an existing MR by using the code OP#%{wp_id} (or PP#%{wp_id} for private links) in the MR title/description or create a new MR. + gitlab_pipelines: Pipelines + updated_on: Updated on diff --git a/modules/gitlab_integration/db/migrate/20211015110000_gitlab_integration_models.rb b/modules/gitlab_integration/db/migrate/20211015110000_gitlab_integration_models.rb new file mode 100644 index 000000000000..847183710ae5 --- /dev/null +++ b/modules/gitlab_integration/db/migrate/20211015110000_gitlab_integration_models.rb @@ -0,0 +1,87 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +class GitlabIntegrationModels < ActiveRecord::Migration[6.1] + # rubocop:disable Metrics/AbcSize + def change + create_table :gitlab_merge_requests do |t| + t.references :gitlab_user + t.references :merged_by + + t.bigint :gitlab_id, unique: true + t.integer :number, null: false + t.string :gitlab_html_url, null: false, unique: true + t.string :state, null: false + t.string :repository, null: false + t.datetime :gitlab_updated_at + t.string :title + t.text :body + t.boolean :draft + t.boolean :merged + t.datetime :merged_at + t.json :labels # [{name, color}] + + t.timestamps + end + + create_join_table :gitlab_merge_requests, :work_packages do |t| + t.index :gitlab_merge_request_id, name: 'gitlab_mr_wp_mr_id' + t.index %i[gitlab_merge_request_id work_package_id], + unique: true, + name: "unique_index_gl_mrs_wps_on_gl_mr_id_and_wp_id" + end + + create_table :gitlab_users do |t| + t.bigint :gitlab_id, null: false, unique: true + t.string :gitlab_name, null: false + t.string :gitlab_username, null: false + t.string :gitlab_email, null: false + t.string :gitlab_avatar_url, null: false + + t.timestamps + end + + create_table :gitlab_pipelines do |t| + t.references :gitlab_merge_request, null: false + + t.bigint :gitlab_id, null: false, unique: true + t.string :gitlab_html_url, null: false + t.bigint :project_id, null: false + t.string :gitlab_user_avatar_url, null: false + t.string :status, null: false + t.string :name, null: false + t.string :details_url + t.json :ci_details + t.datetime :started_at + t.datetime :completed_at + + t.timestamps + end + end + # rubocop:enable Metrics/AbcSize +end diff --git a/modules/gitlab_integration/db/migrate/20211015110001_add_username_commit_to_pipelines.rb b/modules/gitlab_integration/db/migrate/20211015110001_add_username_commit_to_pipelines.rb new file mode 100644 index 000000000000..2b621fa742d5 --- /dev/null +++ b/modules/gitlab_integration/db/migrate/20211015110001_add_username_commit_to_pipelines.rb @@ -0,0 +1,36 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +class AddUsernameCommitToPipelines < ActiveRecord::Migration[7.0] + def change + add_column :gitlab_pipelines, :username, :text + + add_column :gitlab_pipelines, :commit_id, :text + end +end diff --git a/modules/gitlab_integration/db/migrate/20211015110002_add_gitlab_issues.rb b/modules/gitlab_integration/db/migrate/20211015110002_add_gitlab_issues.rb new file mode 100644 index 000000000000..6256a34212fe --- /dev/null +++ b/modules/gitlab_integration/db/migrate/20211015110002_add_gitlab_issues.rb @@ -0,0 +1,54 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +class AddGitlabIssues < ActiveRecord::Migration[7.0] + def change + create_table :gitlab_issues do |t| + t.references :gitlab_user + + t.bigint :gitlab_id, unique: true + t.integer :number, null: false + t.string :gitlab_html_url, null: false, unique: true + t.string :state, null: false + t.string :repository, null: false + t.datetime :gitlab_updated_at + t.string :title + t.text :body + t.json :labels # [{name, color}] + + t.timestamps + end + + create_join_table :gitlab_issues, :work_packages do |t| + t.index :gitlab_issue_id, name: 'gitlab_issues_wp_issue_id' + t.index %i[gitlab_issue_id work_package_id], + unique: true, + name: "unique_index_gl_issues_wps_on_gl_issue_id_and_wp_id" + end + end +end diff --git a/modules/gitlab_integration/doc/op-commented-in-issue.png b/modules/gitlab_integration/doc/op-commented-in-issue.png new file mode 100644 index 000000000000..f3d0c13d15e8 Binary files /dev/null and b/modules/gitlab_integration/doc/op-commented-in-issue.png differ diff --git a/modules/gitlab_integration/doc/op-commented-in-mr.png b/modules/gitlab_integration/doc/op-commented-in-mr.png new file mode 100644 index 000000000000..523918e91cfa Binary files /dev/null and b/modules/gitlab_integration/doc/op-commented-in-mr.png differ diff --git a/modules/gitlab_integration/doc/op-issue-opened.png b/modules/gitlab_integration/doc/op-issue-opened.png new file mode 100644 index 000000000000..7388422ced75 Binary files /dev/null and b/modules/gitlab_integration/doc/op-issue-opened.png differ diff --git a/modules/gitlab_integration/doc/op-mr-merged-event-1.png b/modules/gitlab_integration/doc/op-mr-merged-event-1.png new file mode 100644 index 000000000000..a4f82308f2ff Binary files /dev/null and b/modules/gitlab_integration/doc/op-mr-merged-event-1.png differ diff --git a/modules/gitlab_integration/doc/op-mr-merged-event-2.png b/modules/gitlab_integration/doc/op-mr-merged-event-2.png new file mode 100644 index 000000000000..3cd3c523c8d0 Binary files /dev/null and b/modules/gitlab_integration/doc/op-mr-merged-event-2.png differ diff --git a/modules/gitlab_integration/doc/op-mr-merged-event-3.png b/modules/gitlab_integration/doc/op-mr-merged-event-3.png new file mode 100644 index 000000000000..f0b9c055aacc Binary files /dev/null and b/modules/gitlab_integration/doc/op-mr-merged-event-3.png differ diff --git a/modules/gitlab_integration/doc/op-mr-merged-event-4.png b/modules/gitlab_integration/doc/op-mr-merged-event-4.png new file mode 100644 index 000000000000..aa4ff622a61d Binary files /dev/null and b/modules/gitlab_integration/doc/op-mr-merged-event-4.png differ diff --git a/modules/gitlab_integration/doc/op-mr-opened.png b/modules/gitlab_integration/doc/op-mr-opened.png new file mode 100644 index 000000000000..50e0a57f2ad6 Binary files /dev/null and b/modules/gitlab_integration/doc/op-mr-opened.png differ diff --git a/modules/gitlab_integration/doc/op-pushed-in-mr.png b/modules/gitlab_integration/doc/op-pushed-in-mr.png new file mode 100644 index 000000000000..2550e592afe8 Binary files /dev/null and b/modules/gitlab_integration/doc/op-pushed-in-mr.png differ diff --git a/modules/gitlab_integration/doc/op-referenced-in-commit.png b/modules/gitlab_integration/doc/op-referenced-in-commit.png new file mode 100644 index 000000000000..f223df82eff4 Binary files /dev/null and b/modules/gitlab_integration/doc/op-referenced-in-commit.png differ diff --git a/modules/gitlab_integration/doc/op-referenced-in-issue.png b/modules/gitlab_integration/doc/op-referenced-in-issue.png new file mode 100644 index 000000000000..0724dde7d345 Binary files /dev/null and b/modules/gitlab_integration/doc/op-referenced-in-issue.png differ diff --git a/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts b/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts new file mode 100644 index 000000000000..a4130a908783 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.component.ts @@ -0,0 +1,106 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import copy from 'copy-text-to-clipboard'; +import { Component, Inject, Input } from '@angular/core'; +import { GitActionsService } from '../git-actions/git-actions.service'; +import { ISnippet } from "core-app/features/plugins/linked/openproject-gitlab_integration/typings"; +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; +import { OPContextMenuComponent } from "core-app/shared/components/op-context-menu/op-context-menu.component"; +import { + OpContextMenuLocalsMap, + OpContextMenuLocalsToken +} from "core-app/shared/components/op-context-menu/op-context-menu.types"; +import { I18nService } from "core-app/core/i18n/i18n.service"; + + +@Component({ + selector: 'op-git-actions-menu', + templateUrl: './git-actions-menu.template.html', + styleUrls: [ + './styles/git-actions-menu.sass' + ] +}) +export class GitActionsMenuComponent extends OPContextMenuComponent { + @Input() public workPackage:WorkPackageResource; + + public text = { + title: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.title'), + copyButtonHelpText: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.copy_button_help'), + copyResult: { + success: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.copy_success'), + error: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.copy_error') + } + }; + + public lastCopyResult:string = this.text.copyResult.success; + public showCopyResult:boolean = false; + public copiedSnippetId:string = ''; + + public snippets:ISnippet[] = [ + { + id: 'branch', + name: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.branch_name'), + textToCopy: () => this.gitActions.branchName(this.workPackage) + }, + { + id: 'message', + name: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.commit_message'), + textToCopy: () => this.gitActions.commitMessage(this.workPackage) + }, + { + id: 'command', + name: this.I18n.t('js.gitlab_integration.tab_header_mr.git_actions.cmd'), + textToCopy: () => this.gitActions.gitCommand(this.workPackage) + }, + ]; + + constructor(@Inject(OpContextMenuLocalsToken) + public locals:OpContextMenuLocalsMap, + readonly I18n:I18nService, + readonly gitActions:GitActionsService) { + super(locals); + this.workPackage = this.locals.workPackage; + } + + public onCopyButtonClick(snippet:ISnippet):void { + const success = copy(snippet.textToCopy()); + + if (success) { + this.lastCopyResult = this.text.copyResult.success; + } else { + this.lastCopyResult = this.text.copyResult.error; + } + this.copiedSnippetId = snippet.id; + this.showCopyResult = true; + window.setTimeout(() => { + this.showCopyResult = false; + }, 2000); + } +} diff --git a/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.directive.ts b/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.directive.ts new file mode 100644 index 000000000000..d20b2fc18618 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.directive.ts @@ -0,0 +1,61 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { OpContextMenuItem } from 'core-app/shared/components/op-context-menu/op-context-menu.types'; +import { OPContextMenuService } from 'core-app/shared/components/op-context-menu/op-context-menu.service'; +import { Directive, ElementRef, Input } from '@angular/core'; +import { OpContextMenuTrigger } from 'core-app/shared/components/op-context-menu/handlers/op-context-menu-trigger.directive'; +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; +import { GitActionsMenuComponent } from './git-actions-menu.component'; + + +@Directive({ + selector: '[gitActionsCopyDropdown]' +}) +export class GitActionsMenuDirective extends OpContextMenuTrigger { + @Input('gitActionsCopyDropdown-workPackage') public workPackage:WorkPackageResource; + + constructor(readonly elementRef:ElementRef, + readonly opContextMenu:OPContextMenuService) { + super(elementRef, opContextMenu); + } + + protected open(evt:JQuery.TriggeredEvent) { + this.opContextMenu.show(this, evt, GitActionsMenuComponent); + } + + public get locals():{ showAnchorRight?:boolean, contextMenuId?:string, items:OpContextMenuItem[], workPackage:WorkPackageResource } { + return { + workPackage: this.workPackage, + contextMenuId: 'gitlab-integration-git-actions-menu', + items: [] + }; + } +} + diff --git a/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.template.html b/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.template.html new file mode 100644 index 000000000000..0c2421885537 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/git-actions-menu/git-actions-menu.template.html @@ -0,0 +1,22 @@ + + + diff --git a/modules/gitlab_integration/frontend/module/git-actions-menu/styles/git-actions-menu.sass b/modules/gitlab_integration/frontend/module/git-actions-menu/styles/git-actions-menu.sass new file mode 100644 index 000000000000..b502c7bcd3a3 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/git-actions-menu/styles/git-actions-menu.sass @@ -0,0 +1,90 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ +.git-actions-menu + background-color: var(--body-background) + border: var(--content-default-border-width) solid var(--content-default-border-color) + padding: 1rem 1rem 2rem 1rem + min-width: 25rem + box-shadow: .1em .1em .4em rgba(0,0,0,0.1) + + .copy-wrapper + width: 100% + position: relative + margin-bottom: 1rem + + .copy-content + width: calc(100% - 3em) + // the min-height should be the size of the copy-icon, which is the sum of: + // 2 * button padding (0.65em) + // font-size of the icon (0.9em) + // 1px where I don't know where it comes from + min-height: calc(2 * 0.65em + 0.9em + 1px) + border-radius: 2px 0 0 2px + padding: 0.65em + color: var(--gray-dark) + white-space: pre + resize: none + font-size: 0.9rem + display: inline-block + + .copy-button + margin: 0 + border: 1px solid #ccc + border-radius: 0 2px 2px 0 + vertical-align: top + left: -1px + position: relative + font-size: 0.9rem + + &:hover + border-color: #999 + + .copy-result-message + background-color: var(--main-menu-bg-color) + display: inline-block + padding: 0.5em + border-radius: 5px + color: var(--main-menu-font-color) + position: absolute + right: 0 + top: calc(2 * 0.65em + 0.9em + 1px + 9px) + box-shadow: 1px 1px 4px var(--gray-dark) + z-index: 1 + + &:before + content: "" + border-bottom: 0.6em solid var(--main-menu-bg-color) + height: 0 + width: 0 + position: absolute + top: -9px + right: 10px + border-left: 0.3em solid transparent + border-right: 0.3em solid transparent + diff --git a/modules/gitlab_integration/frontend/module/git-actions/git-actions.service.ts b/modules/gitlab_integration/frontend/module/git-actions/git-actions.service.ts new file mode 100644 index 000000000000..27688d8f8fbb --- /dev/null +++ b/modules/gitlab_integration/frontend/module/git-actions/git-actions.service.ts @@ -0,0 +1,89 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { Injectable } from '@angular/core'; +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; + +// probably not providable in root when we want to cache the formatter and set custom templates +@Injectable({ + providedIn: 'root', +}) +export class GitActionsService { + private sanitizeBranchString(str:string):string { + // See https://stackoverflow.com/a/3651867 for how these rules came in. + // This sanitization tries to be harsher than those rules + return str + .replace(/&/g, 'and ') // & becomes and + .replace(/ +/g, '-') // Spaces become dashes + .replace(/[\000-\039]/g, '') // ASCII control characters are out + .replace(/\177/g, '') // DEL is out + .replace(/[#\\\/\?\*\~\^\:\{\}@\.\[\]'"]/g, '') // Some other characters with special rules are out + .replace(/^[-]+/g, '') // Dashes at the start are removed + .replace(/[-]+$/g, '') // Dashes at the end are removed + .replace(/-+/g, '-') // Multiple dashes in a row are deduped + .trim(); + } + + private formattingInput(workPackage: WorkPackageResource) { + const type = workPackage.type.name || ''; + const id = workPackage.id || ''; + const title = workPackage.subject; + const url = window.location.origin + workPackage.pathHelper.workPackagePath(id); + const description = ''; + + return({ + id, type, title, url, description + }); + } + + private sanitizeShellInput(str:string):string { + return `${str.replace(/'/g, '\\\'')}`; + } + + public branchName(workPackage:WorkPackageResource):string { + const { type, id, title } = this.formattingInput(workPackage); + return `${this.sanitizeBranchString(type)}/${id}-${this.sanitizeBranchString(title)}`.toLocaleLowerCase(); + } + + public commitMessage(workPackage:WorkPackageResource):string { + const { title, id, description, url } = this.formattingInput(workPackage); + return `OP#${id} ${title} + +${description} + +${url} +`.replace(/\n\n+/g, '\n\n'); + } + + public gitCommand(workPackage:WorkPackageResource):string { + const branch = this.branchName(workPackage); + const commit = this.commitMessage(workPackage); + return `git checkout -b '${this.sanitizeShellInput(branch)}' && git commit --allow-empty -m '${this.sanitizeShellInput(commit)}'`; + } +} diff --git a/modules/gitlab_integration/frontend/module/gitlab-tab/gitlab-tab.component.sass b/modules/gitlab_integration/frontend/module/gitlab-tab/gitlab-tab.component.sass new file mode 100644 index 000000000000..06056041ad2d --- /dev/null +++ b/modules/gitlab_integration/frontend/module/gitlab-tab/gitlab-tab.component.sass @@ -0,0 +1,36 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +@import "helpers" + +:host, +.gitlab-header + position: sticky + top: 0 + z-index: 850 // Ensure the header is above other content diff --git a/modules/gitlab_integration/frontend/module/gitlab-tab/gitlab-tab.component.ts b/modules/gitlab_integration/frontend/module/gitlab-tab/gitlab-tab.component.ts new file mode 100644 index 000000000000..c7f28a1a2536 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/gitlab-tab/gitlab-tab.component.ts @@ -0,0 +1,49 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { Component, Input } from '@angular/core'; +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; +import { TabComponent } from "core-app/features/work-packages/components/wp-tabs/components/wp-tab-wrapper/tab"; +import { I18nService } from "core-app/core/i18n/i18n.service"; +import { PathHelperService } from "core-app/core/path-helper/path-helper.service"; + +@Component({ + selector: 'gitlab-tab', + templateUrl: './gitlab-tab.template.html', + styleUrls: [ + './gitlab-tab.component.sass', + ] +}) +export class GitlabTabComponent implements TabComponent { + @Input() public workPackage:WorkPackageResource; + + constructor(readonly PathHelper:PathHelperService, + readonly I18n:I18nService) { + } +} diff --git a/modules/gitlab_integration/frontend/module/gitlab-tab/gitlab-tab.template.html b/modules/gitlab_integration/frontend/module/gitlab-tab/gitlab-tab.template.html new file mode 100644 index 000000000000..a7c04a6dfc13 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/gitlab-tab/gitlab-tab.template.html @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/gitlab_integration/frontend/module/hal/resources/gitlab-issue-resource.ts b/modules/gitlab_integration/frontend/module/hal/resources/gitlab-issue-resource.ts new file mode 100644 index 000000000000..f095a717e933 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/hal/resources/gitlab-issue-resource.ts @@ -0,0 +1,43 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { HalResource } from "core-app/features/hal/resources/hal-resource"; + +export class GitlabIssueResource extends HalResource { + public get state() { + return this.states.projects.get(this.id!) as any; + } + + /** + * Exclude the schema _link from the linkable Resources. + */ + public $linkableKeys():string[] { + return _.without(super.$linkableKeys(), 'schema'); + } +} diff --git a/modules/gitlab_integration/frontend/module/hal/resources/gitlab-merge-request-resource.ts b/modules/gitlab_integration/frontend/module/hal/resources/gitlab-merge-request-resource.ts new file mode 100644 index 000000000000..49a6c510a672 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/hal/resources/gitlab-merge-request-resource.ts @@ -0,0 +1,43 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { HalResource } from "core-app/features/hal/resources/hal-resource"; + +export class GitlabMergeRequestResource extends HalResource { + public get state() { + return this.states.projects.get(this.id!) as any; + } + + /** + * Exclude the schema _link from the linkable Resources. + */ + public $linkableKeys():string[] { + return _.without(super.$linkableKeys(), 'schema'); + } +} diff --git a/modules/gitlab_integration/frontend/module/hal/resources/gitlab-user-resource.ts b/modules/gitlab_integration/frontend/module/hal/resources/gitlab-user-resource.ts new file mode 100644 index 000000000000..c729a5b82d75 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/hal/resources/gitlab-user-resource.ts @@ -0,0 +1,43 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { HalResource } from "core-app/features/hal/resources/hal-resource"; + +export class GitlabUserResource extends HalResource { + public get state() { + return this.states.projects.get(this.id!) as any; + } + + /** + * Exclude the schema _link from the linkable Resources. + */ + public $linkableKeys():string[] { + return _.without(super.$linkableKeys(), 'schema'); + } +} diff --git a/modules/gitlab_integration/frontend/module/icons/gitlab-icons.svg b/modules/gitlab_integration/frontend/module/icons/gitlab-icons.svg new file mode 100644 index 000000000000..13acb8a8da1d --- /dev/null +++ b/modules/gitlab_integration/frontend/module/icons/gitlab-icons.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/gitlab_integration/frontend/module/issue/issue.component.html b/modules/gitlab_integration/frontend/module/issue/issue.component.html new file mode 100644 index 000000000000..284db7059d56 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/issue/issue.component.html @@ -0,0 +1,51 @@ +
+ + + + {{state}} | + + + + + +
+ {{ text.label_created_by }} + + + . + + + {{ text.label_last_updated_on }} + + . +
+ + diff --git a/modules/gitlab_integration/frontend/module/issue/issue.component.sass b/modules/gitlab_integration/frontend/module/issue/issue.component.sass new file mode 100644 index 000000000000..9d3e946adf66 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/issue/issue.component.sass @@ -0,0 +1,151 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +@import "helpers" + +:host, +.op-issue + display: grid + grid-template-columns: minmax(270px, auto) auto 1fr + grid-template-areas: "title title title" "info_created info_created info_created" "state label_icon label_icon" "label label label" + margin-bottom: 5px + margin-top: 5px + padding-bottom: 4px + padding-top: 4px + border-bottom: 1px solid #dddddd + + &:last-child + border-bottom: none + + &--iconsize + width: 16px + height: 16px + vertical-align: -3px + + &--title + @include text-shortener + font-weight: bold + grid-area: title + line-height: 22px + margin-right: 20px + + &--avatar + grid-area: info + + &--info_created + @include text-shortener + display: block + grid-area: info_created + font-size: 0.75rem + color: var(--gray-dark) + margin-bottom: 3px + + &--info_updated + @include text-shortener + display: block + grid-area: info_updated + font-size: 0.75rem + color: var(--gray-dark) + margin-top: -4px + + &--username + color: var(--gray-dark) + text-decoration: none + + &--labels + display: none + grid-area: label + font-size: 0.9rem + color: var(--gray-dark) + margin-top: 10px + + &--label + display: inline-block + padding: 2px 0.5rem 2px 0.5rem + border-radius: 10rem + border: 1px solid #fff + color: #fff + font-size: 0.8rem + + &--link + font-size: 0.8rem + text-decoration: none + + &_open + background-color: #c3e6cd + color: #24663b + fill: #24663b + + &_closed + background-color: #cbe2f9 + color: #0b5cad + fill: #0b5cad + + &--label_icon + grid-area: label_icon + display: inline-block + padding: 4px 6px + border-radius: 10rem + font-size: 0.8rem + font-weight: 400 + align-self: center + width: fit-content + margin-right: 6px + border: 1px solid #cecdd4 + background-color: #f3f3f3 + + &:hover + border: 1px solid #b6b5ba + background-color: #e4e4e4 + + &_style + fill: #737278 + + &--state + grid-area: state + display: inline-block + padding: 5px 0.6rem 5px 0.6rem + border-radius: 10rem + font-size: 0.8rem + font-weight: 400 + text-transform: capitalize + align-self: center + white-space: nowrap + width: fit-content + margin-right: 6px + + &_open + background-color: #c3e6cd + color: #24663b + fill: #24663b + + &_closed + background-color: #cbe2f9 + color: #0b5cad + fill: #0b5cad diff --git a/modules/gitlab_integration/frontend/module/issue/issue.component.ts b/modules/gitlab_integration/frontend/module/issue/issue.component.ts new file mode 100644 index 000000000000..3c260b8186d1 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/issue/issue.component.ts @@ -0,0 +1,72 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { Component, Input } from '@angular/core'; +import { PathHelperService } from 'core-app/core/path-helper/path-helper.service'; +import { I18nService } from 'core-app/core/i18n/i18n.service'; +import {IGitlabIssueResource} from 'core-app/features/plugins/linked/openproject-gitlab_integration/typings'; + +@Component({ + selector: 'gitlab-issue', + templateUrl: './issue.component.html', + styleUrls: [ + './issue.component.sass', + ], + host: { class: 'op-issue' } +}) + +export class IssueComponent { + @Input() public gitlabIssue:IGitlabIssueResource; + + public text = { + label_created_by: this.I18n.t('js.label_created_by'), + label_last_updated_on: this.I18n.t('js.gitlab_integration.updated_on'), + label_details: this.I18n.t('js.label_details'), + }; + + constructor(readonly PathHelper:PathHelperService, + readonly I18n:I18nService) { + } + + get state() { + + if (this.gitlabIssue.state === 'opened') { + return ('open'); + } else { + return('closed'); + } + } + + toggleLabels(identifier: string) { + const labelsElement = document.querySelector(`.op-issue--labels-${identifier}`) as HTMLElement; + + // Check the current display property and toggle it + labelsElement.style.display = labelsElement.style.display === 'none' ? 'block' : 'none'; + } +} diff --git a/modules/gitlab_integration/frontend/module/main.ts b/modules/gitlab_integration/frontend/module/main.ts new file mode 100644 index 000000000000..a694e4d3b1ea --- /dev/null +++ b/modules/gitlab_integration/frontend/module/main.ts @@ -0,0 +1,117 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { Injector, NgModule } from '@angular/core'; +import { OpSharedModule } from 'core-app/shared/shared.module'; +import { OpenprojectTabsModule } from 'core-app/shared/components/tabs/openproject-tabs.module'; +import { WorkPackageTabsService } from 'core-app/features/work-packages/components/wp-tabs/services/wp-tabs/wp-tabs.service'; + + +import { GitlabTabComponent } from './gitlab-tab/gitlab-tab.component'; +import { TabHeaderMrsComponent } from './tab-header-mr/tab-header-mr.component'; +import { TabHeaderIssueComponent } from './tab-header-issue/tab-header-issue.component'; +import { TabMrsComponent } from './tab-mrs/tab-mrs.component'; +import { TabIssueComponent } from './tab-issue/tab-issue.component'; +import { GitActionsMenuDirective } from './git-actions-menu/git-actions-menu.directive'; +import { GitActionsMenuComponent } from './git-actions-menu/git-actions-menu.component'; +import { WorkPackagesGitlabMrsService } from './tab-mrs/wp-gitlab-mrs.service'; +import { WorkPackagesGitlabIssueService } from './tab-issue/wp-gitlab-issue.service'; +import { MergeRequestComponent } from './merge-request/merge-request.component'; +import { IssueComponent } from './issue/issue.component'; +import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource'; +import { Observable, combineLatest } from 'rxjs'; +import { map } from 'rxjs/operators'; + +export function workPackageGitlabCount( + workPackage:WorkPackageResource, + injector:Injector, +):Observable { + const gitlabMrsService = injector.get(WorkPackagesGitlabMrsService); + const gitlabIssueService = injector.get(WorkPackagesGitlabIssueService); + + const mrsObservable = gitlabMrsService.requireAndStream(workPackage).pipe( + map((mrs) => mrs.length), + ); + + const issuesObservable = gitlabIssueService.requireAndStream(workPackage).pipe( + map((issues) => issues.length), + ); + + return combineLatest([mrsObservable, issuesObservable]).pipe( + map(([mrsCount, issuesCount]) => mrsCount + issuesCount), + ); +} + +export function initializeGitlabIntegrationPlugin(injector:Injector) { + const wpTabService = injector.get(WorkPackageTabsService); + wpTabService.register({ + component: GitlabTabComponent, + name: I18n.t('js.gitlab_integration.work_packages.tab_name'), + id: 'gitlab', + displayable: (workPackage) => !!workPackage.gitlab, + count: workPackageGitlabCount, + }); +} + + +@NgModule({ + imports: [ + OpSharedModule, + OpenprojectTabsModule, + ], + providers: [ + WorkPackagesGitlabMrsService, + WorkPackagesGitlabIssueService, + ], + declarations: [ + GitlabTabComponent, + TabHeaderMrsComponent, + TabHeaderIssueComponent, + TabMrsComponent, + TabIssueComponent, + GitActionsMenuDirective, + GitActionsMenuComponent, + MergeRequestComponent, + IssueComponent, + ], + exports: [ + GitlabTabComponent, + TabHeaderMrsComponent, + TabHeaderIssueComponent, + TabMrsComponent, + TabIssueComponent, + GitActionsMenuDirective, + GitActionsMenuComponent, + ], +}) +export class PluginModule { + constructor(injector:Injector) { + initializeGitlabIntegrationPlugin(injector); + } +} diff --git a/modules/gitlab_integration/frontend/module/merge-request/merge-request.component.html b/modules/gitlab_integration/frontend/module/merge-request/merge-request.component.html new file mode 100644 index 000000000000..b3507161a0b3 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/merge-request/merge-request.component.html @@ -0,0 +1,57 @@ +
+ + + + {{state}} | + + + + + + + + {{ mergeRequest.pipelines[0].status }} + + +
+ {{ text.label_created_by }} + + + . + + + {{ text.label_last_updated_on }} + + . +
+ + diff --git a/modules/gitlab_integration/frontend/module/merge-request/merge-request.component.sass b/modules/gitlab_integration/frontend/module/merge-request/merge-request.component.sass new file mode 100644 index 000000000000..ef13e6c9f5c9 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/merge-request/merge-request.component.sass @@ -0,0 +1,322 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +@import "helpers" + +:host, +.op-merge-request + display: grid + grid-template-columns: minmax(270px, auto) auto auto 1fr + grid-template-areas: "title title title title" "info_created info_created info_created info_created" "state label_icon pipe_icon pipe_icon" "label label label label" + margin-bottom: 5px + margin-top: 5px + padding-bottom: 4px + padding-top: 4px + border-bottom: 1px solid #dddddd + + &:last-child + border-bottom: none + + &--iconsize + width: 16px + height: 16px + vertical-align: -3px + + &--iconwidth + min-width: 100px + + &--title + @include text-shortener + font-weight: bold + grid-area: title + line-height: 22px + margin-right: 20px + + &--avatar + grid-area: info + + &--info_created + @include text-shortener + display: block + grid-area: info_created + font-size: 0.75rem + color: var(--gray-dark) + margin-bottom: 3px + + &--info_updated + @include text-shortener + display: block + grid-area: info_updated + font-size: 0.75rem + color: var(--gray-dark) + margin-top: -4px + + &--username + color: var(--gray-dark) + text-decoration: none + + &--labels + display: none + grid-area: label + font-size: 0.9rem + color: var(--gray-dark) + margin-top: 10px + + &--label + display: inline-block + padding: 2px 0.5rem 2px 0.5rem + border-radius: 10rem + border: 1px solid #fff + color: #fff + font-size: 0.8rem + + &--link + font-size: 0.8rem + text-decoration: none + + &_open + background-color: #c3e6cd + color: #24663b + fill: #24663b + + &_ready + background-color: #c3e6cd + color: #24663b + fill: #24663b + + &_merged + background-color: #cbe2f9 + color: #0b5cad + fill: #0b5cad + + &_closed + background-color: #fdd4cd + color: #ae1800 + fill: #ae1800 + + &--label_icon + grid-area: label_icon + display: inline-block + padding: 4px 6px + border-radius: 10rem + font-size: 0.8rem + font-weight: 400 + align-self: center + width: fit-content + margin-right: 6px + border: 1px solid #cecdd4 + background-color: #f3f3f3 + + &:hover + border: 1px solid #b6b5ba + background-color: #e4e4e4 + + &_style + fill: #737278 + + &--state + grid-area: state + display: inline-block + padding: 5px 0.6rem 5px 0.6rem + border-radius: 10rem + font-size: 0.8rem + font-weight: 400 + text-transform: capitalize + align-self: center + white-space: nowrap + width: fit-content + margin-right: 6px + + &_open + background-color: #c3e6cd + color: #24663b + fill: #24663b + + &_ready + background-color: #c3e6cd + color: #24663b + fill: #24663b + + &_merged + background-color: #cbe2f9 + color: #0b5cad + fill: #0b5cad + + &_closed + background-color: #fdd4cd + color: #ae1800 + fill: #ae1800 + + &--pipeline-icon + grid-area: pipe_icon + padding: 0.25rem + border-radius: 10rem + font-size: 0.8rem + font-weight: 400 + align-self: center + margin-right: 6px + width: fit-content + height: 28px + align-items: center + display: inline-flex + + &_failed + fill: #dd2b0e + width: 20px + height: 20px + + &_bg_failed + background-color: #fdd4cd + + &_success + fill: #108548 + width: 20px + height: 20px + + &_bg_success + background-color: #c3e6cd + + &_running + fill: #367ad1 + width: 20px + height: 20px + + &_bg_running + background-color: #cddffd + + &_created + fill: #737278 + width: 20px + height: 20px + + &_bg_created + background-color: #ececef + + &_waiting + fill: #737278 + width: 20px + height: 20px + + &_bg_waiting + background-color: #ececef + + &_preparing + fill: #737278 + width: 20px + height: 20px + + &_bg_preparing + background-color: #ececef + + &_pending + fill: #737278 + width: 20px + height: 20px + + &_bg_pending + background-color: #ececef + + &_canceled + fill: #737278 + width: 20px + height: 20px + + &_bg_canceled + background-color: #ececef + + &_skipped + fill: #737278 + width: 20px + height: 20px + + &_bg_skipped + background-color: #ececef + + &_manual + fill: #737278 + width: 20px + height: 20px + + &_bg_manual + background-color: #ececef + + &_scheduled + fill: #737278 + width: 20px + height: 20px + + &_bg_scheduled + background-color: #ececef + + &--pipeline-label + font-size: 0.8rem + font-weight: 400 + margin-left: 4px + margin-right: 5px + text-transform: capitalize + + &_failed + color: #ae1800 + + &_success + color: #24663b + + &_running + color: #4782d0 + + &_created + color: #737278 + + &_waiting + color: #737278 + + &_preparing + color: #737278 + + &_pending + color: #737278 + + &_canceled + color: #737278 + + &_skipped + color: #737278 + + &_manual + color: #737278 + + &_scheduled + color: #737278 + + &--pipeline + margin-top: 12px + margin-bottom: 12px + margin-left: 0 + grid-area: pipeline + diff --git a/modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts b/modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts new file mode 100644 index 000000000000..1deaddff62e8 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/merge-request/merge-request.component.ts @@ -0,0 +1,75 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { Component, Input } from '@angular/core'; +import { PathHelperService } from 'core-app/core/path-helper/path-helper.service'; +import { I18nService } from 'core-app/core/i18n/i18n.service'; +import {IGitlabMergeRequestResource} from 'core-app/features/plugins/linked/openproject-gitlab_integration/typings'; + +@Component({ + selector: 'gitlab-merge-request', + templateUrl: './merge-request.component.html', + styleUrls: [ + './merge-request.component.sass', + './mr-pipeline.component.sass', + ], + host: { class: 'op-merge-request' } +}) + +export class MergeRequestComponent { + @Input() public mergeRequest:IGitlabMergeRequestResource; + + public text = { + label_created_by: this.I18n.t('js.label_created_by'), + label_last_updated_on: this.I18n.t('js.gitlab_integration.updated_on'), + label_details: this.I18n.t('js.label_details'), + label_pipelines: this.I18n.t('js.gitlab_integration.gitlab_pipelines'), + }; + + constructor(readonly PathHelper:PathHelperService, + readonly I18n:I18nService) { + } + + get state() { + + if (this.mergeRequest.state === 'opened') { + return (this.mergeRequest.draft ? 'open' : 'ready'); + } else { + return(this.mergeRequest.merged ? 'merged' : 'closed'); + } + } + + toggleLabels(identifier: string) { + const labelsElement = document.querySelector(`.op-merge-request--labels-${identifier}`) as HTMLElement; + + // Check the current display property and toggle it + labelsElement.style.display = labelsElement.style.display === 'none' ? 'block' : 'none'; + } + +} diff --git a/modules/gitlab_integration/frontend/module/merge-request/mr-pipeline.component.sass b/modules/gitlab_integration/frontend/module/merge-request/mr-pipeline.component.sass new file mode 100644 index 000000000000..fb773b1dcc28 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/merge-request/mr-pipeline.component.sass @@ -0,0 +1,90 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ +.op-mr-pipeline + display: grid + grid-row: span 4 + grid-template-columns: 28px 1fr auto // auto + grid-template-areas: "pipeline-state-icon pipeline-info pipeline-avatar" // pipeline-details" + list-style-type: none + border: 1px solid #e4e4e4 + padding: 0.3rem 1rem + // background: rgba(0, 0, 0, 0.05) + font-size: 0.84rem + + &:first-child + border-top-right-radius: 5px + border-top-left-radius: 5px + + &:last-child + border-bottom-right-radius: 5px + border-bottom-left-radius: 5px + + &--avatar img + grid-area: pipeline-avatar + display: inline-block + width: 22px + height: 22px + margin-right: 5px + border-radius: var(--user-avatar-border-radius) + + &--info + grid-area: pipeline-info + + &--state + color: var(--gray-dark) + font-style: italic + margin-left: 1em + + &--state-icon + grid-area: pipeline-state-icon + + &_queued + color: cadetblue + + &_running + color: orange + + &_success + color: green + + &_failed, + &_timed_out, + &_action_required, + &_stale + color: red + + &_skipped, + &_neutral, + &_cancelled + color: gray + color: gray + color: gray + + &--details + grid-area: pipeline-details diff --git a/modules/gitlab_integration/frontend/module/tab-header-issue/styles/tab-header-issue.sass b/modules/gitlab_integration/frontend/module/tab-header-issue/styles/tab-header-issue.sass new file mode 100644 index 000000000000..e5eb014b830a --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-header-issue/styles/tab-header-issue.sass @@ -0,0 +1,50 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +.gitlab-issue-header + display: flex + flex-wrap: wrap-reverse + justify-content: flex-end + + border-bottom: 1px solid #ddd + background-color: var(--body-background) + + .title + flex: 1 1 auto + border-bottom: 0 + margin: 0 + padding: 0 0 0 4px + font-weight: bold + font-size: 1rem + line-height: 32px + text-transform: uppercase + + .s16x32 + width: 16px + height: 32px diff --git a/modules/gitlab_integration/frontend/module/tab-header-issue/tab-header-issue.component.ts b/modules/gitlab_integration/frontend/module/tab-header-issue/tab-header-issue.component.ts new file mode 100644 index 000000000000..447a44c7ad3e --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-header-issue/tab-header-issue.component.ts @@ -0,0 +1,50 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { Component, Input } from '@angular/core'; +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; +import { I18nService } from "core-app/core/i18n/i18n.service"; + +@Component({ + selector: 'tab-header-issue', + templateUrl: './tab-header-issue.template.html', + styleUrls: [ + './styles/tab-header-issue.sass' + ] +}) +export class TabHeaderIssueComponent { + @Input() public workPackage:WorkPackageResource; + + public text = { + title: this.I18n.t('js.gitlab_integration.tab_header_issue.title'), + }; + + constructor(readonly I18n:I18nService) { + } +} diff --git a/modules/gitlab_integration/frontend/module/tab-header-issue/tab-header-issue.template.html b/modules/gitlab_integration/frontend/module/tab-header-issue/tab-header-issue.template.html new file mode 100644 index 000000000000..1fc5efe1023f --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-header-issue/tab-header-issue.template.html @@ -0,0 +1,6 @@ +
+ +

+ {{text.title}} +

+
diff --git a/modules/gitlab_integration/frontend/module/tab-header-mr/styles/tab-header-mr.sass b/modules/gitlab_integration/frontend/module/tab-header-mr/styles/tab-header-mr.sass new file mode 100644 index 000000000000..1613363e759d --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-header-mr/styles/tab-header-mr.sass @@ -0,0 +1,51 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +.gitlab-mr-header + display: flex + flex-wrap: wrap-reverse + justify-content: flex-end + + border-bottom: 1px solid #ddd + background-color: var(--body-background) + + .title + flex: 1 1 auto + border-bottom: 0 + margin: 0 + padding: 0 0 0 4px + font-weight: bold + font-size: 1rem + line-height: 32px + text-transform: uppercase + align-self: baseline + + .s16x32 + width: 16px + height: 32px diff --git a/modules/gitlab_integration/frontend/module/tab-header-mr/tab-header-mr.component.ts b/modules/gitlab_integration/frontend/module/tab-header-mr/tab-header-mr.component.ts new file mode 100644 index 000000000000..dc208c5a55cf --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-header-mr/tab-header-mr.component.ts @@ -0,0 +1,54 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { Component, Input } from '@angular/core'; +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; +import { I18nService } from "core-app/core/i18n/i18n.service"; + +@Component({ + selector: 'tab-header-mr', + templateUrl: './tab-header-mr.template.html', + styleUrls: [ + './styles/tab-header-mr.sass' + ] +}) +export class TabHeaderMrsComponent { + @Input() public workPackage:WorkPackageResource; + + public text = { + title: this.I18n.t('js.gitlab_integration.tab_header_mr.title'), + // createPrButtonLabel: this.I18n.t('js.gitlab_integration.tab_header.create_mr.label'), + // createPrButtonDescription: this.I18n.t('js.gitlab_integration.tab_header.create_mr.description'), + gitMenuLabel: this.I18n.t('js.gitlab_integration.tab_header_mr.copy_menu.label'), + gitMenuDescription: this.I18n.t('js.gitlab_integration.tab_header_mr.copy_menu.description'), + }; + + constructor(readonly I18n:I18nService) { + } +} diff --git a/modules/gitlab_integration/frontend/module/tab-header-mr/tab-header-mr.template.html b/modules/gitlab_integration/frontend/module/tab-header-mr/tab-header-mr.template.html new file mode 100644 index 000000000000..031b3c52a576 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-header-mr/tab-header-mr.template.html @@ -0,0 +1,21 @@ +
+ +

+ {{text.title}} +

+ +
diff --git a/modules/gitlab_integration/frontend/module/tab-issue/tab-issue.component.ts b/modules/gitlab_integration/frontend/module/tab-issue/tab-issue.component.ts new file mode 100644 index 000000000000..28c96b44f791 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-issue/tab-issue.component.ts @@ -0,0 +1,70 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; +import { HalResourceService } from "core-app/features/hal/services/hal-resource.service"; +import { CollectionResource } from "core-app/features/hal/resources/collection-resource"; +import { I18nService } from "core-app/core/i18n/i18n.service"; +import {IGitlabIssueResource} from "core-app/features/plugins/linked/openproject-gitlab_integration/typings"; +import {ApiV3Service} from "core-app/core/apiv3/api-v3.service"; + +@Component({ + selector: 'tab-issue', + templateUrl: './tab-issue.template.html', + host: { class: 'op-issue' } +}) +export class TabIssueComponent implements OnInit { + @Input() public workPackage:WorkPackageResource; + + public gitlabIssues:IGitlabIssueResource[] = []; + + constructor( + readonly I18n:I18nService, + readonly apiV3Service:ApiV3Service, + readonly halResourceService:HalResourceService, + readonly changeDetector:ChangeDetectorRef, + ) {} + + ngOnInit(): void { + const basePath = this.apiV3Service.work_packages.id(this.workPackage.id as string).path; + const gitlabIssuePath = `${basePath}/gitlab_issues`; + + this.halResourceService + .get>(gitlabIssuePath) + .subscribe((value) => { + this.gitlabIssues = value.elements; + this.changeDetector.detectChanges(); + }); + } + + public getEmptyText() { + return this.I18n.t('js.gitlab_integration.tab_issue.empty',{ wp_id: this.workPackage.id }); + } +} diff --git a/modules/gitlab_integration/frontend/module/tab-issue/tab-issue.template.html b/modules/gitlab_integration/frontend/module/tab-issue/tab-issue.template.html new file mode 100644 index 000000000000..ce4a51d334e8 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-issue/tab-issue.template.html @@ -0,0 +1,5 @@ + +

+
+ + diff --git a/modules/gitlab_integration/frontend/module/tab-issue/wp-gitlab-issue.service.ts b/modules/gitlab_integration/frontend/module/tab-issue/wp-gitlab-issue.service.ts new file mode 100644 index 000000000000..7898eba00762 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-issue/wp-gitlab-issue.service.ts @@ -0,0 +1,52 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; +import { HalResource } from "core-app/features/hal/resources/hal-resource"; +import { Injectable } from '@angular/core'; +import { ConfigurationService } from "core-app/core/config/configuration.service"; +import { WorkPackageLinkedResourceCache } from 'core-app/features/work-packages/components/wp-single-view-tabs/wp-linked-resource-cache.service'; + +@Injectable() +export class WorkPackagesGitlabIssueService extends WorkPackageLinkedResourceCache { + + constructor(public ConfigurationService:ConfigurationService) { + super(); + } + + protected load(workPackage:WorkPackageResource):Promise { + return workPackage.gitlab_issues.$update().then((data:any) => { + return this.sortList(data.elements); + }); + } + + protected sortList(gitlabIssue:HalResource[], attr = 'createdAt'):HalResource[] { + return _.sortBy(_.flatten(gitlabIssue), attr); + } +} diff --git a/modules/gitlab_integration/frontend/module/tab-mrs/tab-mrs.component.ts b/modules/gitlab_integration/frontend/module/tab-mrs/tab-mrs.component.ts new file mode 100644 index 000000000000..dc4254128171 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-mrs/tab-mrs.component.ts @@ -0,0 +1,70 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; +import { HalResourceService } from "core-app/features/hal/services/hal-resource.service"; +import { CollectionResource } from "core-app/features/hal/resources/collection-resource"; +import { I18nService } from "core-app/core/i18n/i18n.service"; +import {IGitlabMergeRequestResource} from "core-app/features/plugins/linked/openproject-gitlab_integration/typings"; +import {ApiV3Service} from "core-app/core/apiv3/api-v3.service"; + +@Component({ + selector: 'tab-mrs', + templateUrl: './tab-mrs.template.html', + host: { class: 'op-mrs' } +}) +export class TabMrsComponent implements OnInit { + @Input() public workPackage:WorkPackageResource; + + public mergeRequests:IGitlabMergeRequestResource[] = []; + + constructor( + readonly I18n:I18nService, + readonly apiV3Service:ApiV3Service, + readonly halResourceService:HalResourceService, + readonly changeDetector:ChangeDetectorRef, + ) {} + + ngOnInit(): void { + const basePath = this.apiV3Service.work_packages.id(this.workPackage.id as string).path; + const mergeRequestsPath = `${basePath}/gitlab_merge_requests`; + + this.halResourceService + .get>(mergeRequestsPath) + .subscribe((value) => { + this.mergeRequests = value.elements; + this.changeDetector.detectChanges(); + }); + } + + public getEmptyText() { + return this.I18n.t('js.gitlab_integration.tab_mrs.empty',{ wp_id: this.workPackage.id }); + } +} diff --git a/modules/gitlab_integration/frontend/module/tab-mrs/tab-mrs.template.html b/modules/gitlab_integration/frontend/module/tab-mrs/tab-mrs.template.html new file mode 100644 index 000000000000..43ab49c22624 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-mrs/tab-mrs.template.html @@ -0,0 +1,5 @@ + +

+
+ + diff --git a/modules/gitlab_integration/frontend/module/tab-mrs/wp-gitlab-mrs.service.ts b/modules/gitlab_integration/frontend/module/tab-mrs/wp-gitlab-mrs.service.ts new file mode 100644 index 000000000000..aed4c23bea00 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/tab-mrs/wp-gitlab-mrs.service.ts @@ -0,0 +1,52 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { WorkPackageResource } from "core-app/features/hal/resources/work-package-resource"; +import { HalResource } from "core-app/features/hal/resources/hal-resource"; +import { Injectable } from '@angular/core'; +import { ConfigurationService } from "core-app/core/config/configuration.service"; +import { WorkPackageLinkedResourceCache } from 'core-app/features/work-packages/components/wp-single-view-tabs/wp-linked-resource-cache.service'; + +@Injectable() +export class WorkPackagesGitlabMrsService extends WorkPackageLinkedResourceCache { + + constructor(public ConfigurationService:ConfigurationService) { + super(); + } + + protected load(workPackage:WorkPackageResource):Promise { + return workPackage.gitlab_merge_requests.$update().then((data:any) => { + return this.sortList(data.elements); + }); + } + + protected sortList(mergeRequests:HalResource[], attr = 'createdAt'):HalResource[] { + return _.sortBy(_.flatten(mergeRequests), attr); + } +} diff --git a/modules/gitlab_integration/frontend/module/typings.d.ts b/modules/gitlab_integration/frontend/module/typings.d.ts new file mode 100644 index 000000000000..f790de805c73 --- /dev/null +++ b/modules/gitlab_integration/frontend/module/typings.d.ts @@ -0,0 +1,99 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) 2023 Ben Tey +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// Copyright (C) 2012-2021 the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// +// See docs/COPYRIGHT.rdoc for more details. +//++ + +import { HalResourceClass } from 'core-app/modules/hal/resources/hal-resource'; + + +export interface ISnippet { + id:string; + name:string; + textToCopy:()=>string +} + +export interface IGitlabIssueResource extends HalResourceClass { + body?:{ + format?:string; + raw?:string; + html?:string; + }, + createdAt?:string; + gitlabUpdatedAt?:string; + htmlUrl?:string; + id?:number; + labels?:string[]; + number?:number; + repository?:string; + state?:string; + title?:string; + updatedAt?:string; + gitlabUser?:IGitlabUserResource; +} + +export interface IGitlabMergeRequestResource extends HalResourceClass { + body?:{ + format?:string; + raw?:string; + html?:string; + }, + createdAt?:string; + draft?:boolean; + gitlabUpdatedAt?:string; + htmlUrl?:string; + id?:number; + labels?:string[]; + merged?:boolean; + mergedAt?:string; + mergedBy?:IGitlabUserResource; + number?:number; + repository?:string; + state?:string; + title?:string; + updatedAt?:string; + gitlabUser?:IGitlabUserResource; + pipelines?:IGitlabPipelineResource[]; +} + +export interface IGitlabUserResource { + avatarUrl:string; + email:string; + login:string; +} + +export interface IGitlabPipelineResource { + userAvatarUrl:string; + completedAt:string; + detailsUrl:string; + htmlUrl:string; + name:string; + startedAt:string; + status:string; + ci_details:string[]; + username:string; + commitId:string; +} \ No newline at end of file diff --git a/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_issue_collection_representer.rb b/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_issue_collection_representer.rb new file mode 100644 index 000000000000..f3285a4c62d2 --- /dev/null +++ b/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_issue_collection_representer.rb @@ -0,0 +1,40 @@ +#-- encoding: UTF-8 + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module API + module V3 + module GitlabIssues + class GitlabIssueCollectionRepresenter < ::API::Decorators::Collection + self.to_eager_load = ::API::V3::GitlabIssues::GitlabIssueRepresenter.to_eager_load + end + end + end +end diff --git a/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_issue_representer.rb b/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_issue_representer.rb new file mode 100644 index 000000000000..5ed0b8dd4cca --- /dev/null +++ b/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_issue_representer.rb @@ -0,0 +1,90 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +require 'roar/decorator' +require 'roar/json/hal' + +module API + module V3 + module GitlabIssues + class GitlabIssueRepresenter < ::API::Decorators::Single + include API::Caching::CachedRepresenter + include API::Decorators::DateProperty + include API::Decorators::FormattableProperty + include API::Decorators::LinkedResource + + def initialize(model, current_user:, **_opts) + # We force `embed_links` so that github_user and github_check_runs + # are embedded and we can avoid having separate endpoints. + super(model, current_user:, embed_links: true) + end + + cached_representer key_parts: %i[gitlab_user] + + property :id + + property :number + + property :gitlab_html_url, as: :htmlUrl + + property :state, + render_nil: true + + property :repository, + render_nil: true + + date_time_property :gitlab_updated_at, + render_nil: true, + setter: ->(*) {} + + property :title, + render_nil: true + + formattable_property :body, + render_nil: true + + property :labels + + associated_resource :gitlab_user, + representer: ::API::V3::GitlabIssues::GitlabUserRepresenter, + link_title_attribute: :gitlab_name + + date_time_property :created_at + + date_time_property :updated_at + + def _type + 'GitlabIssue' + end + + self.to_eager_load = %i[gitlab_user] + end + end + end +end diff --git a/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_issues_by_work_package_api.rb b/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_issues_by_work_package_api.rb new file mode 100644 index 000000000000..7604173b4060 --- /dev/null +++ b/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_issues_by_work_package_api.rb @@ -0,0 +1,53 @@ +#-- encoding: UTF-8 + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module API + module V3 + module GitlabIssues + class GitlabIssuesByWorkPackageAPI < ::API::OpenProjectAPI + after_validation do + authorize_in_work_package(:show_gitlab_content, work_package: @work_package) + @gitlab_issues = @work_package.gitlab_issues + end + + resources :gitlab_issues do + get do + path = api_v3_paths.gitlab_issues_by_work_package(@work_package.id) + GitlabIssueCollectionRepresenter.new(@gitlab_issues, + @gitlab_issues.count, + self_link: path, + current_user:) + end + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_user_representer.rb b/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_user_representer.rb new file mode 100644 index 000000000000..535b9ddb49aa --- /dev/null +++ b/modules/gitlab_integration/lib/api/v3/gitlab_issues/gitlab_user_representer.rb @@ -0,0 +1,52 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +require 'roar/decorator' +require 'roar/json/hal' + +module API + module V3 + module GitlabIssues + class GitlabUserRepresenter < ::API::Decorators::Single + include API::Caching::CachedRepresenter + + self_link id_attribute: :id, + title_getter: ->(*) {} + + property :gitlab_name, as: :login + property :gitlab_email, as: :email + property :gitlab_avatar_url, as: :avatarUrl + + def _type + 'GitlabUser' + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_merge_request_collection_representer.rb b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_merge_request_collection_representer.rb new file mode 100644 index 000000000000..503649142cc3 --- /dev/null +++ b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_merge_request_collection_representer.rb @@ -0,0 +1,40 @@ +#-- encoding: UTF-8 + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module API + module V3 + module GitlabMergeRequests + class GitlabMergeRequestCollectionRepresenter < ::API::Decorators::Collection + self.to_eager_load = ::API::V3::GitlabMergeRequests::GitlabMergeRequestRepresenter.to_eager_load + end + end + end +end diff --git a/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_merge_request_representer.rb b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_merge_request_representer.rb new file mode 100644 index 000000000000..7286b080bcfd --- /dev/null +++ b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_merge_request_representer.rb @@ -0,0 +1,108 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +require 'roar/decorator' +require 'roar/json/hal' + +module API + module V3 + module GitlabMergeRequests + class GitlabMergeRequestRepresenter < ::API::Decorators::Single + include API::Caching::CachedRepresenter + include API::Decorators::DateProperty + include API::Decorators::FormattableProperty + include API::Decorators::LinkedResource + + def initialize(model, current_user:, **_opts) + # We force `embed_links` so that github_user and github_check_runs + # are embedded and we can avoid having separate endpoints. + super(model, current_user:, embed_links: true) + end + + cached_representer key_parts: %i[gitlab_user merged_by] + + property :id + + property :number + + property :gitlab_html_url, as: :htmlUrl + + property :state, + render_nil: true + + property :repository, + render_nil: true + + date_time_property :gitlab_updated_at, + render_nil: true, + setter: ->(*) {} + + property :title, + render_nil: true + + formattable_property :body, + render_nil: true + + property :draft, + render_nil: true + + property :merged, + render_nil: true + + property :labels + + associated_resource :gitlab_user, + representer: ::API::V3::GitlabMergeRequests::GitlabUserRepresenter, + link_title_attribute: :gitlab_name + + associated_resource :merged_by, + representer: ::API::V3::GitlabMergeRequests::GitlabUserRepresenter, + v3_path: :gitlab_user, + link_title_attribute: :gitlab_name + + # TODO: pending until get the list of statuses... + associated_resources :latest_pipelines, + as: :pipelines, + representer: ::API::V3::GitlabMergeRequests::GitlabPipelineRepresenter, + v3_path: :gitlab_pipeline, + link_title_attribute: :name + + date_time_property :created_at + + date_time_property :updated_at + + def _type + 'GitlabMergeRequest' + end + + self.to_eager_load = %i[gitlab_user merged_by] + end + end + end +end diff --git a/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_merge_requests_by_work_package_api.rb b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_merge_requests_by_work_package_api.rb new file mode 100644 index 000000000000..8627ba320710 --- /dev/null +++ b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_merge_requests_by_work_package_api.rb @@ -0,0 +1,53 @@ +#-- encoding: UTF-8 + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module API + module V3 + module GitlabMergeRequests + class GitlabMergeRequestsByWorkPackageAPI < ::API::OpenProjectAPI + after_validation do + authorize_in_work_package(:show_gitlab_content, work_package: @work_package) + @gitlab_merge_requests = @work_package.gitlab_merge_requests + end + + resources :gitlab_merge_requests do + get do + path = api_v3_paths.gitlab_merge_requests_by_work_package(@work_package.id) + GitlabMergeRequestCollectionRepresenter.new(@gitlab_merge_requests, + @gitlab_merge_requests.count, + self_link: path, + current_user:) + end + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer.rb b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer.rb new file mode 100644 index 000000000000..a52c5700d9ca --- /dev/null +++ b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer.rb @@ -0,0 +1,61 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +require 'roar/decorator' +require 'roar/json/hal' + +module API + module V3 + module GitlabMergeRequests + class GitlabPipelineRepresenter < ::API::Decorators::Single + include API::Caching::CachedRepresenter + include API::Decorators::DateProperty + + self_link id_attribute: :id, + title_getter: ->(*) {} + + property :gitlab_html_url, as: :htmlUrl + property :gitlab_user_avatar_url, as: :userAvatarUrl + property :name + property :status + property :details_url + property :ci_details + property :username + property :commit_id, as: :commitId + + date_time_property :started_at + date_time_property :completed_at + + def _type + 'GitlabPipeline' + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_user_representer.rb b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_user_representer.rb new file mode 100644 index 000000000000..63ef95738b6a --- /dev/null +++ b/modules/gitlab_integration/lib/api/v3/gitlab_merge_requests/gitlab_user_representer.rb @@ -0,0 +1,52 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +require 'roar/decorator' +require 'roar/json/hal' + +module API + module V3 + module GitlabMergeRequests + class GitlabUserRepresenter < ::API::Decorators::Single + include API::Caching::CachedRepresenter + + self_link id_attribute: :id, + title_getter: ->(*) {} + + property :gitlab_name, as: :login + property :gitlab_email, as: :email + property :gitlab_avatar_url, as: :avatarUrl + + def _type + 'GitlabUser' + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration.rb new file mode 100644 index 000000000000..70f358282d54 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration.rb @@ -0,0 +1,34 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module OpenProject + module GitlabIntegration + require "open_project/gitlab_integration/engine" + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/engine.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/engine.rb new file mode 100644 index 000000000000..71cdbf7e2fb1 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/engine.rb @@ -0,0 +1,112 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +require 'open_project/plugins' + +require_relative 'patches/api/work_package_representer' +require_relative 'notification_handlers' +require_relative 'hook_handler' +require_relative 'services' + +module OpenProject::GitlabIntegration + class Engine < ::Rails::Engine + engine_name :openproject_gitlab_integration + + include OpenProject::Plugins::ActsAsOpEngine + + register 'openproject-gitlab_integration', + author_url: 'https://github.com/btey/openproject', + bundled: true do + project_module(:gitlab, dependencies: :work_package_tracking) do + permission(:show_gitlab_content, + {}, + permissible_on: %i[work_package project]) + end + end + + patches %w[WorkPackage] + + initializer 'gitlab.register_hook' do + ::OpenProject::Webhooks.register_hook 'gitlab' do |hook, environment, params, user| + HookHandler.new.process(hook, environment, params, user) + end + end + + initializer 'gitlab.subscribe_to_notifications' do + ::OpenProject::Notifications.subscribe('gitlab.merge_request_hook', + &NotificationHandlers.method(:merge_request_hook)) + ::OpenProject::Notifications.subscribe('gitlab.note_hook', + &NotificationHandlers.method(:note_hook)) + ::OpenProject::Notifications.subscribe('gitlab.issue_hook', + &NotificationHandlers.method(:issue_hook)) + ::OpenProject::Notifications.subscribe('gitlab.push_hook', + &NotificationHandlers.method(:push_hook)) + ::OpenProject::Notifications.subscribe('gitlab.pipeline_hook', + &NotificationHandlers.method(:pipeline_hook)) + ::OpenProject::Notifications.subscribe('gitlab.system_hook', + &NotificationHandlers.method(:system_hook)) + end + + extend_api_response(:v3, :work_packages, :work_package, + &::OpenProject::GitlabIntegration::Patches::API::WorkPackageRepresenter.extension) + + add_api_path :gitlab_merge_requests_by_work_package do |id| + "#{work_package(id)}/gitlab_merge_requests" + end + + add_api_path :gitlab_issues_by_work_package do |id| + "#{work_package(id)}/gitlab_issues" + end + + add_api_path :gitlab_user do |id| + "gitlab_users/#{id}" + end + + add_api_path :gitlab_pipeline do |id| + "gitlab_pipeline/#{id}" + end + + add_api_endpoint 'API::V3::WorkPackages::WorkPackagesAPI', :id do + mount ::API::V3::GitlabMergeRequests::GitlabMergeRequestsByWorkPackageAPI + end + + add_api_endpoint 'API::V3::WorkPackages::WorkPackagesAPI', :id do + mount ::API::V3::GitlabIssues::GitlabIssuesByWorkPackageAPI + end + + add_cron_jobs do + { + 'Cron::ClearOldMergeRequestsJob': { + cron: '25 1 * * *', # runs at 1:25 nightly + class: ::Cron::ClearOldMergeRequestsJob.name + } + } + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/hook_handler.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/hook_handler.rb new file mode 100644 index 000000000000..5c8900bbcbb5 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/hook_handler.rb @@ -0,0 +1,67 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module OpenProject::GitlabIntegration + class HookHandler + # List of the gitlab events we can handle. + KNOWN_EVENTS = %w[ + push_hook + issue_hook + note_hook + merge_request_hook + pipeline_hook + system_hook + ].freeze + + # A gitlab webhook happened. + # We need to check validity of the data and send a Notification + # which we process in our NotificationHandler. + def process(_hook, request, params, user) + event_type = request.env['HTTP_X_GITLAB_EVENT'] + event_type.tr!(' ', '_') + event_type = event_type.to_s.downcase + + Rails.logger.debug { "Received gitlab webhook #{event_type}" } + + return 404 unless KNOWN_EVENTS.include?(event_type) + return 403 if user.blank? + + payload = params[:payload] + .permit! + .to_h + .merge('open_project_user_id' => user.id, + 'gitlab_event' => event_type) + + event_name = :"gitlab.#{event_type}" + OpenProject::Notifications.send(event_name, payload) + + 200 + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/helper.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/helper.rb new file mode 100644 index 000000000000..cf715d0bb69c --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/helper.rb @@ -0,0 +1,150 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module OpenProject::GitlabIntegration + module NotificationHandler + module Helper + ## + # Parses the given source string and returns a list of work_package ids + # which it finds and should be considered public or private. + # WorkPackages are identified by their URL. + # Params: + # source: string + # Returns: + # Array + def extract_work_package_ids(text, kind = "") + # matches the following things (given that `Setting.host_name` equals 'www.openproject.org') + # - http://www.openproject.org/wp/1234 + # - https://www.openproject.org/wp/1234 + # - http://www.openproject.org/work_packages/1234 + # - https://www.openproject.org/subdirectory/work_packages/1234 + # Or with the following prefix: OP# PP# + # e.g.,: This is a reference to OP#1234 + # For private comments you can use the prefix: PP# + host_name = Regexp.escape(Setting.host_name) + wp_regex = if kind == 'private' + /PP#(\d+)/ + elsif kind != 'note' + /OP#(\d+)|PP#(\d+)|http(?:s?):\/\/#{host_name}\/(?:\S+?\/)*(?:work_packages|wp)\/([0-9]+)/ + else + /OP#(\d+)|http(?:s?):\/\/#{host_name}\/(?:\S+?\/)*(?:work_packages|wp)\/([0-9]+)/ + end + String(text) + .scan(wp_regex) + .map { |first, second| (first || second).to_i } + .select(&:positive?) + .uniq + end + + ## + # Given a list of work package ids this methods returns all work packages that match those ids + # and are visible by the given user. + # Params: + # - Array: An list of WorkPackage ids + # - User: The user who may (or may not) see those WorkPackages + # Returns: + # - Array + def find_visible_work_packages(ids, user) + WorkPackage + .includes(:project) + .where(id: ids) + .select { |wp| user.allowed_in_work_package?(:add_work_package_notes, wp) } + end + + # Returns a list of `WorkPackage`s that were referenced in the `text` and are visible to the given `user`. + def find_mentioned_work_packages(text, user, kind = "") + find_visible_work_packages(extract_work_package_ids(text, kind), user) + end + + # Returns a list of `WorkPackage`s that were excluded in the `text`. + def find_excluded_work_packages(text, user) + find_visible_work_packages(extract_work_package_ids(text, 'private'), user) + end + + ## + # Adds comments to the given WorkPackages. + def comment_on_referenced_work_packages(work_packages, user, notes) + return if notes.nil? + + work_packages.each do |work_package| + ::WorkPackages::UpdateService + .new(user:, model: work_package) + .call(journal_notes: notes, send_notifications: false) + end + end + + ## + # Adds comments to the given WorkPackages. + def status_on_referenced_work_packages(work_packages, user, status) + work_packages.each do |work_package| + ::WorkPackages::UpdateService + .new(user:, model: work_package) + .call(status_id: status) + end + end + + ## + # A wapper around a ruby Hash to access webhook payloads. + # All methods called on it are converted to `.fetch` hash-access, raising an error if the string-key does not exist. + # If the method ends with a question mark, e.g. "comment?" not error is raised if the key does not exist. + # If the fetched value is again a hash, the value is wrapped into a new payload object. + class Payload + def initialize(payload) + @payload = payload + end + + def to_h + @payload.dup + end + + def method_missing(name, *args, &block) + super unless args.empty? && block.nil? + + value = if name.end_with?('?') + @payload.fetch(name.to_s[..-2], nil) + else + @payload.fetch(name.to_s) + end + + return Payload.new(value) if value.is_a?(Hash) + + value + end + + def respond_to_missing?(_method_name, _include_private = false) + true + end + end + + def wrap_payload(payload) + Payload.new(payload) + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/issue_hook.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/issue_hook.rb new file mode 100644 index 000000000000..53b4148f6ea2 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/issue_hook.rb @@ -0,0 +1,87 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module OpenProject::GitlabIntegration + module NotificationHandler + ## + # Handles Gitlab issue notifications. + class IssueHook + include OpenProject::GitlabIntegration::NotificationHandler::Helper + + def process(payload_params) + @payload = wrap_payload(payload_params) + user = User.find_by_id(payload.open_project_user_id) + text = payload.object_attributes.title + ' - ' + payload.object_attributes.description + work_packages = find_mentioned_work_packages(text, user) + notes = generate_notes(payload) + comment_on_referenced_work_packages(work_packages, user, notes) + upsert_issue(work_packages) + end + + private + + attr_reader :payload + + def generate_notes(payload) + accepted_actions = %w[open reopen close] + + key_action = { + 'open' => 'opened', + 'reopen' => 'reopened', + 'close' => 'closed' + }[payload.object_attributes.action] + + return nil unless accepted_actions.include? payload.object_attributes.action + + I18n.t("gitlab_integration.issue_#{key_action}_referenced_comment", + issue_number: payload.object_attributes.iid, + issue_title: payload.object_attributes.title, + issue_url: payload.object_attributes.url, + repository: payload.repository.name, + repository_url: payload.repository.homepage, + gitlab_user: payload.user.name, + gitlab_user_url: payload.user.avatar_url) + end + + def gitlab_issue + @gitlab_issue ||= GitlabIssue + .where(gitlab_id: payload.object_attributes.iid) + .or(GitlabIssue.where(gitlab_html_url: payload.object_attributes.url)) + .take + end + + def upsert_issue(work_packages) + return if work_packages.empty? && gitlab_issue.nil? + + OpenProject::GitlabIntegration::Services::UpsertIssue.new.call(payload, + work_packages:) + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/merge_request_hook.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/merge_request_hook.rb new file mode 100644 index 000000000000..cc409d2f4c72 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/merge_request_hook.rb @@ -0,0 +1,111 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module OpenProject::GitlabIntegration + module NotificationHandler + ## + # Handles Gitlab merge request notifications. + class MergeRequestHook + include OpenProject::GitlabIntegration::NotificationHandler::Helper + + def process(payload_params) + update_status_on_new_mr = false # true if you only reference one merge by work_package, else false. + update_status_on_merged = false # true if you only reference one merge by work_package, else false. + wp_status_id_on_new_mr = 7 # the id of the status. + wp_status_id_on_merged = 8 # the id of the status. + + accepted_actions = %w[open update reopen] + accepted_actions_for_comments = %w[open reopen] + accepted_states = %w[closed merged] + + @payload = wrap_payload(payload_params) + return unless (accepted_actions.include? payload.object_attributes.action) || (accepted_states.include? payload.object_attributes.state) + + user = User.find_by_id(payload.open_project_user_id) + text = payload.object_attributes.title + ' - ' + payload.object_attributes.description + work_packages = find_mentioned_work_packages(text, user) + notes = generate_notes(payload) + + if (accepted_actions_for_comments.include? payload.object_attributes.action) || (accepted_states.include? payload.object_attributes.state) + comment_on_referenced_work_packages(work_packages, user, notes) + if payload.object_attributes.state == 'opened' && update_status_on_new_mr + status_on_referenced_work_packages(work_packages, user, wp_status_id_on_new_mr) + elsif payload.object_attributes.state == 'merged' && update_status_on_merged + status_on_referenced_work_packages(work_packages, user, wp_status_id_on_merged) + end + end + upsert_merge_request(work_packages) + end + + private + + attr_reader :payload + + def generate_notes(payload) + key = { + 'opened' => 'opened', + 'reopened' => 'reopened', + 'closed' => 'closed', + 'merged' => 'merged', + 'edited' => 'referenced', + 'referenced' => 'referenced' + }[payload.object_attributes.state] + + key_action = { + 'reopen' => 'reopened' + }[payload.object_attributes.action] + + return nil unless key + + I18n.t("gitlab_integration.merge_request_#{key_action || key}_comment", + mr_number: payload.object_attributes.iid, + mr_title: payload.object_attributes.title, + mr_url: payload.object_attributes.url, + repository: payload.repository.name, + repository_url: payload.repository.url, + gitlab_user: payload.user.name, + gitlab_user_url: payload.user.avatar_url) + end + + def merge_request + @merge_request ||= GitlabMergeRequest + .where(gitlab_id: payload.object_attributes.iid) + .or(GitlabMergeRequest.where(gitlab_html_url: payload.object_attributes.url)) + .take + end + + def upsert_merge_request(work_packages) + return if work_packages.empty? && merge_request.nil? + + OpenProject::GitlabIntegration::Services::UpsertMergeRequest.new.call(payload, + work_packages:) + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/note_hook.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/note_hook.rb new file mode 100644 index 000000000000..3bffd2683413 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/note_hook.rb @@ -0,0 +1,165 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module OpenProject::GitlabIntegration + module NotificationHandler + ## + # Handles Gitlab comment notifications. + class NoteHook + include OpenProject::GitlabIntegration::NotificationHandler::Helper + + # TODO: this can be more refactored and simplified... + def process(payload_params) + @payload = wrap_payload(payload_params) + user = User.find_by(id: payload.open_project_user_id) + text = payload.object_attributes.note + work_packages = find_mentioned_work_packages(text, user, payload.object_kind) + if work_packages.empty? && payload.object_attributes.noteable_type == 'Issue' + text = "#{payload.issue.title} - #{payload.object_attributes.note}" + work_packages = find_mentioned_work_packages(text, user, payload.object_kind) + work_packages_excluded = find_excluded_work_packages(text, user) + work_packages = work_packages - work_packages_excluded unless work_packages_excluded.empty? + return if work_packages.empty? + + notes = generate_notes(payload, 'comment') + elsif work_packages.empty? && payload.object_attributes.noteable_type == 'Snippet' + text = "#{payload.snippet.title} - #{payload.object_attributes.note}" + work_packages = find_mentioned_work_packages(text, user, payload.object_kind) + work_packages_excluded = find_excluded_work_packages(text, user) + work_packages = work_packages - work_packages_excluded unless work_packages_excluded.empty? + return if work_packages.empty? + + notes = generate_notes(payload, 'reference') + elsif work_packages.empty? && payload.object_attributes.noteable_type == 'MergeRequest' + text = "#{payload.merge_request.title} - #{payload.object_attributes.note}" + work_packages = find_mentioned_work_packages(text, user, payload.object_kind) + work_packages_excluded = find_excluded_work_packages(text, user) + work_packages = work_packages - work_packages_excluded unless work_packages_excluded.empty? + return if work_packages.empty? + + notes = generate_notes(payload, 'comment') + else + notes = generate_notes(payload, 'reference') + end + comment_on_referenced_work_packages(work_packages, user, notes) + if payload.object_attributes.noteable_type == 'Issue' + upsert_issue(work_packages) + end + end + + private + + attr_reader :payload + + # TODO: add key list to simplify the code... + def generate_notes(payload, note_type) + case payload.object_attributes.noteable_type + when 'Commit' + commit_id = payload.commit.id + I18n.t("gitlab_integration.note_commit_referenced_comment", + commit_id: commit_id[0, 8], + commit_url: payload.object_attributes.url, + commit_note: payload.object_attributes.note, + repository: payload.repository.name, + repository_url: payload.repository.homepage, + gitlab_user: payload.user.name, + gitlab_user_url: payload.user.avatar_url) + when 'MergeRequest' + if note_type == 'comment' + I18n.t("gitlab_integration.note_mr_commented_comment", + mr_number: payload.merge_request.iid, + mr_title: payload.merge_request.title, + mr_url: payload.object_attributes.url, + mr_note: payload.object_attributes.note, + repository: payload.repository.name, + repository_url: payload.repository.homepage, + gitlab_user: payload.user.name, + gitlab_user_url: payload.user.avatar_url) + elsif note_type == 'reference' + I18n.t("gitlab_integration.note_mr_referenced_comment", + mr_number: payload.merge_request.iid, + mr_title: payload.merge_request.title, + mr_url: payload.object_attributes.url, + mr_note: payload.object_attributes.note, + repository: payload.repository.name, + repository_url: payload.repository.homepage, + gitlab_user: payload.user.name, + gitlab_user_url: payload.user.avatar_url) + end + when 'Issue' + if note_type == 'comment' + I18n.t("gitlab_integration.note_issue_commented_comment", + issue_number: payload.issue.iid, + issue_title: payload.issue.title, + issue_url: payload.object_attributes.url, + issue_note: payload.object_attributes.note, + repository: payload.repository.name, + repository_url: payload.repository.homepage, + gitlab_user: payload.user.name, + gitlab_user_url: payload.user.avatar_url) + elsif note_type == 'reference' + I18n.t("gitlab_integration.note_issue_referenced_comment", + issue_number: payload.issue.iid, + issue_title: payload.issue.title, + issue_url: payload.object_attributes.url, + issue_note: payload.object_attributes.note, + repository: payload.repository.name, + repository_url: payload.repository.homepage, + gitlab_user: payload.user.name, + gitlab_user_url: payload.user.avatar_url) + end + when 'Snippet' + I18n.t("gitlab_integration.note_snippet_referenced_comment", + snippet_number: payload.snippet.id, + snippet_title: payload.snippet.title, + snippet_url: payload.object_attributes.url, + snippet_note: payload.object_attributes.note, + repository: payload.repository.name, + repository_url: payload.repository.homepage, + gitlab_user: payload.user.name, + gitlab_user_url: payload.user.avatar_url) + end + end + + def gitlab_issue + @gitlab_issue ||= GitlabIssue + .where(gitlab_id: payload.issue.iid) + .or(GitlabIssue.where(gitlab_html_url: payload.issue.url)) + .take + end + + def upsert_issue(work_packages) + return if work_packages.empty? && gitlab_issue.nil? + + OpenProject::GitlabIntegration::Services::UpsertIssueNote.new.call(payload, + work_packages:) + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/pipeline_hook.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/pipeline_hook.rb new file mode 100644 index 000000000000..c591e18957a3 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/pipeline_hook.rb @@ -0,0 +1,67 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module OpenProject::GitlabIntegration + module NotificationHandler + ## + # Handles Gitlab pipeline notifications. + class PipelineHook + include OpenProject::GitlabIntegration::NotificationHandler::Helper + + def process(payload_params) + @payload = wrap_payload(payload_params) + + return if payload.merge_request.blank? + + merge_request = find_merge_request + return unless merge_request + return unless associated_with_mr? + + # disabled until gitlab issue resolution + OpenProject::GitlabIntegration::Services::UpsertPipeline.new.call( + payload, + merge_request: + ) + end + + private + + attr_reader :payload + + def associated_with_mr? + payload.merge_request.iid.present? + end + + def find_merge_request + gitlab_id = payload.merge_request.iid + GitlabMergeRequest.find_by(gitlab_id:) + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/push_hook.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/push_hook.rb new file mode 100644 index 000000000000..772b8e625625 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/push_hook.rb @@ -0,0 +1,68 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module OpenProject::GitlabIntegration + module NotificationHandler + ## + # Handles Gitlab commit notifications. + class PushHook + include OpenProject::GitlabIntegration::NotificationHandler::Helper + + def process(payload_params) + @payload = wrap_payload(payload_params) + return nil unless payload.object_kind == 'push' + + payload.commits.each do |commit| + user = User.find_by_id(payload.open_project_user_id) + text = commit['title'] + " - " + commit['message'] + work_packages = find_mentioned_work_packages(text, user) + notes = generate_notes(commit, payload) + comment_on_referenced_work_packages(work_packages, user, notes) + end + end + + private + + attr_reader :payload + + def generate_notes(commit, payload) + commit_id = commit['id'] + I18n.t("gitlab_integration.push_single_commit_comment", + commit_number: commit_id[0, 8], + commit_note: commit['message'], + commit_url: commit['url'], + commit_timestamp: commit['timestamp'], + repository: payload.repository.name, + repository_url: payload.repository.homepage, + gitlab_user: payload.user_name, + gitlab_user_url: payload.user_avatar) + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/system_hook.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/system_hook.rb new file mode 100644 index 000000000000..72a56f1fb63d --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handler/system_hook.rb @@ -0,0 +1,68 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +module OpenProject::GitlabIntegration + module NotificationHandler + ## + # Handles Gitlab commit notifications. + class SystemHook + include OpenProject::GitlabIntegration::NotificationHandler::Helper + + def process(payload_params) + @payload = wrap_payload(payload_params) + return nil unless payload.object_kind == 'push' + + payload.commits.each do |commit| + user = User.find_by_id(payload.open_project_user_id) + text = commit['title'] + " - " + commit['message'] + work_packages = find_mentioned_work_packages(text, user) + notes = generate_notes(commit, payload) + comment_on_referenced_work_packages(work_packages, user, notes) + end + end + + private + + attr_reader :payload + + def generate_notes(commit, payload) + commit_id = commit['id'] + I18n.t("gitlab_integration.push_single_commit_comment", + commit_number: commit_id[0, 8], + commit_note: commit['message'], + commit_url: commit['url'], + commit_timestamp: commit['timestamp'], + repository: payload.repository.name, + repository_url: payload.repository.homepage, + gitlab_user: payload.user_name, + gitlab_user_url: payload.user_avatar) + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handlers.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handlers.rb new file mode 100644 index 000000000000..e157bbddf651 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/notification_handlers.rb @@ -0,0 +1,88 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +require_relative 'notification_handler/helper' +require_relative 'notification_handler/issue_hook' +require_relative 'notification_handler/merge_request_hook' +require_relative 'notification_handler/note_hook' +require_relative 'notification_handler/push_hook' +require_relative 'notification_handler/system_hook' + +module OpenProject::GitlabIntegration + ## + # Handles gitlab-related notifications. + module NotificationHandlers + class << self + def merge_request_hook(payload) + with_logging('merge_request_hook') do + OpenProject::GitlabIntegration::NotificationHandler::MergeRequestHook.new.process(payload) + end + end + + def note_hook(payload) + with_logging('note_hook') do + OpenProject::GitlabIntegration::NotificationHandler::NoteHook.new.process(payload) + end + end + + def push_hook(payload) + with_logging('push_hook') do + OpenProject::GitlabIntegration::NotificationHandler::PushHook.new.process(payload) + end + end + + def issue_hook(payload) + with_logging('issue_hook') do + OpenProject::GitlabIntegration::NotificationHandler::IssueHook.new.process(payload) + end + end + + def pipeline_hook(payload) + with_logging('pipeline_hook') do + OpenProject::GitlabIntegration::NotificationHandler::PipelineHook.new.process(payload) + end + end + + def system_hook(payload) + with_logging('system_hook') do + OpenProject::GitlabIntegration::NotificationHandler::SystemHook.new.process(payload) + end + end + + private + + def with_logging(event_hook) + yield if block_given? + rescue StandardError => e + Rails.logger.error "Failed to handle #{event_hook} from Gitlab: #{e} #{e.message}" + raise e + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/patches/api/work_package_representer.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/patches/api/work_package_representer.rb new file mode 100644 index 000000000000..a83a247e96fe --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/patches/api/work_package_representer.rb @@ -0,0 +1,69 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +module OpenProject::GitlabIntegration + module Patches + module API + module WorkPackageRepresenter + module_function + + def extension # rubocop:disable Metrics/AbcSize + ->(*) do + link :gitlab, + cache_if: -> { current_user.allowed_in_work_package?(:show_gitlab_content, represented) } do + next if represented.new_record? + + { + href: "#{work_package_path(id: represented.id)}/tabs/gitlab", + title: "gitlab" + } + end + + link :gitlab_merge_requests do + next if represented.new_record? + + { + href: api_v3_paths.gitlab_merge_requests_by_work_package(represented.id), + title: "Gitlab merge requests" + } + end + + link :gitlab_issues do + next if represented.new_record? + + { + href: api_v3_paths.gitlab_issues_by_work_package(represented.id), + title: "Gitlab Issues" + } + end + end + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/patches/work_package_patch.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/patches/work_package_patch.rb new file mode 100644 index 000000000000..946032fc65a2 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/patches/work_package_patch.rb @@ -0,0 +1,14 @@ +module OpenProject::GitlabIntegration + module Patches + module WorkPackagePatch + extend ActiveSupport::Concern + + included do + has_and_belongs_to_many :gitlab_merge_requests + has_and_belongs_to_many :gitlab_issues + end + end + end +end + +WorkPackage.include OpenProject::GitlabIntegration::Patches::WorkPackagePatch diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/services.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/services.rb new file mode 100644 index 000000000000..ea44e1735213 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/services.rb @@ -0,0 +1,33 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +require_relative 'services/params_helper' +require_relative 'services/upsert_pipeline' +require_relative 'services/upsert_gitlab_user' +require_relative 'services/upsert_merge_request' diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/services/params_helper.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/params_helper.rb new file mode 100644 index 000000000000..ef7a9355c03e --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/params_helper.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +module OpenProject + module GitlabIntegration + module Services + module ParamsHelper + private + + EMPTY_AVATAR_URL = 'https://www.gravatar.com/avatar/?d=mp' + EMPTY_DESCRIPTION = 'No description provided' + + def avatar_url(raw_url) + raw_url.presence || EMPTY_AVATAR_URL + end + + def description(raw_description) + raw_description.presence || EMPTY_DESCRIPTION + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_gitlab_user.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_gitlab_user.rb new file mode 100644 index 000000000000..e9f70e340e4b --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_gitlab_user.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +module OpenProject + module GitlabIntegration + module Services + ## + # Takes user data coming from Gitlab webhook data and stores + # them as a `GitlabUser`. + # If the `GitlabUser` already exists, it is updated. + # + # Returns the upserted `GitlabUser`. + class UpsertGitlabUser + include ParamsHelper + + def call(payload) + GitlabUser.find_or_initialize_by(gitlab_id: payload.id) + .tap do |gitlab_user| + gitlab_user.update!(extract_params(payload)) + end + end + + private + + ## + # Receives the input from the gitlab webhook and translates them + # to our internal representation. + def extract_params(payload) + { + gitlab_id: payload.id, + gitlab_name: payload.name, + gitlab_username: payload.username, + gitlab_email: payload.email, + gitlab_avatar_url: avatar_url(payload.avatar_url) + } + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_issue.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_issue.rb new file mode 100644 index 000000000000..6eb2298d5f9c --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_issue.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +module OpenProject + module GitlabIntegration + module Services + class UpsertIssue + include ParamsHelper + + def call(payload, work_packages: []) + find_or_initialize(payload).tap do |issue| + issue.update!(work_packages: issue.work_packages | work_packages, **extract_params(payload)) + end + end + + private + + def find_or_initialize(payload) + GitlabIssue.find_by_gitlab_identifiers(id: payload.object_attributes.iid, + url: payload.object_attributes.url, + initialize: true) + end + + # Receives the input from the gitlab webhook and translates them + # to our internal representation. + # rubocop:disable Metrics/AbcSize + def extract_params(payload) + { + gitlab_id: payload.object_attributes.iid, + gitlab_user: gitlab_user_id(payload.user), + number: payload.object_attributes.iid, + gitlab_html_url: payload.object_attributes.url, + gitlab_updated_at: payload.object_attributes.updated_at, + state: payload.object_attributes.state, + title: payload.object_attributes.title, + body: description(payload.object_attributes.description), + repository: payload.repository.name, + labels: payload.labels.map { |values| extract_label_values(values) } + } + end + # rubocop:enable Metrics/AbcSize + + def extract_label_values(payload) + { + title: payload['title'], + color: payload['color'] + } + end + + def gitlab_user_id(payload) + return if payload.blank? + + ::OpenProject::GitlabIntegration::Services::UpsertGitlabUser.new.call(payload) + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_issue_note.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_issue_note.rb new file mode 100644 index 000000000000..eb58b8e83e33 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_issue_note.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +module OpenProject + module GitlabIntegration + module Services + class UpsertIssueNote + include ParamsHelper + + def call(payload, work_packages: []) + find_or_initialize(payload).tap do |issue| + issue.update!(work_packages: issue.work_packages | work_packages, **extract_params(payload)) + end + end + + private + + def find_or_initialize(payload) + GitlabIssue.find_by_gitlab_identifiers(id: payload.issue.iid, + url: payload.issue.url, + initialize: true) + end + + # Receives the input from the gitlab webhook and translates them + # to our internal representation. + # rubocop:disable Metrics/AbcSize + def extract_params(payload) + { + gitlab_id: payload.issue.iid, + gitlab_user: gitlab_user_id(payload.user), + number: payload.issue.iid, + gitlab_html_url: payload.issue.url, + gitlab_updated_at: payload.issue.updated_at, + state: payload.issue.state, + title: payload.issue.title, + body: description(payload.object_attributes.description), + repository: payload.repository.name, + labels: payload.issue.labels.map { |values| extract_label_values(values) } + } + end + # rubocop:enable Metrics/AbcSize + + def extract_label_values(payload) + { + title: payload['title'], + color: payload['color'] + } + end + + def gitlab_user_id(payload) + return if payload.blank? + + ::OpenProject::GitlabIntegration::Services::UpsertGitlabUser.new.call(payload) + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_merge_request.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_merge_request.rb new file mode 100644 index 000000000000..78c8c0ccfa00 --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_merge_request.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +module OpenProject + module GitlabIntegration + module Services + class UpsertMergeRequest + include ParamsHelper + + def call(payload, work_packages: []) + find_or_initialize(payload).tap do |mr| + mr.update!(work_packages: mr.work_packages | work_packages, **extract_params(payload)) + end + end + + private + + def find_or_initialize(payload) + GitlabMergeRequest.find_by_gitlab_identifiers(id: payload.object_attributes.iid, + url: payload.object_attributes.url, + initialize: true) + end + + # Receives the input from the gitlab webhook and translates them + # to our internal representation. + # rubocop:disable Metrics/AbcSize + def extract_params(payload) + { + gitlab_id: payload.object_attributes.iid, + gitlab_user: gitlab_user_id(payload.user), + number: payload.object_attributes.iid, + gitlab_html_url: payload.object_attributes.url, + gitlab_updated_at: payload.object_attributes.updated_at, + state: payload.object_attributes.state, + title: payload.object_attributes.title, + body: description(payload.object_attributes.description), + repository: payload.repository.name, + draft: payload.object_attributes.work_in_progress, + merged: payload.object_attributes.state == 'merged', + merged_by: gitlab_user_id(payload.user), + merged_at: payload.object_attributes.state == 'merged' ? payload.object_attributes.updated_at : nil, + labels: payload.labels.map { |values| extract_label_values(values) } + } + end + # rubocop:enable Metrics/AbcSize + + def extract_label_values(payload) + { + title: payload['title'], + color: payload['color'] + } + end + + def gitlab_user_id(payload) + return if payload.blank? + + ::OpenProject::GitlabIntegration::Services::UpsertGitlabUser.new.call(payload) + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_pipeline.rb b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_pipeline.rb new file mode 100644 index 000000000000..0fbdd9ecf7ec --- /dev/null +++ b/modules/gitlab_integration/lib/open_project/gitlab_integration/services/upsert_pipeline.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ +module OpenProject + module GitlabIntegration + module Services + class UpsertPipeline + include ParamsHelper + + def call(payload, merge_request:) + GitlabPipeline.find_or_initialize_by(gitlab_id: payload.object_attributes.iid) + .tap do |pipeline| + pipeline.update!(gitlab_merge_request: merge_request, **extract_params(payload)) + end + end + + private + + # Receives the input from the gitlab webhook and translates them + # to our internal representation. + def extract_params(payload) + { + gitlab_id: payload.object_attributes.iid, + gitlab_html_url: "#{payload.project.web_url}/-/pipelines/#{payload.object_attributes.iid}", + project_id: payload.project.id, + gitlab_user_avatar_url: avatar_url(payload.user.avatar_url), + name: payload.object_attributes.iid, + status: payload.object_attributes.status, + details_url: "#{payload.project.web_url}/-/commit/#{payload.object_attributes.sha[0..7]}", + commit_id: payload.object_attributes.sha[0..7], + username: payload.user.name, + ci_details: payload.builds, + started_at: payload.object_attributes.created_at, + completed_at: payload.object_attributes.finished_at + } + end + end + end + end +end diff --git a/modules/gitlab_integration/lib/openproject-gitlab_integration.rb b/modules/gitlab_integration/lib/openproject-gitlab_integration.rb new file mode 100644 index 000000000000..146bd94ac4ef --- /dev/null +++ b/modules/gitlab_integration/lib/openproject-gitlab_integration.rb @@ -0,0 +1,30 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +require 'open_project/gitlab_integration' diff --git a/modules/gitlab_integration/openproject-gitlab_integration.gemspec b/modules/gitlab_integration/openproject-gitlab_integration.gemspec new file mode 100644 index 000000000000..11f7f31bebe8 --- /dev/null +++ b/modules/gitlab_integration/openproject-gitlab_integration.gemspec @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2023 Ben Tey +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# Copyright (C) 2012-2021 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See docs/COPYRIGHT.rdoc for more details. +#++ + +Gem::Specification.new do |s| + s.name = 'openproject-gitlab_integration' + s.version = '3.0.0' + s.authors = 'OpenProject GmbH, Ben Tey' + s.email = "info@openproject.com" + s.homepage = "https://www.openproject.org/docs/system-admin-guide/integrations/gitlab-integration/" + s.summary = 'OpenProject GitLab Integration' + s.description = 'Integrates OpenProject and GitLab for a better workflow' + s.license = 'GPLv3' + + s.files = Dir['{app,config,db,frontend,lib}/**/*'] + %w[README.md] + + s.add_dependency 'openproject-webhooks' + s.metadata['rubygems_mfa_required'] = 'true' +end diff --git a/modules/gitlab_integration/spec/factories/gitlab_issues.rb b/modules/gitlab_integration/spec/factories/gitlab_issues.rb new file mode 100644 index 000000000000..46516f3481f1 --- /dev/null +++ b/modules/gitlab_integration/spec/factories/gitlab_issues.rb @@ -0,0 +1,56 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +FactoryBot.define do + factory :gitlab_issue do + gitlab_user + + sequence(:number) + sequence(:gitlab_id) + state { 'opened' } + gitlab_html_url { "https://gitlab.com/test_user/test_repo/issues/#{number}" } + + labels { [] } + gitlab_updated_at { Time.current } + sequence(:title) { |n| "Title of ISSUE #{n}" } + sequence(:body) { |n| "Body of ISSUE #{n}" } + sequence(:repository) { |n| "test_user/repo_#{n}" } + + trait :partial do + body { nil } + end + + trait :open do + state { 'opened' } + end + + trait :closed do + state { 'closed' } + end + end +end diff --git a/modules/gitlab_integration/spec/factories/gitlab_merge_requests.rb b/modules/gitlab_integration/spec/factories/gitlab_merge_requests.rb new file mode 100644 index 000000000000..d8a137fde4cb --- /dev/null +++ b/modules/gitlab_integration/spec/factories/gitlab_merge_requests.rb @@ -0,0 +1,70 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +FactoryBot.define do + factory :gitlab_merge_request do + gitlab_user + + sequence(:number) + sequence(:gitlab_id) + state { 'opened' } + gitlab_html_url { "https://gitlab.com/test_user/test_repo/merge/#{number}" } + + labels { [] } + gitlab_updated_at { Time.current } + sequence(:title) { |n| "Title of PR #{n}" } + sequence(:body) { |n| "Body of PR #{n}" } + sequence(:repository) { |n| "test_user/repo_#{n}" } + + draft { false } + merged { false } + merged_by { nil } + merged_at { nil } + + trait :partial do + body { nil } + end + + trait :draft do + draft { true } + end + + trait :open + + trait :closed_unmerged do + state { 'closed' } + end + + trait :closed_merged do + state { 'merged' } + merged { true } + merged_by { association :gitlab_user } + merged_at { Time.current } + end + end +end diff --git a/modules/gitlab_integration/spec/factories/gitlab_pipelines.rb b/modules/gitlab_integration/spec/factories/gitlab_pipelines.rb new file mode 100644 index 000000000000..523c03721f57 --- /dev/null +++ b/modules/gitlab_integration/spec/factories/gitlab_pipelines.rb @@ -0,0 +1,81 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +FactoryBot.define do + factory :gitlab_pipeline do + gitlab_merge_request + + sequence(:gitlab_id) + sequence(:username) { |n| "user_#{n}" } + + name { gitlab_id } + commit_id { SecureRandom.hex[0..7] } + details_url { "https://gitlab.com/test_user/test_repo/commit/#{commit_id}" } + gitlab_html_url { "https://gitlab.com/test_user/test_repo/pipelines/#{gitlab_id}" } + gitlab_user_avatar_url { "https://www.gravatar.com/avatar/#{gitlab_id}/owner.jpg" } + status { 'pending' } + started_at { 1.hour.ago } + completed_at { nil } + project_id { 1 } + + ci_details do + build_list(:gitlab_pipeline_ci_detail, 3) + end + + trait :complete do + status { 'success' } + completed_at { 1.minute.ago } + end + + trait :recent do + started_at { 1.minute.ago } + end + + trait :outdated do + started_at { 1.day.ago } + end + end + + factory :gitlab_pipeline_ci_detail, class: 'Hash' do + skip_create + + initialize_with { attributes } + + stage { %w[test build deploy].sample } + sequence(:name) { |n| "job_#{n}" } + status { 'success' } + started_at { 1.hour.ago } + created_at { started_at } + finished_at { nil } + duration { nil } + queued_duration { nil } + failure_reason { nil } + manual { false } + allow_failure { false } + end +end diff --git a/modules/gitlab_integration/spec/factories/gitlab_users.rb b/modules/gitlab_integration/spec/factories/gitlab_users.rb new file mode 100644 index 000000000000..34561c184afe --- /dev/null +++ b/modules/gitlab_integration/spec/factories/gitlab_users.rb @@ -0,0 +1,37 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +FactoryBot.define do + factory :gitlab_user do + sequence(:gitlab_id) + sequence(:gitlab_username) { |n| "user_#{n}" } + gitlab_name { "User #{gitlab_username}" } + gitlab_email { "[REDACTED]" } + gitlab_avatar_url { "https://gitlab.com/#{gitlab_username}_avatar.jpg" } + end +end diff --git a/modules/gitlab_integration/spec/features/work_package_gitlab_issue_activity_spec.rb b/modules/gitlab_integration/spec/features/work_package_gitlab_issue_activity_spec.rb new file mode 100644 index 000000000000..536e5ecfc622 --- /dev/null +++ b/modules/gitlab_integration/spec/features/work_package_gitlab_issue_activity_spec.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Work Package Activity Tab', + 'Comments by Gitlab', + :js, + :with_cuprite do + shared_let(:gitlab_system_user) { create(:admin, firstname: 'Gitlab', lastname: 'System User') } + shared_let(:admin) { create(:admin) } + + shared_let(:project) { create(:project, enabled_module_names: Setting.default_projects_modules + %w[activity]) } + shared_let(:work_package) { create(:work_package, project:) } + + shared_let(:issue_author) { create(:gitlab_user, gitlab_username: 'i_am_the_author') } + shared_let(:issue_closing_user) { create(:gitlab_user, gitlab_username: 'i_closed') } + + shared_let(:issue) do + create(:gitlab_issue, + gitlab_user: issue_author) + end + + def trigger_issue_action + OpenProject::GitlabIntegration::NotificationHandler::IssueHook.new + .process(payload) + + issue.reload + end + + let(:mr_description) { "Mentioning OP##{work_package.id}" } + let(:gitlab_action) { 'close' } + let(:issue_state) { 'closed' } + let(:labels) { [] } + + let(:payload) do + { + 'open_project_user_id' => gitlab_system_user.id, + 'object_kind' => "issue", + 'event_type' => "issue", + 'user' => { + 'id' => issue_closing_user.gitlab_id, + 'name' => issue_closing_user.gitlab_name, + 'username' => issue_closing_user.gitlab_username, + 'avatar_url' => issue_closing_user.gitlab_avatar_url, + 'email' => issue_closing_user.gitlab_email + }, + 'object_attributes' => { + 'action' => gitlab_action, + 'assignee_id' => nil, + 'author_id' => 1, + 'created_at' => '2024-03-04 16:09:08 UTC', + 'title' => 'An Issue title', + 'description' => mr_description, + 'draft' => false, + 'work_in_progress' => false, + 'state' => issue_state, + 'id' => issue.gitlab_id, + 'iid' => issue.gitlab_id, + 'head_pipeline_id' => nil, + 'url' => 'http://79dfcd98b723/root/hot_do/-/issues/4', + 'updated_at' => Time.current.iso8601 + }, + 'labels' => labels, + 'repository' => { + 'name' => "Hot Do", + 'url' => "git@79dfcd98b723:root/hot_do.git", + 'description' => nil, + 'homepage' => 'http://79dfcd98b723/root/hot_do/-/issues/4' + } + } + end + + let(:work_package_page) { Pages::SplitWorkPackage.new(work_package, project) } + + context 'when there is an issue event' do + before do + trigger_issue_action + login_as admin + end + + context "and I visit the work package's activity tab" do + before do + work_package_page.visit_tab! 'activity' + work_package_page.ensure_page_loaded + end + + let(:expected_comment) do + "Issue Closed: Issue #{issue.gitlab_id} #{issue.title} for #{issue.repository} " \ + "has been closed by #{issue_closing_user.gitlab_name}." + end + + it 'renders a comment referencing the issue' do + expect(page).to have_css('.user-comment > .message', text: expected_comment) + end + end + end +end diff --git a/modules/gitlab_integration/spec/features/work_package_gitlab_merge_request_activity_spec.rb b/modules/gitlab_integration/spec/features/work_package_gitlab_merge_request_activity_spec.rb new file mode 100644 index 000000000000..c018ba365879 --- /dev/null +++ b/modules/gitlab_integration/spec/features/work_package_gitlab_merge_request_activity_spec.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Work Package Activity Tab', + 'Comments by Gitlab', + :js, + :with_cuprite do + shared_let(:gitlab_system_user) { create(:admin, firstname: 'Gitlab', lastname: 'System User') } + shared_let(:admin) { create(:admin) } + + shared_let(:project) { create(:project, enabled_module_names: Setting.default_projects_modules + %w[activity]) } + shared_let(:work_package) { create(:work_package, project:) } + + shared_let(:merge_request_author) { create(:gitlab_user, gitlab_username: 'i_am_the_author') } + shared_let(:merge_request_merging_user) { create(:gitlab_user, gitlab_username: 'i_merged') } + shared_let(:merge_request) do + create(:gitlab_merge_request, + gitlab_user: merge_request_author) + end + + def trigger_merge_request_action + OpenProject::GitlabIntegration::NotificationHandler::MergeRequestHook.new + .process(payload) + + merge_request.reload + end + + let(:mr_description) { "Mentioning OP##{work_package.id}" } + let(:gitlab_action) { 'merge' } + let(:mr_state) { 'merged' } + let(:mr_draft) { false } + + let(:payload) do + { + 'open_project_user_id' => gitlab_system_user.id, + 'object_kind' => "merge_request", + 'event_type' => "merge_request", + 'user' => { + 'id' => merge_request_merging_user.gitlab_id, + 'name' => merge_request_merging_user.gitlab_name, + 'username' => merge_request_merging_user.gitlab_username, + 'avatar_url' => merge_request_merging_user.gitlab_avatar_url, + 'email' => merge_request_merging_user.gitlab_email + }, + 'object_attributes' => { + 'action' => gitlab_action, + 'assignee_id' => nil, + 'author_id' => 1, + 'created_at' => '2024-03-04 16:09:08 UTC', + 'title' => 'A MR title', + 'description' => mr_description, + 'draft' => mr_draft, + 'work_in_progress' => mr_draft, + 'state' => mr_state, + 'head_pipeline_id' => nil, + 'id' => merge_request.gitlab_id, + 'iid' => merge_request.gitlab_id, + 'url' => 'http://79dfcd98b723/root/hot_do/-/merge_requests/4', + 'updated_at' => Time.current.iso8601 + }, + 'labels' => [], + 'repository' => { + 'name' => "Hot Do", + 'url' => "git@79dfcd98b723:root/hot_do.git", + 'description' => nil, + 'homepage' => 'http://79dfcd98b723/root/hot_do/-/merge_requests/4' + } + } + end + + let(:work_package_page) { Pages::SplitWorkPackage.new(work_package, project) } + + context 'when there is a merge request event' do + before do + trigger_merge_request_action + login_as admin + end + + context "and I visit the work package's activity tab" do + before do + work_package_page.visit_tab! 'activity' + work_package_page.ensure_page_loaded + end + + let(:expected_comment) do + "MR Merged: Merge request #{merge_request.gitlab_id} " \ + "#{merge_request.title} for #{merge_request.repository} has been merged by " \ + "#{merge_request_merging_user.gitlab_name}." + end + + it 'renders a comment referencing the Merge Request' do + expect(page).to have_css('.user-comment > .message', text: expected_comment) + end + end + end +end diff --git a/modules/gitlab_integration/spec/features/work_package_gitlab_tab_spec.rb b/modules/gitlab_integration/spec/features/work_package_gitlab_tab_spec.rb new file mode 100644 index 000000000000..dc9d8f35015c --- /dev/null +++ b/modules/gitlab_integration/spec/features/work_package_gitlab_tab_spec.rb @@ -0,0 +1,155 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper +require_relative '../support/pages/work_package_gitlab_tab' + +RSpec.describe 'Open the Gitlab tab', :js do + let(:user) { create(:user, member_with_roles: { project => role }) } + + let(:role) do + create(:project_role, + permissions: %i(view_work_packages + add_work_package_notes + show_gitlab_content)) + end + + let(:project) do + create(:project, + enabled_module_names: %i[work_package_tracking gitlab]) + end + + let(:work_package) { create(:work_package, project:, subject: 'A test work_package') } + + let(:tabs) { Components::WorkPackages::Tabs.new(work_package) } + let(:gitlab_tab_element) { find('.op-tab-row--link_selected', text: 'GITLAB') } + let(:gitlab_tab) { Pages::GitlabTab.new(work_package.id) } + + let(:issue) { create(:gitlab_issue, :open, work_packages: [work_package], title: 'A Test Issue title') } + let(:merge_request) { create(:gitlab_merge_request, :open, work_packages: [work_package], title: 'A Test MR title') } + + let(:pipeline) do + create(:gitlab_pipeline, gitlab_merge_request: merge_request, name: 'a pipeline name') + end + + shared_examples_for "a gitlab tab" do + before do + issue + pipeline + login_as(user) + end + + # compares the clipboard content by drafting a new comment, pressing ctrl+v and + # comparing the pasted content against the provided text + def expect_clipboard_content(text) + work_package_page.switch_to_tab(tab: 'activity') + + work_package_page.trigger_edit_comment + work_package_page.update_comment(' ') # ensure the comment editor is fully loaded + gitlab_tab.paste_clipboard_content + expect(work_package_page.add_comment_container).to have_content(text) + + work_package_page.switch_to_tab(tab: 'gitlab') + end + + it 'shows the gitlab tab when the user is allowed to see it' do + work_package_page.visit! + work_package_page.switch_to_tab(tab: 'gitlab') + + tabs.expect_counter(gitlab_tab_element, 2) + + gitlab_tab.git_actions_menu_button.click + gitlab_tab.git_actions_copy_branch_name_button.click + expect(page).to have_text('Copied!') + expect_clipboard_content("#{work_package.type.name.downcase}/#{work_package.id}-a-test-work_package") + + expect(page).to have_text('A Test Issue title') + expect(page).to have_text('Open') + + expect(page).to have_text('A Test MR title') + expect(page).to have_text('Pending') + end + + context 'when there are no merge requests or issues' do + let(:pipeline) { nil } + let(:merge_request) { nil } + let(:issue) { nil } + + it 'shows the gitlab tab with an empty message' do + work_package_page.visit! + work_package_page.switch_to_tab(tab: 'gitlab') + tabs.expect_no_counter(gitlab_tab_element) + + expect(page).to have_content('There are no issues linked yet.') + expect(page).to have_content("Link an existing issue by using the code OP##{work_package.id} " \ + "(or PP##{work_package.id} for private links) in the issue title/description " \ + "or create a new issue") + + expect(page).to have_content('There are no merge requests') + expect(page).to have_content("Link an existing MR by using the code OP##{work_package.id}") + end + end + + context 'when the user does not have the permissions to see the gitlab tab' do + let(:role) do + create(:project_role, + permissions: %i(view_work_packages + add_work_package_notes)) + end + + it 'does not show the gitlab tab' do + work_package_page.visit! + + gitlab_tab.expect_tab_not_present + end + end + + context 'when the gitlab integration is not enabled for the project' do + let(:project) { create(:project, disable_modules: 'gitlab') } + + it 'does not show the gitlab tab' do + work_package_page.visit! + + gitlab_tab.expect_tab_not_present + end + end + end + + describe 'work package full view' do + let(:work_package_page) { Pages::FullWorkPackage.new(work_package) } + + it_behaves_like 'a gitlab tab' + end + + describe 'work package split view' do + let(:work_package_page) { Pages::SplitWorkPackage.new(work_package) } + + it_behaves_like 'a gitlab tab' + end +end diff --git a/modules/gitlab_integration/spec/lib/api/v3/gitlab_issues/gitlab_issue_representer_spec.rb b/modules/gitlab_integration/spec/lib/api/v3/gitlab_issues/gitlab_issue_representer_spec.rb new file mode 100644 index 000000000000..2abdb7603681 --- /dev/null +++ b/modules/gitlab_integration/spec/lib/api/v3/gitlab_issues/gitlab_issue_representer_spec.rb @@ -0,0 +1,159 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe API::V3::GitlabIssues::GitlabIssueRepresenter do + include API::V3::Utilities::PathHelper + + subject(:generated) { representer.to_json } + + let(:gitlab_issue) do + build_stubbed(:gitlab_issue, + state: 'opened', + labels:, + gitlab_user:) + end + let(:labels) do + [ + { + 'name' => 'grey', + 'color' => '#666' + } + ] + end + let(:gitlab_user) { build_stubbed(:gitlab_user) } + let(:representer) { described_class.create(gitlab_issue, current_user: user) } + + let(:user) { build_stubbed(:admin) } + + it { is_expected.to include_json('GitlabIssue'.to_json).at_path('_type') } + + describe 'properties' do + it_behaves_like 'property', :_type do + let(:value) { 'GitlabIssue' } + end + + it_behaves_like 'property', :id do + let(:value) { gitlab_issue.id } + end + + it_behaves_like 'property', :number do + let(:value) { gitlab_issue.number } + end + + it_behaves_like 'property', :htmlUrl do + let(:value) { gitlab_issue.gitlab_html_url } + end + + it_behaves_like 'property', :state do + let(:value) { gitlab_issue.state } + end + + it_behaves_like 'property', :repository do + let(:value) { gitlab_issue.repository } + end + + it_behaves_like 'property', :title do + let(:value) { gitlab_issue.title } + end + + it_behaves_like 'formattable property', :body do + let(:value) { gitlab_issue.body } + end + + it_behaves_like 'property', :labels do + let(:value) { gitlab_issue.labels } + end + + it_behaves_like 'has UTC ISO 8601 date and time' do + let(:date) { gitlab_issue.created_at } + let(:json_path) { 'createdAt' } + end + + it_behaves_like 'has UTC ISO 8601 date and time' do + let(:date) { gitlab_issue.updated_at } + let(:json_path) { 'updatedAt' } + end + end + + describe '_links' do + it { is_expected.to have_json_type(Object).at_path('_links') } + + it_behaves_like 'has a titled link' do + let(:link) { 'gitlabUser' } + let(:href) { api_v3_paths.gitlab_user(gitlab_user.id) } + let(:title) { gitlab_user.gitlab_name } + end + end + + describe 'caching' do + before do + allow(OpenProject::Cache).to receive(:fetch).and_call_original + end + + it "is based on the representer's cache_key" do + representer.to_json + + expect(OpenProject::Cache) + .to have_received(:fetch) + .with(representer.json_cache_key) + end + + describe '#json_cache_key' do + let!(:former_cache_key) { representer.json_cache_key } + + it 'includes the name of the representer class' do + expect(representer.json_cache_key) + .to include('API', 'V3', 'GitlabIssues', 'GitlabIssueRepresenter') + end + + it 'changes when the locale changes' do + I18n.with_locale(:fr) do + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + + it 'changes when the gitlab_issue is updated' do + gitlab_issue.updated_at = 20.seconds.from_now + + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + + it 'changes when the gitlab_user is updated' do + gitlab_issue.gitlab_user.updated_at = 20.seconds.from_now + + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + end +end diff --git a/modules/gitlab_integration/spec/lib/api/v3/gitlab_issues/gitlab_user_representer_spec.rb b/modules/gitlab_integration/spec/lib/api/v3/gitlab_issues/gitlab_user_representer_spec.rb new file mode 100644 index 000000000000..488f4d2ed586 --- /dev/null +++ b/modules/gitlab_integration/spec/lib/api/v3/gitlab_issues/gitlab_user_representer_spec.rb @@ -0,0 +1,103 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe API::V3::GitlabIssues::GitlabUserRepresenter do + include API::V3::Utilities::PathHelper + + subject(:generated) { representer.to_json } + + let(:gitlab_user) { build_stubbed(:gitlab_user) } + let(:representer) { described_class.create(gitlab_user, current_user: user) } + + let(:user) { build_stubbed(:admin) } + + it { is_expected.to include_json('GitlabUser'.to_json).at_path('_type') } + + describe 'properties' do + it_behaves_like 'property', :_type do + let(:value) { 'GitlabUser' } + end + + it_behaves_like 'property', :login do + let(:value) { gitlab_user.gitlab_name } + end + + it_behaves_like 'property', :email do + let(:value) { gitlab_user.gitlab_email } + end + + it_behaves_like 'property', :avatarUrl do + let(:value) { gitlab_user.gitlab_avatar_url } + end + end + + describe '_links' do + it { is_expected.to have_json_type(Object).at_path('_links') } + it { is_expected.to have_json_path('_links/self/href') } + end + + describe 'caching' do + before do + allow(OpenProject::Cache).to receive(:fetch).and_call_original + end + + it "is based on the representer's cache_key" do + representer.to_json + + expect(OpenProject::Cache) + .to have_received(:fetch) + .with(representer.json_cache_key) + end + + describe '#json_cache_key' do + let!(:former_cache_key) { representer.json_cache_key } + + it 'includes the name of the representer class' do + expect(representer.json_cache_key) + .to include('API', 'V3', 'GitlabIssues', 'GitlabUserRepresenter') + end + + it 'changes when the locale changes' do + I18n.with_locale(:fr) do + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + + it 'changes when the gitlab_user is updated' do + gitlab_user.updated_at = 20.seconds.from_now + + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + end +end diff --git a/modules/gitlab_integration/spec/lib/api/v3/gitlab_merge_requests/gitlab_merge_request_representer_spec.rb b/modules/gitlab_integration/spec/lib/api/v3/gitlab_merge_requests/gitlab_merge_request_representer_spec.rb new file mode 100644 index 000000000000..02c7261412ea --- /dev/null +++ b/modules/gitlab_integration/spec/lib/api/v3/gitlab_merge_requests/gitlab_merge_request_representer_spec.rb @@ -0,0 +1,205 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe API::V3::GitlabMergeRequests::GitlabMergeRequestRepresenter do + include API::V3::Utilities::PathHelper + + subject(:generated) { representer.to_json } + + let(:gitlab_merge_request) do + build_stubbed(:gitlab_merge_request, + state: 'opened', + labels:, + gitlab_user:, + merged_by:).tap do |pr| + allow(pr) + .to receive(:latest_pipelines) + .and_return(latest_pipelines) + end + end + let(:labels) do + [ + { + 'name' => 'grey', + 'color' => '#666' + } + ] + end + let(:gitlab_user) { build_stubbed(:gitlab_user) } + let(:merged_by) { build_stubbed(:gitlab_user) } + let(:latest_pipelines) { [pipeline] } + let(:pipeline) { build_stubbed(:gitlab_pipeline) } + let(:representer) { described_class.create(gitlab_merge_request, current_user: user) } + + let(:user) { build_stubbed(:admin) } + + it { is_expected.to include_json('GitlabMergeRequest'.to_json).at_path('_type') } + + describe 'properties' do + it_behaves_like 'property', :_type do + let(:value) { 'GitlabMergeRequest' } + end + + it_behaves_like 'property', :id do + let(:value) { gitlab_merge_request.id } + end + + it_behaves_like 'property', :number do + let(:value) { gitlab_merge_request.number } + end + + it_behaves_like 'property', :htmlUrl do + let(:value) { gitlab_merge_request.gitlab_html_url } + end + + it_behaves_like 'property', :state do + let(:value) { gitlab_merge_request.state } + end + + it_behaves_like 'property', :repository do + let(:value) { gitlab_merge_request.repository } + end + + it_behaves_like 'property', :title do + let(:value) { gitlab_merge_request.title } + end + + it_behaves_like 'formattable property', :body do + let(:value) { gitlab_merge_request.body } + end + + it_behaves_like 'property', :draft do + let(:value) { gitlab_merge_request.draft } + end + + it_behaves_like 'property', :merged do + let(:value) { gitlab_merge_request.merged } + end + + it_behaves_like 'property', :labels do + let(:value) { gitlab_merge_request.labels } + end + + it_behaves_like 'has UTC ISO 8601 date and time' do + let(:date) { gitlab_merge_request.gitlab_updated_at } + let(:json_path) { 'gitlabUpdatedAt' } + end + + it_behaves_like 'has UTC ISO 8601 date and time' do + let(:date) { gitlab_merge_request.created_at } + let(:json_path) { 'createdAt' } + end + + it_behaves_like 'has UTC ISO 8601 date and time' do + let(:date) { gitlab_merge_request.updated_at } + let(:json_path) { 'updatedAt' } + end + end + + describe '_links' do + it { is_expected.to have_json_type(Object).at_path('_links') } + + it_behaves_like 'has a titled link' do + let(:link) { 'gitlabUser' } + let(:href) { api_v3_paths.gitlab_user(gitlab_user.id) } + let(:title) { gitlab_user.gitlab_name } + end + + it_behaves_like 'has a titled link' do + let(:link) { 'mergedBy' } + let(:href) { api_v3_paths.gitlab_user(merged_by.id) } + let(:title) { merged_by.gitlab_name } + end + + it_behaves_like 'has a link collection' do + let(:link) { 'pipelines' } + let(:hrefs) do + [ + { + 'href' => api_v3_paths.gitlab_pipeline(pipeline.id), + 'title' => pipeline.name + } + ] + end + end + end + + describe 'caching' do + before do + allow(OpenProject::Cache).to receive(:fetch).and_call_original + end + + it "is based on the representer's cache_key" do + representer.to_json + + expect(OpenProject::Cache) + .to have_received(:fetch) + .with(representer.json_cache_key) + end + + describe '#json_cache_key' do + let!(:former_cache_key) { representer.json_cache_key } + + it 'includes the name of the representer class' do + expect(representer.json_cache_key) + .to include('API', 'V3', 'GitlabMergeRequests', 'GitlabMergeRequestRepresenter') + end + + it 'changes when the locale changes' do + I18n.with_locale(:fr) do + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + + it 'changes when the gitlab_merge_request is updated' do + gitlab_merge_request.updated_at = 20.seconds.from_now + + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + + it 'changes when the gitlab_user is updated' do + gitlab_merge_request.gitlab_user.updated_at = 20.seconds.from_now + + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + + it 'changes when the merged_by user is updated' do + gitlab_merge_request.merged_by.updated_at = 20.seconds.from_now + + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + end +end diff --git a/modules/gitlab_integration/spec/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer_spec.rb b/modules/gitlab_integration/spec/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer_spec.rb new file mode 100644 index 000000000000..683566c2677c --- /dev/null +++ b/modules/gitlab_integration/spec/lib/api/v3/gitlab_merge_requests/gitlab_pipeline_representer_spec.rb @@ -0,0 +1,132 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe API::V3::GitlabMergeRequests::GitlabPipelineRepresenter do + include API::V3::Utilities::PathHelper + + subject(:generated) { representer.to_json } + + let(:pipeline) { build_stubbed(:gitlab_pipeline, :complete) } + let(:representer) { described_class.create(pipeline, current_user: user) } + let(:user) { build_stubbed(:admin) } + + it { is_expected.to include_json('GitlabPipeline'.to_json).at_path('_type') } + + describe 'properties' do + it_behaves_like 'property', :_type do + let(:value) { 'GitlabPipeline' } + end + + it_behaves_like 'property', :htmlUrl do + let(:value) { pipeline.gitlab_html_url } + end + + it_behaves_like 'property', :userAvatarUrl do + let(:value) { pipeline.gitlab_user_avatar_url } + end + + it_behaves_like 'property', :name do + let(:value) { pipeline.name } + end + + it_behaves_like 'property', :status do + let(:value) { pipeline.status } + end + + it_behaves_like 'property', :detailsUrl do + let(:value) { pipeline.details_url } + end + + it_behaves_like 'property', :ciDetails do + let(:value) { pipeline.ci_details } + end + + it_behaves_like 'property', :username do + let(:value) { pipeline.username } + end + + it_behaves_like 'property', :commitId do + let(:value) { pipeline.commit_id } + end + + it_behaves_like 'has UTC ISO 8601 date and time' do + let(:date) { pipeline.started_at } + let(:json_path) { 'startedAt' } + end + + it_behaves_like 'has UTC ISO 8601 date and time' do + let(:date) { pipeline.completed_at } + let(:json_path) { 'completedAt' } + end + end + + describe '_links' do + it { is_expected.to have_json_type(Object).at_path('_links') } + it { is_expected.to have_json_path('_links/self/href') } + end + + describe 'caching' do + before do + allow(OpenProject::Cache).to receive(:fetch).and_call_original + end + + it "is based on the representer's cache_key" do + representer.to_json + + expect(OpenProject::Cache) + .to have_received(:fetch) + .with(representer.json_cache_key) + end + + describe '#json_cache_key' do + let!(:former_cache_key) { representer.json_cache_key } + + it 'includes the name of the representer class' do + expect(representer.json_cache_key) + .to include('API', 'V3', 'GitlabMergeRequests', 'GitlabPipelineRepresenter') + end + + it 'changes when the locale changes' do + I18n.with_locale(:fr) do + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + + it 'changes when the check run is updated' do + pipeline.updated_at = 20.seconds.from_now + + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + end +end diff --git a/modules/gitlab_integration/spec/lib/api/v3/gitlab_merge_requests/gitlab_user_representer_spec.rb b/modules/gitlab_integration/spec/lib/api/v3/gitlab_merge_requests/gitlab_user_representer_spec.rb new file mode 100644 index 000000000000..e50adcdfc0c2 --- /dev/null +++ b/modules/gitlab_integration/spec/lib/api/v3/gitlab_merge_requests/gitlab_user_representer_spec.rb @@ -0,0 +1,103 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe API::V3::GitlabMergeRequests::GitlabUserRepresenter do + include API::V3::Utilities::PathHelper + + subject(:generated) { representer.to_json } + + let(:gitlab_user) { build_stubbed(:gitlab_user) } + let(:representer) { described_class.create(gitlab_user, current_user: user) } + + let(:user) { build_stubbed(:admin) } + + it { is_expected.to include_json('GitlabUser'.to_json).at_path('_type') } + + describe 'properties' do + it_behaves_like 'property', :_type do + let(:value) { 'GitlabUser' } + end + + it_behaves_like 'property', :login do + let(:value) { gitlab_user.gitlab_name } + end + + it_behaves_like 'property', :email do + let(:value) { gitlab_user.gitlab_email } + end + + it_behaves_like 'property', :avatarUrl do + let(:value) { gitlab_user.gitlab_avatar_url } + end + end + + describe '_links' do + it { is_expected.to have_json_type(Object).at_path('_links') } + it { is_expected.to have_json_path('_links/self/href') } + end + + describe 'caching' do + before do + allow(OpenProject::Cache).to receive(:fetch).and_call_original + end + + it "is based on the representer's cache_key" do + representer.to_json + + expect(OpenProject::Cache) + .to have_received(:fetch) + .with(representer.json_cache_key) + end + + describe '#json_cache_key' do + let!(:former_cache_key) { representer.json_cache_key } + + it 'includes the name of the representer class' do + expect(representer.json_cache_key) + .to include('API', 'V3', 'GitlabMergeRequests', 'GitlabUserRepresenter') + end + + it 'changes when the locale changes' do + I18n.with_locale(:fr) do + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + + it 'changes when the gitlab_user is updated' do + gitlab_user.updated_at = 20.seconds.from_now + + expect(representer.json_cache_key) + .not_to eql former_cache_key + end + end + end +end diff --git a/modules/gitlab_integration/spec/lib/open_project/gitlab_integration/notification_handler/issue_hook_spec.rb b/modules/gitlab_integration/spec/lib/open_project/gitlab_integration/notification_handler/issue_hook_spec.rb new file mode 100644 index 000000000000..cea60477e6fa --- /dev/null +++ b/modules/gitlab_integration/spec/lib/open_project/gitlab_integration/notification_handler/issue_hook_spec.rb @@ -0,0 +1,229 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe OpenProject::GitlabIntegration::NotificationHandler::IssueHook do + subject(:process) { handler_instance.process(payload) } + + shared_let(:gitlab_system_user) { create(:admin) } + shared_let(:work_package) { create(:work_package) } + + let(:handler_instance) { described_class.new } + let(:upsert_service) { OpenProject::GitlabIntegration::Services::UpsertIssue.new } + let(:gitlab_issue) { GitlabIssue.find_by_gitlab_identifiers(id: 5) } + + let(:mr_description) { "Mentioning OP##{work_package.id}" } + let(:gitlab_action) { 'open' } + let(:issue_state) { 'opened' } + let(:issue_draft) { false } + let(:labels) { [] } + + let(:payload) do + { + 'open_project_user_id' => gitlab_system_user.id, + 'object_kind' => "issue", + 'event_type' => "issue", + 'user' => { + 'id' => 1, + 'name' => "Administrator", + 'username' => "root", + 'avatar_url' => "https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon", + 'email' => "[REDACTED]" + }, + 'object_attributes' => { + 'action' => gitlab_action, + 'assignee_id' => nil, + 'author_id' => 1, + 'created_at' => '2024-03-04 16:09:08 UTC', + 'title' => 'An Issue title', + 'description' => mr_description, + 'draft' => issue_draft, + 'work_in_progress' => issue_draft, + 'state' => issue_state, + 'id' => 5, + 'iid' => 5, + 'head_pipeline_id' => nil, + 'url' => 'http://79dfcd98b723/root/hot_do/-/issues/4', + 'updated_at' => Time.current.iso8601 + }, + 'labels' => labels, + 'repository' => { + 'name' => "Hot Do", + 'url' => "git@79dfcd98b723:root/hot_do.git", + 'description' => nil, + 'homepage' => 'http://79dfcd98b723/root/hot_do/-/issues/4' + } + } + end + + before do + allow(handler_instance).to receive(:comment_on_referenced_work_packages).and_return(nil) + allow(OpenProject::GitlabIntegration::Services::UpsertIssue).to receive(:new).and_return(upsert_service) + allow(upsert_service).to receive(:call).and_call_original + end + + shared_examples_for 'not adding a comment' do + it 'does not add comments to work packages' do + process + expect(handler_instance).not_to have_received(:comment_on_referenced_work_packages) + end + end + + shared_examples_for 'adding a comment' do + it 'adds a comment to the work packages' do + process + expect(handler_instance).to have_received(:comment_on_referenced_work_packages).with( + [work_package], + gitlab_system_user, + comment + ) + end + end + + shared_examples_for 'calls the issue upsert service' do + it 'calls the issue upsert service' do + process + expect(upsert_service).to have_received(:call) + .with(a_kind_of(OpenProject::GitlabIntegration::NotificationHandler::Helper::Payload), work_packages: [work_package]) + end + + context 'when no work_package was mentioned' do + let(:mr_description) { 'some text that does not mention any work package' } + + it 'does not call the issue upsert service' do + process + expect(upsert_service).not_to have_received(:call) + end + end + end + + context 'with an opened action' do + let(:comment) do + "**Issue Opened:** Issue 5 [An Issue title](http://79dfcd98b723/root/hot_do/-/issues/4) for " \ + "[Hot Do](http://79dfcd98b723/root/hot_do/-/issues/4) has been opened by " \ + "[Administrator](https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon).\n" + end + + it_behaves_like 'adding a comment' + it_behaves_like 'calls the issue upsert service' + end + + context 'with a closed action' do + let(:gitlab_action) { 'close' } + let(:issue_state) { 'closed' } + + let(:comment) do + "**Issue Closed:** Issue 5 [An Issue title](http://79dfcd98b723/root/hot_do/-/issues/4) for " \ + "[Hot Do](http://79dfcd98b723/root/hot_do/-/issues/4) has been closed by " \ + "[Administrator](https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon).\n" + end + + it_behaves_like 'adding a comment' + it_behaves_like 'calls the issue upsert service' + + context 'when the work package is already known to the GitlabIssue' do + let!(:gitlab_issue) { create(:gitlab_issue, gitlab_id: 5, work_packages: [work_package]) } + + it_behaves_like 'adding a comment' + + it 'calls the issue upsert service' do + expect { process }.to change { gitlab_issue.reload.state }.from('opened').to('closed') + expect(upsert_service).to have_received(:call).with( + a_kind_of(OpenProject::GitlabIntegration::NotificationHandler::Helper::Payload), work_packages: [work_package] + ) + end + end + end + + context 'with a labeled action' do + let!(:gitlab_issue) { create(:gitlab_issue, gitlab_id: 5, work_packages: [work_package]) } + let(:gitlab_action) { 'update' } + let(:issue_state) { 'opened' } + + let(:labels) do + [ + { + "id" => 1, + "title" => "feature", + "color" => "#009966", + "project_id" => 1, + "created_at" => "2024-03-04 14:30:36 UTC", + "updated_at" => "2024-03-04 14:30:36 UTC", + "template" => false, + "description" => nil, + "type" => "ProjectLabel", + "group_id" => nil, + "lock_on_merge" => false + }, + { + "id" => 2, + "title" => "needs review", + "color" => "#9400d3", + "project_id" => 1, + "created_at" => "2024-03-04 15:46:50 UTC", + "updated_at" => "2024-03-04 15:46:50 UTC", + "template" => false, + "description" => nil, + "type" => "ProjectLabel", + "group_id" => nil, + "lock_on_merge" => false + } + ] + end + + # No comment is added when the labels are updated as there is no UI yet for labels supported by the plugin + let(:comment) { nil } + + it_behaves_like 'adding a comment' + + it 'calls the issue upsert service with all work_packages' do + gitlab_issue = process.reload + expect(gitlab_issue.labels).to eq([{ "title" => "feature", "color" => "#009966" }, + { "title" => "needs review", "color" => "#9400d3" }]) + + expect(upsert_service).to have_received(:call).with(a_kind_of(OpenProject::GitlabIntegration::NotificationHandler::Helper::Payload), + work_packages: [work_package]) + end + end + + context 'with a reopened action' do + let(:gitlab_action) { 'reopen' } + let(:issue_state) { 'opened' } + + let(:comment) do + "**Issue Reopened:** Issue 5 [An Issue title](http://79dfcd98b723/root/hot_do/-/issues/4) for " \ + "[Hot Do](http://79dfcd98b723/root/hot_do/-/issues/4) has been reopened by " \ + "[Administrator](https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon).\n" + end + + it_behaves_like 'adding a comment' + it_behaves_like 'calls the issue upsert service' + end +end diff --git a/modules/gitlab_integration/spec/lib/open_project/gitlab_integration/notification_handler/merge_request_hook_spec.rb b/modules/gitlab_integration/spec/lib/open_project/gitlab_integration/notification_handler/merge_request_hook_spec.rb new file mode 100644 index 000000000000..8ae0e8ca2a2b --- /dev/null +++ b/modules/gitlab_integration/spec/lib/open_project/gitlab_integration/notification_handler/merge_request_hook_spec.rb @@ -0,0 +1,270 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe OpenProject::GitlabIntegration::NotificationHandler::MergeRequestHook do + subject(:process) { handler_instance.process(payload) } + + shared_let(:gitlab_system_user) { create(:admin) } + shared_let(:work_package) { create(:work_package) } + + let(:handler_instance) { described_class.new } + let(:upsert_service) { OpenProject::GitlabIntegration::Services::UpsertMergeRequest.new } + let(:gitlab_merge_request) { GitlabMergeRequest.find_by_gitlab_identifiers(id: 4) } + + let(:mr_description) { "Mentioning OP##{work_package.id}" } + let(:gitlab_action) { 'open' } + let(:mr_state) { 'opened' } + let(:mr_draft) { false } + let(:labels) { [] } + + let(:payload) do + { + 'open_project_user_id' => gitlab_system_user.id, + 'object_kind' => "merge_request", + 'event_type' => "merge_request", + 'user' => { + 'id' => 1, + 'name' => "Administrator", + 'username' => "root", + 'avatar_url' => "https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon", + 'email' => "[REDACTED]" + }, + 'object_attributes' => { + 'action' => gitlab_action, + 'assignee_id' => nil, + 'author_id' => 1, + 'created_at' => '2024-03-04 16:09:08 UTC', + 'title' => 'A MR title', + 'description' => mr_description, + 'draft' => mr_draft, + 'work_in_progress' => mr_draft, + 'state' => mr_state, + 'head_pipeline_id' => nil, + 'id' => 4, + 'iid' => 4, + 'url' => 'http://79dfcd98b723/root/hot_do/-/merge_requests/4', + 'updated_at' => Time.current.iso8601 + }, + 'labels' => labels, + 'repository' => { + 'name' => "Hot Do", + 'url' => "git@79dfcd98b723:root/hot_do.git", + 'description' => nil, + 'homepage' => 'http://79dfcd98b723/root/hot_do/-/merge_requests/4' + } + } + end + + before do + allow(handler_instance).to receive(:comment_on_referenced_work_packages).and_return(nil) + allow(OpenProject::GitlabIntegration::Services::UpsertMergeRequest).to receive(:new).and_return(upsert_service) + allow(upsert_service).to receive(:call).and_call_original + end + + shared_examples_for 'not adding a comment' do + it 'does not add comments to work packages' do + process + expect(handler_instance).not_to have_received(:comment_on_referenced_work_packages) + end + end + + shared_examples_for 'adding a comment' do + it 'adds a comment to the work packages' do + process + expect(handler_instance).to have_received(:comment_on_referenced_work_packages).with( + [work_package], + gitlab_system_user, + comment + ) + end + end + + shared_examples_for 'calls the merge request upsert service' do + it 'calls the merge request upsert service' do + process + expect(upsert_service).to have_received(:call) + .with(a_kind_of(OpenProject::GitlabIntegration::NotificationHandler::Helper::Payload), work_packages: [work_package]) + end + + context 'when no work_package was mentioned' do + let(:mr_description) { 'some text that does not mention any work package' } + + it 'does not call the merge request upsert service' do + process + expect(upsert_service).not_to have_received(:call) + end + end + end + + context 'with an opened action' do + let(:comment) do + "**MR Opened:** Merge request 4 [A MR title](http://79dfcd98b723/root/hot_do/-/merge_requests/4) for " \ + "[Hot Do](git@79dfcd98b723:root/hot_do.git) has been opened by " \ + "[Administrator](https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon).\n" + end + + it_behaves_like 'adding a comment' + it_behaves_like 'calls the merge request upsert service' + end + + context 'with a closed action' do + let(:gitlab_action) { 'close' } + let(:mr_state) { 'closed' } + + let(:comment) do + "**MR Closed:** Merge request 4 [A MR title](http://79dfcd98b723/root/hot_do/-/merge_requests/4) for " \ + "[Hot Do](git@79dfcd98b723:root/hot_do.git) has been closed by " \ + "[Administrator](https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon).\n" + end + + it_behaves_like 'adding a comment' + it_behaves_like 'calls the merge request upsert service' + end + + context 'when the MR was merged' do + let(:gitlab_action) { 'merge' } + let(:mr_state) { 'merged' } + + let(:comment) do + "**MR Merged:** Merge request 4 [A MR title](http://79dfcd98b723/root/hot_do/-/merge_requests/4) for " \ + "[Hot Do](git@79dfcd98b723:root/hot_do.git) has been merged by " \ + "[Administrator](https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon).\n" + end + + it_behaves_like 'adding a comment' + it_behaves_like 'calls the merge request upsert service' + + context 'when the work package is already known to the GitlabMergeRequest' do + let!(:gitlab_merge_request) { create(:gitlab_merge_request, gitlab_id: 4, work_packages: [work_package]) } + + it_behaves_like 'adding a comment' + + it 'calls the merge request upsert service' do + expect { process }.to change { gitlab_merge_request.reload.state }.from('opened').to('merged') + expect(upsert_service).to have_received(:call).with( + a_kind_of(OpenProject::GitlabIntegration::NotificationHandler::Helper::Payload), work_packages: [work_package] + ) + end + end + end + + context 'when the MR is converted to draft' do + let(:gitlab_action) { 'update' } + let(:mr_state) { 'opened' } + let(:mr_draft) { true } + + it_behaves_like 'not adding a comment' + it_behaves_like 'calls the merge request upsert service' + end + + context 'with a labeled action' do + let(:gitlab_action) { 'update' } + let(:mr_state) { 'opened' } + + let(:labels) do + [ + { + "id" => 1, + "title" => "feature", + "color" => "#009966", + "project_id" => 1, + "created_at" => "2024-03-04 14:30:36 UTC", + "updated_at" => "2024-03-04 14:30:36 UTC", + "template" => false, + "description" => nil, + "type" => "ProjectLabel", + "group_id" => nil, + "lock_on_merge" => false + }, + { + "id" => 2, + "title" => "needs review", + "color" => "#9400d3", + "project_id" => 1, + "created_at" => "2024-03-04 15:46:50 UTC", + "updated_at" => "2024-03-04 15:46:50 UTC", + "template" => false, + "description" => nil, + "type" => "ProjectLabel", + "group_id" => nil, + "lock_on_merge" => false + } + ] + end + + it_behaves_like 'not adding a comment' + + it 'calls the merge request upsert service with all work_packages' do + gitlab_merge_request = process.reload + expect(gitlab_merge_request.labels).to eq([{ "title" => "feature", "color" => "#009966" }, + { "title" => "needs review", "color" => "#9400d3" }]) + + expect(upsert_service).to have_received(:call).with(a_kind_of(OpenProject::GitlabIntegration::NotificationHandler::Helper::Payload), + work_packages: [work_package]) + end + end + + context 'when the MR is ready for review' do + let(:gitlab_action) { 'update' } + let(:mr_state) { 'opened' } + let(:mr_draft) { false } + + let(:comment) do + "**MR Opened:** Merge request 4 [A MR title](http://79dfcd98b723/root/hot_do/-/merge_requests/4) for " \ + "[Hot Do](git@79dfcd98b723:root/hot_do.git) has been opened by " \ + "[Administrator](https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon).\n" + end + + before { create(:gitlab_merge_request, gitlab_id: 4, work_packages: [work_package]) } + + it_behaves_like 'not adding a comment' + + it 'calls the merge request upsert service' do + process + expect(upsert_service).to have_received(:call) + .with(a_kind_of(OpenProject::GitlabIntegration::NotificationHandler::Helper::Payload), work_packages: [work_package]) + end + end + + context 'with a reopened action' do + let(:gitlab_action) { 'reopen' } + let(:mr_state) { 'opened' } + + let(:comment) do + "**MR Reopened:** Merge request 4 [A MR title](http://79dfcd98b723/root/hot_do/-/merge_requests/4) for " \ + "[Hot Do](git@79dfcd98b723:root/hot_do.git) has been reopened by " \ + "[Administrator](https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon).\n" + end + + it_behaves_like 'adding a comment' + it_behaves_like 'calls the merge request upsert service' + end +end diff --git a/modules/gitlab_integration/spec/lib/open_project/gitlab_integration/notification_handler/pipeline_hook_spec.rb b/modules/gitlab_integration/spec/lib/open_project/gitlab_integration/notification_handler/pipeline_hook_spec.rb new file mode 100644 index 000000000000..2dc806a3c43d --- /dev/null +++ b/modules/gitlab_integration/spec/lib/open_project/gitlab_integration/notification_handler/pipeline_hook_spec.rb @@ -0,0 +1,145 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe OpenProject::GitlabIntegration::NotificationHandler::PipelineHook do + subject(:process) { handler_instance.process(payload) } + + shared_let(:gitlab_system_user) { create(:admin) } + shared_let(:gitlab_merge_request) { create(:gitlab_merge_request) } + + let(:handler_instance) { described_class.new } + let(:upsert_service) { OpenProject::GitlabIntegration::Services::UpsertPipeline.new } + + let(:payload) do + { + 'open_project_user_id' => gitlab_system_user.id, + 'object_kind' => "pipeline", + 'event_type' => "pipeline", + 'user' => { + 'id' => 1, + 'name' => "Administrator", + 'username' => "root", + 'avatar_url' => "https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon", + 'email' => "[REDACTED]" + }, + 'object_attributes' => { + "id" => 5, + "iid" => 5, + "name" => nil, + "ref" => "task/42-test-hooks", + "tag" => false, + "sha" => "4bf4cebeddac33ebfdd5f4cbbab44ee6cc9b1906", + "before_sha" => "ec01ed498c3736fe6edb21cdd08bee437120adab", + "source" => "push", + "status" => "failed", + "detailed_status" => "failed", + "stages" => [ + "test" + ], + "created_at" => "2024-03-02 09:01:05 UTC", + "finished_at" => "2024-03-02 11:00:07 UTC", + "duration" => nil, + "queued_duration" => nil, + "variables" => [], + "url" => "http://79dfcd98b723/root/hot_do/-/pipelines/5" + }, + "merge_request" => { + "iid" => gitlab_merge_request.gitlab_id, + "id" => gitlab_merge_request.gitlab_id, + "title" => "Update .gitlab-ci.yml file", + "ref_path" => "/root/hot_do/-/merge_requests/1", + "source_branch" => "task/42-test-hooks", + "source_project_id" => 1, + "target_branch" => "main", + "target_project_id" => 1 + }, + "project" => { + "id" => 1, + "name" => "Hot Do", + "description" => nil, + "web_url" => "http://79dfcd98b723/root/hot_do", + "avatar_url" => nil, + "git_ssh_url" => "git@79dfcd98b723:root/hot_do.git", + "git_http_url" => "http://79dfcd98b723/root/hot_do.git", + "namespace" => "Administrator", + "visibility_level" => 20, + "path_with_namespace" => "root/hot_do", + "default_branch" => "main", + "ci_config_path" => nil + }, + "builds" => [ + { + "id" => 34, + "stage" => "test", + "name" => "unit-test-job", + "status" => "skipped", + "created_at" => "2024-03-02 09:01:05 UTC", + "started_at" => nil, + "finished_at" => nil, + "duration" => nil, + "queued_duration" => nil, + "failure_reason" => nil, + "when" => "on_success", + "manual" => false, + "allow_failure" => false, + "user" => { + "id" => 1, + "name" => "Administrator", + "username" => "root", + "avatar_url" => "https://www.gravatar.com/avatar/258d8dc916db8cea2cafb6c3cd0cb0246efe061421dbd83ec3a350428cabda4f?s=80&d=identicon", + "email" => "[REDACTED]" + }, + "runner" => nil, + "artifacts_file" => { + "filename" => nil, + "size" => nil + }, + "environment" => nil + } + ] + } + end + + before do + allow(handler_instance).to receive(:comment_on_referenced_work_packages).and_return(nil) + allow(OpenProject::GitlabIntegration::Services::UpsertPipeline).to receive(:new).and_return(upsert_service) + allow(upsert_service).to receive(:call).and_call_original + end + + context 'with a new pipeline' do + it 'calls the pipeline upsert service' do + expect { process }.to change(GitlabPipeline, :count).by(1) + expect(upsert_service).to have_received(:call) + .with(a_kind_of(OpenProject::GitlabIntegration::NotificationHandler::Helper::Payload), + merge_request: gitlab_merge_request) + end + end +end diff --git a/modules/gitlab_integration/spec/models/gitlab_issue_spec.rb b/modules/gitlab_integration/spec/models/gitlab_issue_spec.rb new file mode 100644 index 000000000000..5ca66a5e98fc --- /dev/null +++ b/modules/gitlab_integration/spec/models/gitlab_issue_spec.rb @@ -0,0 +1,179 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe GitlabIssue do + describe 'Associations' do + it { is_expected.to have_and_belong_to_many(:work_packages) } + it { is_expected.to belong_to(:gitlab_user).optional } + end + + describe 'Validations' do + it { is_expected.to validate_presence_of :gitlab_html_url } + it { is_expected.to validate_presence_of :number } + it { is_expected.to validate_presence_of :repository } + it { is_expected.to validate_presence_of :state } + it { is_expected.to validate_presence_of :title } + it { is_expected.to validate_presence_of :gitlab_updated_at } + + context 'when it is a partial issue' do + let(:issue) { build(:gitlab_issue, :partial) } + + it { expect(issue).not_to validate_presence_of :body } + end + + context 'when it is not a partial issue' do + let(:issue) { build(:gitlab_issue) } + + it { expect(issue).to be_valid } + end + + describe 'labels' do + it { is_expected.to allow_value(nil).for(:labels) } + it { is_expected.to allow_value([]).for(:labels) } + it { is_expected.to allow_value([{ 'color' => '#666', 'title' => 'grey' }]).for(:labels) } + + it 'requires both color and title' do + expect(subject).not_to allow_value([{ 'title' => 'grey' }]).for(:labels) + end + + it { is_expected.not_to allow_value([{}]).for(:labels) } + + it 'returns an error message when invalid' do + issue = build(:gitlab_issue, labels: [{ 'title' => 'grey' }]) + issue.valid? + expect(issue.errors[:labels]).to include('must be an array of hashes with keys: color, title') + end + end + end + + describe 'Enums' do + let(:gitlab_issue) { build(:gitlab_issue) } + + it do + expect(gitlab_issue).to define_enum_for(:state) + .with_values(opened: 'opened', closed: 'closed') + .backed_by_column_of_type(:string) + end + end + + describe '.without_work_package' do + subject(:gitlab_issues_without_workpackages) { described_class.without_work_package } + + let(:gitlab_issue_no_work_packages) { create(:gitlab_issue, work_packages: []) } + let(:gitlab_issue_with_work_packages) { create(:gitlab_issue, work_packages: create_list(:work_package, 1)) } + + before do + gitlab_issue_no_work_packages + gitlab_issue_with_work_packages + end + + it { expect(gitlab_issues_without_workpackages).to contain_exactly(gitlab_issue_no_work_packages) } + end + + describe '.find_by_gitlab_identifiers' do + shared_let(:issue) { create(:gitlab_issue) } + + it 'raises an ArgumentError when no id or url is provided' do + expect { described_class.find_by_gitlab_identifiers }.to raise_error(ArgumentError, 'needs an id or an url') + end + + context 'when the gitlab_id attribute matches' do + it 'finds by gitlab_id' do + expect(described_class.find_by_gitlab_identifiers(id: issue.gitlab_id)).to eql(issue) + end + end + + context 'when the gitlab_html_url attribute matches' do + it 'finds by gitlab_html_url' do + expect(described_class.find_by_gitlab_identifiers(url: issue.gitlab_html_url)).to eql(issue) + end + end + + context 'when the provided gitlab_id does not match' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(id: issue.gitlab_id + 1)).to be_nil + end + end + + context 'when the provided gitlab_html_url does not match' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(url: "#{issue.gitlab_html_url}zzzz")) + .to be_nil + end + end + + context 'when neither match' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(id: issue.gitlab_id + 1, + url: "#{issue.gitlab_html_url}zzzz")) + .to be_nil + end + end + + context 'when the provided gitlab_html_url does not match but the gitlab_id does' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(id: issue.gitlab_id, + url: "#{issue.gitlab_html_url}zzzz")) + .to eql issue + end + end + + context 'when the provided gitlab_html_url does match but the gitlab_id does not' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(id: issue.gitlab_id + 1, + url: issue.gitlab_html_url)) + .to eql issue + end + end + + context 'when neither match but initialize is true' do + subject(:finder) do + described_class.find_by_gitlab_identifiers(id: issue.gitlab_id + 1, + url: "#{issue.gitlab_html_url}zzzz", + initialize: true) + end + + it 'returns an issue' do + expect(finder).to be_a(described_class) + end + + it 'returns a new record' do + expect(finder).to be_new_record + end + + it 'has the provided attributes initialized' do + expect(finder.attributes.compact) + .to eql("gitlab_id" => issue.gitlab_id + 1, + "gitlab_html_url" => "#{issue.gitlab_html_url}zzzz") + end + end + end +end diff --git a/modules/gitlab_integration/spec/models/gitlab_merge_request_spec.rb b/modules/gitlab_integration/spec/models/gitlab_merge_request_spec.rb new file mode 100644 index 000000000000..76b4533956ad --- /dev/null +++ b/modules/gitlab_integration/spec/models/gitlab_merge_request_spec.rb @@ -0,0 +1,197 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe GitlabMergeRequest do + describe 'Associations' do + it { is_expected.to have_and_belong_to_many(:work_packages) } + it { is_expected.to have_many(:gitlab_pipelines).dependent(:destroy) } + it { is_expected.to belong_to(:gitlab_user).optional } + it { is_expected.to belong_to(:merged_by).class_name('GitlabUser').optional } + end + + describe 'Validations' do + it { is_expected.to validate_presence_of :gitlab_html_url } + it { is_expected.to validate_presence_of :number } + it { is_expected.to validate_presence_of :repository } + it { is_expected.to validate_presence_of :state } + it { is_expected.to validate_presence_of :title } + it { is_expected.to validate_presence_of :gitlab_updated_at } + + context 'when it is a partial merge request' do + let(:merge_request) { build(:gitlab_merge_request, :partial) } + + it { expect(merge_request).not_to validate_presence_of :body } + end + + context 'when it is not a partial merge_request' do + let(:merge_request) { build(:gitlab_merge_request) } + + it { expect(merge_request).to be_valid } + end + + describe 'labels' do + it { is_expected.to allow_value(nil).for(:labels) } + it { is_expected.to allow_value([]).for(:labels) } + it { is_expected.to allow_value([{ 'color' => '#666', 'title' => 'grey' }]).for(:labels) } + + it 'requires both color and title' do + expect(subject).not_to allow_value([{ 'title' => 'grey' }]).for(:labels) + end + + it { is_expected.not_to allow_value([{}]).for(:labels) } + + it 'returns an error message when invalid' do + merge_request = build(:gitlab_merge_request, labels: [{ 'title' => 'grey' }]) + merge_request.valid? + expect(merge_request.errors[:labels]).to include('must be an array of hashes with keys: color, title') + end + end + end + + describe 'Enums' do + let(:gitlab_merge_request) { build(:gitlab_merge_request) } + + it do + expect(gitlab_merge_request).to define_enum_for(:state) + .with_values(opened: 'opened', merged: 'merged', closed: 'closed') + .backed_by_column_of_type(:string) + end + end + + describe '.without_work_package' do + subject { described_class.without_work_package } + + let(:merge_request) { create(:gitlab_merge_request, work_packages:) } + let(:work_packages) { [] } + + before { merge_request } + + it { is_expected.to contain_exactly(merge_request) } + + context 'when the pr is linked to a work_package' do + let(:work_packages) { create_list(:work_package, 1) } + + it { is_expected.to be_empty } + end + end + + describe '.find_by_gitlab_identifiers' do + shared_let(:merge_request) { create(:gitlab_merge_request) } + + it 'raises an ArgumentError when no id or url is provided' do + expect { described_class.find_by_gitlab_identifiers }.to raise_error(ArgumentError, 'needs an id or an url') + end + + context 'when the gitlab_id attribute matches' do + it 'finds by gitlab_id' do + expect(described_class.find_by_gitlab_identifiers(id: merge_request.gitlab_id)).to eql(merge_request) + end + end + + context 'when the gitlab_html_url attribute matches' do + it 'finds by gitlab_html_url' do + expect(described_class.find_by_gitlab_identifiers(url: merge_request.gitlab_html_url)).to eql(merge_request) + end + end + + context 'when the provided gitlab_id does not match' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(id: merge_request.gitlab_id + 1)).to be_nil + end + end + + context 'when the provided gitlab_html_url does not match' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(url: "#{merge_request.gitlab_html_url}zzzz")) + .to be_nil + end + end + + context 'when neither match' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(id: merge_request.gitlab_id + 1, + url: "#{merge_request.gitlab_html_url}zzzz")) + .to be_nil + end + end + + context 'when the provided gitlab_html_url does not match but the gitlab_id does' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(id: merge_request.gitlab_id, + url: "#{merge_request.gitlab_html_url}zzzz")) + .to eql merge_request + end + end + + context 'when the provided gitlab_html_url does match but the gitlab_id does not' do + it 'is nil' do + expect(described_class.find_by_gitlab_identifiers(id: merge_request.gitlab_id + 1, + url: merge_request.gitlab_html_url)) + .to eql merge_request + end + end + + context 'when neither match but initialize is true' do + subject(:finder) do + described_class.find_by_gitlab_identifiers(id: merge_request.gitlab_id + 1, + url: "#{merge_request.gitlab_html_url}zzzz", + initialize: true) + end + + it 'returns an merge_request' do + expect(finder).to be_a(described_class) + end + + it 'returns a new record' do + expect(finder).to be_new_record + end + + it 'has the provided attributes initialized' do + expect(finder.attributes.compact) + .to eql("gitlab_id" => merge_request.gitlab_id + 1, + "gitlab_html_url" => "#{merge_request.gitlab_html_url}zzzz") + end + end + end + + describe '#latest_pipelines' do + context 'when multiple pipelines for the same merge request exist' do + shared_association_default(:gitlab_merge_request) { create(:gitlab_merge_request) } + + shared_let(:latest_pipelines) { create_list(:gitlab_pipeline, 2, :recent, project_id: 123) } + shared_let(:outdated_pipelines) { create_list(:gitlab_pipeline, 2, :outdated, project_id: 123) } + + it 'returns the latest pipeline ordered from most recent' do + expect(gitlab_merge_request.reload.latest_pipelines).to match_array(latest_pipelines + outdated_pipelines) + end + end + end +end diff --git a/modules/gitlab_integration/spec/models/gitlab_pipeline_spec.rb b/modules/gitlab_integration/spec/models/gitlab_pipeline_spec.rb new file mode 100644 index 000000000000..4c4f9d333c78 --- /dev/null +++ b/modules/gitlab_integration/spec/models/gitlab_pipeline_spec.rb @@ -0,0 +1,67 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe GitlabPipeline do + describe 'Associations' do + it { is_expected.to belong_to(:gitlab_merge_request).touch(true) } + end + + describe 'Validations' do + it { is_expected.to validate_presence_of :gitlab_user_avatar_url } + it { is_expected.to validate_presence_of :gitlab_html_url } + it { is_expected.to validate_presence_of :gitlab_id } + it { is_expected.to validate_presence_of :status } + it { is_expected.to validate_presence_of :name } + it { is_expected.to validate_presence_of :ci_details } + it { is_expected.to validate_presence_of :commit_id } + it { is_expected.to validate_presence_of :username } + end + + describe 'Enums' do + let(:gitlab_pipeline) { build(:gitlab_pipeline) } + + it do + expect(gitlab_pipeline).to define_enum_for(:status) + .with_values(created: 'created', + running: 'running', + success: 'success', + waiting: 'waiting', + preparing: 'preparing', + failed: 'failed', + pending: 'pending', + canceled: 'canceled', + skipped: 'skipped', + manual: 'manual', + scheduled: 'scheduled') + .backed_by_column_of_type(:string) + end + end +end diff --git a/modules/gitlab_integration/spec/models/gitlab_user_spec.rb b/modules/gitlab_integration/spec/models/gitlab_user_spec.rb new file mode 100644 index 000000000000..0c47d4d64961 --- /dev/null +++ b/modules/gitlab_integration/spec/models/gitlab_user_spec.rb @@ -0,0 +1,44 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' +require_module_spec_helper + +RSpec.describe GitlabUser do + describe 'Associations' do + it { is_expected.to have_many(:gitlab_merge_requests) } + end + + describe 'Validations' do + it { is_expected.to validate_presence_of :gitlab_id } + it { is_expected.to validate_presence_of :gitlab_name } + it { is_expected.to validate_presence_of :gitlab_username } + it { is_expected.to validate_presence_of :gitlab_email } + it { is_expected.to validate_presence_of :gitlab_avatar_url } + end +end diff --git a/modules/gitlab_integration/spec/spec_helper.rb b/modules/gitlab_integration/spec/spec_helper.rb new file mode 100644 index 000000000000..5974eaa856cf --- /dev/null +++ b/modules/gitlab_integration/spec/spec_helper.rb @@ -0,0 +1,29 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'spec_helper' diff --git a/modules/gitlab_integration/spec/support/pages/work_package_gitlab_tab.rb b/modules/gitlab_integration/spec/support/pages/work_package_gitlab_tab.rb new file mode 100644 index 000000000000..4792431eeef3 --- /dev/null +++ b/modules/gitlab_integration/spec/support/pages/work_package_gitlab_tab.rb @@ -0,0 +1,68 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2012-2024 the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +require 'rbconfig' +require 'support/pages/page' + +module Pages + class GitlabTab < Page + attr_reader :work_package_id + + def initialize(work_package_id) + super() + @work_package_id = work_package_id + end + + def path + "/work_packages/#{work_package_id}/tabs/gitlab" + end + + def git_actions_menu_button + find('.gitlab-git-copy:not([disabled])', text: 'Git') + end + + def git_actions_copy_branch_name_button + find('.git-actions-menu .copy-button:not([disabled])', match: :first) + end + + def paste_clipboard_content + meta_key = osx? ? :command : :control + page.send_keys(meta_key, 'v') + end + + def expect_tab_not_present + expect(page).to have_no_css('.op-tab-row--link', text: 'GITLAB') + end + + private + + def osx? + RbConfig::CONFIG['host_os'].include?('darwin') + end + end +end