From 4a4eee34f3380de99725a8d704587d60f6c21f41 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Thu, 22 Feb 2024 15:21:32 -0800 Subject: [PATCH 01/25] Support Phorge as an external issue tracker --- app/models/integration.rb | 2 +- app/models/integrations/phorge.rb | 39 ++++++++++++++++++ app/models/project.rb | 1 + doc/api/graphql/reference/index.md | 1 + doc/api/integrations.md | 36 +++++++++++++++++ doc/integration/external-issue-tracker.md | 1 + doc/user/project/integrations/index.md | 1 + doc/user/project/integrations/phorge.md | 40 +++++++++++++++++++ lib/api/helpers/integrations_helpers.rb | 2 + locale/gitlab.pot | 6 +++ spec/factories/integrations.rb | 8 ++++ .../user_activates_issue_tracker_spec.rb | 1 + .../types/projects/service_type_enum_spec.rb | 1 + .../external_issue_reference_filter_spec.rb | 17 ++++++++ spec/lib/gitlab/import_export/all_models.yml | 1 + spec/models/integrations/phorge_spec.rb | 37 +++++++++++++++++ spec/models/project_spec.rb | 1 + 17 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 app/models/integrations/phorge.rb create mode 100644 doc/user/project/integrations/phorge.md create mode 100644 spec/models/integrations/phorge_spec.rb diff --git a/app/models/integration.rb b/app/models/integration.rb index b1725cdf87dab2..07bd7c2d331392 100644 --- a/app/models/integration.rb +++ b/app/models/integration.rb @@ -22,7 +22,7 @@ class Integration < ApplicationRecord asana assembla bamboo bugzilla buildkite campfire clickup confluence custom_issue_tracker datadog diffblue_cover discord drone_ci emails_on_push ewm external_wiki gitlab_slack_application hangouts_chat harbor irker jira - mattermost mattermost_slash_commands microsoft_teams packagist pipelines_email + mattermost mattermost_slash_commands microsoft_teams packagist phorge pipelines_email pivotaltracker prometheus pumble pushover redmine slack slack_slash_commands squash_tm teamcity telegram unify_circuit webex_teams youtrack zentao ].freeze diff --git a/app/models/integrations/phorge.rb b/app/models/integrations/phorge.rb new file mode 100644 index 00000000000000..425e6d8c40edc8 --- /dev/null +++ b/app/models/integrations/phorge.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Integrations + class Phorge < BaseIssueTracker + include HasIssueTrackerFields + + validates :project_url, :issues_url, :new_issue_url, presence: true, public_url: true, if: :activated? + + def reference_pattern(*) + @reference_pattern ||= /\b(?T\d+)(?=\W|\z)/ + end + + def self.title + 'Phorge' + end + + def self.description + s_("IssueTracker|Use Phorge as this project's issue tracker.") + end + + def self.help + docs_link = ActionController::Base.helpers.link_to _('Learn more.'), + Rails.application.routes.url_helpers.help_page_url('user/project/integrations/phorge'), + target: '_blank', + rel: 'noopener noreferrer' + format(s_( + "IssueTracker|Use Phorge as this project's issue tracker. %{docs_link}" + ).html_safe, docs_link: docs_link.html_safe) + end + + def self.to_param + 'phorge' + end + + def self.fields + super.select { %w[project_url issues_url].include?(_1.name) } + end + end +end diff --git a/app/models/project.rb b/app/models/project.rb index 54437f8cb1cf36..d10b513482fb2c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -232,6 +232,7 @@ def self.integration_association_name(name) has_one :mock_ci_integration, class_name: 'Integrations::MockCi' has_one :mock_monitoring_integration, class_name: 'Integrations::MockMonitoring' has_one :packagist_integration, class_name: 'Integrations::Packagist' + has_one :phorge_integration, class_name: 'Integrations::Phorge' has_one :pipelines_email_integration, class_name: 'Integrations::PipelinesEmail' has_one :pivotaltracker_integration, class_name: 'Integrations::Pivotaltracker' has_one :prometheus_integration, class_name: 'Integrations::Prometheus', inverse_of: :project diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 84ce099c158285..0dc8bdf531b3e7 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -32817,6 +32817,7 @@ State of a Sentry error. | `MATTERMOST_SLASH_COMMANDS_SERVICE` | MattermostSlashCommandsService type. | | `MICROSOFT_TEAMS_SERVICE` | MicrosoftTeamsService type. | | `PACKAGIST_SERVICE` | PackagistService type. | +| `PHORGE_SERVICE` | PhorgeService type. | | `PIPELINES_EMAIL_SERVICE` | PipelinesEmailService type. | | `PIVOTALTRACKER_SERVICE` | PivotaltrackerService type. | | `PROMETHEUS_SERVICE` | PrometheusService type. | diff --git a/doc/api/integrations.md b/doc/api/integrations.md index cb4425924a6223..f71c3f9c0812db 100644 --- a/doc/api/integrations.md +++ b/doc/api/integrations.md @@ -1414,6 +1414,42 @@ Get the Packagist integration settings for a project. GET /projects/:id/integrations/packagist ``` +## Phorge + +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/TODO) in GitLab 16.10. + +### Set up Phorge + +Set up the Phorge integration for a project. + +```plaintext +PUT /projects/:id/integrations/phorge +``` + +Parameters: + +| Parameter | Type | Required | Description | +| ------------- | ------ | -------- | -------------- | +| `issues_url` | string | true | URL of the issue. | +| `project_url` | string | true | URL of the project. | +| `new_issue_url` | string | true | URL of the new issue. | + +### Disable Phorge + +Disable the Phorge integration for a project. Integration settings are reset. + +```plaintext +DELETE /projects/:id/integrations/phorge +``` + +### Get Phorge settings + +Get the Phorge integration settings for a project. + +```plaintext +GET /projects/:id/integrations/phorge +``` + ## Pipeline status emails ### Set up pipeline status emails diff --git a/doc/integration/external-issue-tracker.md b/doc/integration/external-issue-tracker.md index c624597e00ae22..a8f5391038fbaf 100644 --- a/doc/integration/external-issue-tracker.md +++ b/doc/integration/external-issue-tracker.md @@ -46,5 +46,6 @@ You can configure any of the following external issue trackers: - [Custom issue tracker](../user/project/integrations/custom_issue_tracker.md) - [Engineering Workflow Management (EWM)](../user/project/integrations/ewm.md) - [Jira](../integration/jira/index.md) +- [Phorge](../user/project/integrations/phorge.md) - [Redmine](../user/project/integrations/redmine.md) - [YouTrack](../user/project/integrations/youtrack.md) diff --git a/doc/user/project/integrations/index.md b/doc/user/project/integrations/index.md index ef6cb2a94ab36b..e88cc36cc9fdc2 100644 --- a/doc/user/project/integrations/index.md +++ b/doc/user/project/integrations/index.md @@ -145,6 +145,7 @@ To use custom settings for a project or group integration: | [Mattermost slash commands](mattermost_slash_commands.md) | Run slash commands from a Mattermost chat environment. | **{dotted-circle}** No | | [Microsoft Teams notifications](microsoft_teams.md) | Receive event notifications in Microsoft Teams. | **{dotted-circle}** No | | Packagist | Update your PHP dependencies in Packagist. | **{check-circle}** Yes | +| [Phorge](phorge.md) | Use Phorge as an issue tracker. | **{dotted-circle}** No | | [Pipeline status emails](pipeline_status_emails.md) | Send the pipeline status to a list of recipients by email. | **{dotted-circle}** No | | [Pivotal Tracker](pivotal_tracker.md) | Add commit messages as comments to Pivotal Tracker stories. | **{dotted-circle}** No | | [Pumble](pumble.md) | Send event notifications to a Pumble channel. | **{dotted-circle}** No | diff --git a/doc/user/project/integrations/phorge.md b/doc/user/project/integrations/phorge.md new file mode 100644 index 00000000000000..17b108eb95b8ad --- /dev/null +++ b/doc/user/project/integrations/phorge.md @@ -0,0 +1,40 @@ +--- +stage: Manage +group: Import and Integrate +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments +--- + +# Phorge + +DETAILS: +**Tier:** Free, Premium, Ultimate +**Offering:** SaaS, self-managed + +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/TODO) in GitLab 16.10. + +You can use [Phorge](https://we.phorge.it/) as an external issue tracker. +To enable the Phorge integration in a project: + +1. On the left sidebar, select **Search or go to** and find your project. +1. Select **Settings > Integrations**. +1. Select **Phorge**. +1. Under **Enable integration**, select the **Active** checkbox. +1. Fill in the required fields: + + - **Project URL**: The URL to the Phorge project to link to this GitLab project. + - **Issue URL**: The URL to the Phorge project issue to link to this GitLab project. + The URL must contain `:id`. GitLab replaces this token with the Phorge Maniphest task ID (e.g. `T123`). + - **New issue URL**: URL to create a new maniphest task item. You may wish + to prefill a specific set of tags related to this project using `?tags=`. + +1. Optional. Select **Test settings**. +1. Select **Save changes**. + +After you have configured and enabled Phorge, you see the Phorge link on the GitLab project pages, +which takes you to your Phorge project. + +## Reference Phorge issues/tasks in GitLab + +You can reference your Phorge Maniphest tasks using: + +- `T`, where `` is a Phorge Maniphest task ID number (example `T123`). diff --git a/lib/api/helpers/integrations_helpers.rb b/lib/api/helpers/integrations_helpers.rb index 85a13edfd89449..71e0737dc10372 100644 --- a/lib/api/helpers/integrations_helpers.rb +++ b/lib/api/helpers/integrations_helpers.rb @@ -397,6 +397,7 @@ def self.integrations desc: 'The server' } ], + 'phorge' => ::Integrations::Phorge.api_fields, 'pipelines-email' => [ { required: true, @@ -653,6 +654,7 @@ def self.integration_classes ::Integrations::MattermostSlashCommands, ::Integrations::MicrosoftTeams, ::Integrations::Packagist, + ::Integrations::Phorge, ::Integrations::PipelinesEmail, ::Integrations::Pivotaltracker, ::Integrations::Prometheus, diff --git a/locale/gitlab.pot b/locale/gitlab.pot index d68c58fba556c8..0d0d1d23898321 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -27359,6 +27359,12 @@ msgstr "" msgid "IssueTracker|Use IBM Engineering Workflow Management as this project's issue tracker. %{docs_link}" msgstr "" +msgid "IssueTracker|Use Phorge as this project's issue tracker." +msgstr "" + +msgid "IssueTracker|Use Phorge as this project's issue tracker. %{docs_link}" +msgstr "" + msgid "IssueTracker|Use JetBrains YouTrack as this project's issue tracker." msgstr "" diff --git a/spec/factories/integrations.rb b/spec/factories/integrations.rb index 7c52907cefd5de..61cbc8b3f2c54e 100644 --- a/spec/factories/integrations.rb +++ b/spec/factories/integrations.rb @@ -82,6 +82,14 @@ server { 'https://packagist.example.comp' } end + factory :phorge_integration, class: 'Integrations::Phorge' do + project + active { true } + project_url { 'http://phorge.example.com' } + issues_url { 'http://phorge.example.com/:id' } + new_issue_url { 'http://phorge.example.com/maniphest/task/edit/form/1/?tags=project' } + end + factory :prometheus_integration, class: 'Integrations::Prometheus' do project active { true } diff --git a/spec/features/projects/integrations/user_activates_issue_tracker_spec.rb b/spec/features/projects/integrations/user_activates_issue_tracker_spec.rb index 02cec948127bf3..693776b612c2ce 100644 --- a/spec/features/projects/integrations/user_activates_issue_tracker_spec.rb +++ b/spec/features/projects/integrations/user_activates_issue_tracker_spec.rb @@ -92,4 +92,5 @@ def fill_form(disable: false, skip_new_issue_url: false) it_behaves_like 'external issue tracker activation', tracker: 'Custom issue tracker' it_behaves_like 'external issue tracker activation', tracker: 'EWM', skip_test: true it_behaves_like 'external issue tracker activation', tracker: 'ClickUp', skip_new_issue_url: true + it_behaves_like 'external issue tracker activation', tracker: 'Phorge' end diff --git a/spec/graphql/types/projects/service_type_enum_spec.rb b/spec/graphql/types/projects/service_type_enum_spec.rb index 40376afc7f78f3..36c00212579d2d 100644 --- a/spec/graphql/types/projects/service_type_enum_spec.rb +++ b/spec/graphql/types/projects/service_type_enum_spec.rb @@ -32,6 +32,7 @@ def core_service_enums MATTERMOST_SLASH_COMMANDS_SERVICE MICROSOFT_TEAMS_SERVICE PACKAGIST_SERVICE + PHORGE_SERVICE PIPELINES_EMAIL_SERVICE PIVOTALTRACKER_SERVICE PROMETHEUS_SERVICE diff --git a/spec/lib/banzai/filter/references/external_issue_reference_filter_spec.rb b/spec/lib/banzai/filter/references/external_issue_reference_filter_spec.rb index acc59c85cbf852..9ff298c32d29a1 100644 --- a/spec/lib/banzai/filter/references/external_issue_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/references/external_issue_reference_filter_spec.rb @@ -325,6 +325,23 @@ end end + context "phorge project" do + before_all do + create(:phorge_integration, project: project) + end + + before do + project.update!(issues_enabled: false) + end + + context "with right markdown" do + let(:issue) { ExternalIssue.new("T123", project) } + let(:reference) { issue.to_reference } + + it_behaves_like "external issue tracker" + end + end + context 'checking N+1' do let_it_be(:integration) { create(:redmine_integration, project: project) } let_it_be(:issue1) { ExternalIssue.new("#123", project) } diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 8329bc412a47d1..4a9fd41ea5f68f 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -585,6 +585,7 @@ project: - harbor_integration - irker_integration - packagist_integration +- phorge_integration - pivotaltracker_integration - prometheus_integration - assembla_integration diff --git a/spec/models/integrations/phorge_spec.rb b/spec/models/integrations/phorge_spec.rb new file mode 100644 index 00000000000000..e5f5b1eb2aa36d --- /dev/null +++ b/spec/models/integrations/phorge_spec.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Integrations::Phorge, feature_category: :integrations do + describe 'Validations' do + context 'when integration is active' do + before do + subject.active = true + end + + it { is_expected.to validate_presence_of(:project_url) } + it { is_expected.to validate_presence_of(:issues_url) } + it { is_expected.to validate_presence_of(:new_issue_url) } + + it_behaves_like 'issue tracker integration URL attribute', :project_url + it_behaves_like 'issue tracker integration URL attribute', :issues_url + it_behaves_like 'issue tracker integration URL attribute', :new_issue_url + end + + context 'when integration is inactive' do + before do + subject.active = false + end + + it { is_expected.not_to validate_presence_of(:project_url) } + it { is_expected.not_to validate_presence_of(:issues_url) } + it { is_expected.not_to validate_presence_of(:new_issue_url) } + end + end + + describe '#reference_pattern' do + it 'allows the standard Phorge Maniphest task ID format' do + expect(subject.reference_pattern.match('T123')[:issue]).to eq('T123') + end + end +end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 993cbd8e23f4d8..2f5ec55e2381d1 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -59,6 +59,7 @@ it { is_expected.to have_one(:pumble_integration) } it { is_expected.to have_one(:webex_teams_integration) } it { is_expected.to have_one(:packagist_integration) } + it { is_expected.to have_one(:phorge_integration) } it { is_expected.to have_one(:pushover_integration) } it { is_expected.to have_one(:apple_app_store_integration) } it { is_expected.to have_one(:google_play_integration) } -- GitLab From 64a99a75e91d4a10df9c4c72d0232357b9c33503 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Mon, 26 Feb 2024 16:44:39 -0800 Subject: [PATCH 02/25] Remove fields class method to fix omission of new_issue_url --- app/models/integrations/phorge.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/models/integrations/phorge.rb b/app/models/integrations/phorge.rb index 425e6d8c40edc8..1f3308ef006234 100644 --- a/app/models/integrations/phorge.rb +++ b/app/models/integrations/phorge.rb @@ -31,9 +31,5 @@ def self.help def self.to_param 'phorge' end - - def self.fields - super.select { %w[project_url issues_url].include?(_1.name) } - end end end -- GitLab From 478ddeec75114bfbaa39dbde34e23dd27e6403b1 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Tue, 27 Feb 2024 10:04:52 -0800 Subject: [PATCH 03/25] Appease rubocop by refactoring Phorge spec --- app/models/integrations/phorge.rb | 9 ++++++--- spec/models/integrations/phorge_spec.rb | 24 ++++++++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/app/models/integrations/phorge.rb b/app/models/integrations/phorge.rb index 1f3308ef006234..a57e9fd7581ad6 100644 --- a/app/models/integrations/phorge.rb +++ b/app/models/integrations/phorge.rb @@ -23,9 +23,12 @@ def self.help Rails.application.routes.url_helpers.help_page_url('user/project/integrations/phorge'), target: '_blank', rel: 'noopener noreferrer' - format(s_( - "IssueTracker|Use Phorge as this project's issue tracker. %{docs_link}" - ).html_safe, docs_link: docs_link.html_safe) + + # rubocop:disable Rails/OutputSafety -- It is fine to call html_safe here + format( + s_("IssueTracker|Use Phorge as this project's issue tracker. %{docs_link}").html_safe, + docs_link: docs_link.html_safe + ) end def self.to_param diff --git a/spec/models/integrations/phorge_spec.rb b/spec/models/integrations/phorge_spec.rb index e5f5b1eb2aa36d..0798ab72d47bfb 100644 --- a/spec/models/integrations/phorge_spec.rb +++ b/spec/models/integrations/phorge_spec.rb @@ -4,10 +4,10 @@ RSpec.describe Integrations::Phorge, feature_category: :integrations do describe 'Validations' do + subject { build(:phorge_integration, active: active) } + context 'when integration is active' do - before do - subject.active = true - end + let(:active) { true } it { is_expected.to validate_presence_of(:project_url) } it { is_expected.to validate_presence_of(:issues_url) } @@ -19,9 +19,7 @@ end context 'when integration is inactive' do - before do - subject.active = false - end + let(:active) { false } it { is_expected.not_to validate_presence_of(:project_url) } it { is_expected.not_to validate_presence_of(:issues_url) } @@ -30,8 +28,18 @@ end describe '#reference_pattern' do - it 'allows the standard Phorge Maniphest task ID format' do - expect(subject.reference_pattern.match('T123')[:issue]).to eq('T123') + let(:reference_pattern) { build(:phorge_integration).reference_pattern } + + subject { reference_pattern } + + context 'when text contains a Phorge Maniphest task reference' do + let(:text) { "Some description referencing T123" } + + it { is_expected.to match(text) } + + it 'captures the task reference' do + expect(reference_pattern.match(text)[:issue]).to eq("T123") + end end end end -- GitLab From 62c79c5cbf586f2974eca744d310b3c9774db409 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Tue, 27 Feb 2024 15:26:26 -0800 Subject: [PATCH 04/25] Reenable Rails/OutputSafety after disabling it --- app/models/integrations/phorge.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/integrations/phorge.rb b/app/models/integrations/phorge.rb index a57e9fd7581ad6..b603bda094ccfb 100644 --- a/app/models/integrations/phorge.rb +++ b/app/models/integrations/phorge.rb @@ -18,18 +18,19 @@ def self.description s_("IssueTracker|Use Phorge as this project's issue tracker.") end + # rubocop:disable Rails/OutputSafety -- It is fine to call html_safe here def self.help docs_link = ActionController::Base.helpers.link_to _('Learn more.'), Rails.application.routes.url_helpers.help_page_url('user/project/integrations/phorge'), target: '_blank', rel: 'noopener noreferrer' - # rubocop:disable Rails/OutputSafety -- It is fine to call html_safe here format( s_("IssueTracker|Use Phorge as this project's issue tracker. %{docs_link}").html_safe, docs_link: docs_link.html_safe ) end + # rubocop:enable Rails/OutputSafety def self.to_param 'phorge' -- GitLab From f419201d806930038cf8654052dc8e4450084c1f Mon Sep 17 00:00:00 2001 From: Bojan Marjanovic Date: Wed, 28 Feb 2024 21:24:58 +0000 Subject: [PATCH 05/25] Link to MR in the documentation --- doc/api/integrations.md | 2 +- doc/user/project/integrations/phorge.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/integrations.md b/doc/api/integrations.md index f71c3f9c0812db..5dd2a786c18775 100644 --- a/doc/api/integrations.md +++ b/doc/api/integrations.md @@ -1416,7 +1416,7 @@ GET /projects/:id/integrations/packagist ## Phorge -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/TODO) in GitLab 16.10. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.10. ### Set up Phorge diff --git a/doc/user/project/integrations/phorge.md b/doc/user/project/integrations/phorge.md index 17b108eb95b8ad..c8a24eef8e4e50 100644 --- a/doc/user/project/integrations/phorge.md +++ b/doc/user/project/integrations/phorge.md @@ -10,7 +10,7 @@ DETAILS: **Tier:** Free, Premium, Ultimate **Offering:** SaaS, self-managed -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/TODO) in GitLab 16.10. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.10. You can use [Phorge](https://we.phorge.it/) as an external issue tracker. To enable the Phorge integration in a project: -- GitLab From 5fff2381fb66d5de6017293f15c9bc58b94c7588 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Wed, 28 Feb 2024 15:28:23 -0800 Subject: [PATCH 06/25] Fixed Phorge reference_pattern Modified `Integrations::Phorge#reference_pattern` to use a regular expression more closely resembling that of Phorge's own parser, and documented the method's expected behavior as well as justifications for the regex differences. Implemented additional specs for cases where the pattern should and should not match. --- app/models/integrations/phorge.rb | 19 ++++++++++++- spec/factories/integrations.rb | 1 + spec/models/integrations/phorge_spec.rb | 38 ++++++++++++++++++++++--- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/app/models/integrations/phorge.rb b/app/models/integrations/phorge.rb index b603bda094ccfb..7b4ed1993c5968 100644 --- a/app/models/integrations/phorge.rb +++ b/app/models/integrations/phorge.rb @@ -6,8 +6,25 @@ class Phorge < BaseIssueTracker validates :project_url, :issues_url, :new_issue_url, presence: true, public_url: true, if: :activated? + # See https://we.phorge.it/source/phorge/browse/master/src/infrastructure/markup/rule/PhabricatorObjectRemarkupRule.php + # for a canonical source of the regular expression used to parse Phorge + # object references. + # + # > The "(? "ABC-T1" (see T5714), and from matching "@T1" as a task (it is a user) + # > (see T9479). + # + # Note that object references in Phorge are prefixed with letters unique + # to their underlying application, so T123 (a Maniphest task) is + # distinct from D123 (a Differential patch). Keeping the T as part of + # the task ID is appropriate here as it leaves room for expanding + # reference parsing/linking to other types of Phorge entities. + # + # Also note, a prefix of # is being allowed here due to: 1) an assumed + # likelihood of use; and b) lack of collision with native GitLab issues + # since all Phorge identifiers have the application specific alpha prefix. def reference_pattern(*) - @reference_pattern ||= /\b(?T\d+)(?=\W|\z)/ + @reference_pattern ||= /\b(?T\d+)\b/ end def self.title diff --git a/spec/factories/integrations.rb b/spec/factories/integrations.rb index 61cbc8b3f2c54e..f38c29bd2d812a 100644 --- a/spec/factories/integrations.rb +++ b/spec/factories/integrations.rb @@ -88,6 +88,7 @@ project_url { 'http://phorge.example.com' } issues_url { 'http://phorge.example.com/:id' } new_issue_url { 'http://phorge.example.com/maniphest/task/edit/form/1/?tags=project' } + issue_tracker end factory :prometheus_integration, class: 'Integrations::Prometheus' do diff --git a/spec/models/integrations/phorge_spec.rb b/spec/models/integrations/phorge_spec.rb index 0798ab72d47bfb..3c2a94c4a54659 100644 --- a/spec/models/integrations/phorge_spec.rb +++ b/spec/models/integrations/phorge_spec.rb @@ -33,12 +33,42 @@ subject { reference_pattern } context 'when text contains a Phorge Maniphest task reference' do - let(:text) { "Some description referencing T123" } + shared_examples 'a valid Phorge reference' do |text, reference| + it { is_expected.to match(text) } - it { is_expected.to match(text) } + it 'captures the task reference' do + expect(reference_pattern.match(text)[:issue]).to eq(reference) + end + end + + context 'and it is at the end of a line' do + it_behaves_like 'a valid Phorge reference', 'Referencing T123', 'T123' + end + + context 'and it is mid sentence' do + it_behaves_like 'a valid Phorge reference', 'Referencing T123, and saying more', 'T123' + end + + context 'and it is parenthetical' do + it_behaves_like 'a valid Phorge reference', 'Referencing (T123)', 'T123' + end + + context 'and prefixed by #' do + it_behaves_like 'a valid Phorge reference', 'Referencing #T123', 'T123' + end + end + + context 'when text contains something resembling but is not a Phorge Maniphest task reference' do + shared_examples 'no valid Phorge reference' do |text| + it { is_expected.not_to match(text) } + end + + context 'as a hyphenated word' do + it_behaves_like 'no valid Phorge reference', 'See docs for Model-T1' + end - it 'captures the task reference' do - expect(reference_pattern.match(text)[:issue]).to eq("T123") + context 'as a reference to a user with a task-like username' do + it_behaves_like 'no valid Phorge reference', 'cc user @T1' end end end -- GitLab From 117bc25c860735ab94f57a76dff8b56de81a4f06 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Thu, 29 Feb 2024 10:08:13 -0800 Subject: [PATCH 07/25] Refactor Phorge specs to use TableSyntax --- spec/factories/integrations.rb | 3 -- spec/models/integrations/phorge_spec.rb | 46 +++++++++++-------------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/spec/factories/integrations.rb b/spec/factories/integrations.rb index f38c29bd2d812a..47c1c19ec6f76f 100644 --- a/spec/factories/integrations.rb +++ b/spec/factories/integrations.rb @@ -85,9 +85,6 @@ factory :phorge_integration, class: 'Integrations::Phorge' do project active { true } - project_url { 'http://phorge.example.com' } - issues_url { 'http://phorge.example.com/:id' } - new_issue_url { 'http://phorge.example.com/maniphest/task/edit/form/1/?tags=project' } issue_tracker end diff --git a/spec/models/integrations/phorge_spec.rb b/spec/models/integrations/phorge_spec.rb index 3c2a94c4a54659..e98f7b08bdf591 100644 --- a/spec/models/integrations/phorge_spec.rb +++ b/spec/models/integrations/phorge_spec.rb @@ -28,47 +28,43 @@ end describe '#reference_pattern' do + using RSpec::Parameterized::TableSyntax + let(:reference_pattern) { build(:phorge_integration).reference_pattern } subject { reference_pattern } context 'when text contains a Phorge Maniphest task reference' do - shared_examples 'a valid Phorge reference' do |text, reference| + let(:reference) { 'T123' } + + where(:text) do + [ + 'Referencing T123', + 'Referencing T123, mid sentance', + 'Referencing (T123) parenthetically', + 'Referencing #T123 octothorpically? :)' + ] + end + + with_them do it { is_expected.to match(text) } it 'captures the task reference' do expect(reference_pattern.match(text)[:issue]).to eq(reference) end end - - context 'and it is at the end of a line' do - it_behaves_like 'a valid Phorge reference', 'Referencing T123', 'T123' - end - - context 'and it is mid sentence' do - it_behaves_like 'a valid Phorge reference', 'Referencing T123, and saying more', 'T123' - end - - context 'and it is parenthetical' do - it_behaves_like 'a valid Phorge reference', 'Referencing (T123)', 'T123' - end - - context 'and prefixed by #' do - it_behaves_like 'a valid Phorge reference', 'Referencing #T123', 'T123' - end end context 'when text contains something resembling but is not a Phorge Maniphest task reference' do - shared_examples 'no valid Phorge reference' do |text| - it { is_expected.not_to match(text) } + where(:text) do + [ + 'See docs for Model-T1', + 'cc user @T1' + ] end - context 'as a hyphenated word' do - it_behaves_like 'no valid Phorge reference', 'See docs for Model-T1' - end - - context 'as a reference to a user with a task-like username' do - it_behaves_like 'no valid Phorge reference', 'cc user @T1' + with_them do + it { is_expected.not_to match(text) } end end end -- GitLab From 3db300a2c6f526985d0a4123cd7a774c44b34002 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Thu, 29 Feb 2024 10:08:58 -0800 Subject: [PATCH 08/25] Update locale/gitlab.pot --- locale/gitlab.pot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 0d0d1d23898321..94ca89369dd3e5 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -27359,16 +27359,16 @@ msgstr "" msgid "IssueTracker|Use IBM Engineering Workflow Management as this project's issue tracker. %{docs_link}" msgstr "" -msgid "IssueTracker|Use Phorge as this project's issue tracker." +msgid "IssueTracker|Use JetBrains YouTrack as this project's issue tracker." msgstr "" -msgid "IssueTracker|Use Phorge as this project's issue tracker. %{docs_link}" +msgid "IssueTracker|Use JetBrains YouTrack as this project's issue tracker. %{docs_link}" msgstr "" -msgid "IssueTracker|Use JetBrains YouTrack as this project's issue tracker." +msgid "IssueTracker|Use Phorge as this project's issue tracker." msgstr "" -msgid "IssueTracker|Use JetBrains YouTrack as this project's issue tracker. %{docs_link}" +msgid "IssueTracker|Use Phorge as this project's issue tracker. %{docs_link}" msgstr "" msgid "IssueTracker|Use Redmine as the issue tracker. %{docs_link}" -- GitLab From 7a639f155cb9d85831d93b6b7cb0b68c33a022b2 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Thu, 29 Feb 2024 10:09:38 -0800 Subject: [PATCH 09/25] Define metrics for Phorge integration --- .../20240229180548_projects_phorge_active.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ee/config/metrics/counts_all/20240229180548_projects_phorge_active.yml diff --git a/ee/config/metrics/counts_all/20240229180548_projects_phorge_active.yml b/ee/config/metrics/counts_all/20240229180548_projects_phorge_active.yml new file mode 100644 index 00000000000000..70501700b6d013 --- /dev/null +++ b/ee/config/metrics/counts_all/20240229180548_projects_phorge_active.yml @@ -0,0 +1,22 @@ +--- +key_path: counts.projects_phorge_active +description: Count of groups with active integrations for Phorge +product_section: dev +product_stage: manage +product_group: integrations +value_type: number +status: active +milestone: "16.10" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 +time_frame: all +data_source: database +data_category: optional +instrumentation_class: +performance_indicator_type: [] +distribution: +- ce +- ee +tier: +- free +- premium +- ultimate -- GitLab From 1c06e0b30b2f1309e7c2babd139f38b03dd67cf4 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Fri, 1 Mar 2024 09:29:49 -0800 Subject: [PATCH 10/25] Define missing metrics for Phorge integration --- ...0823_projects_inheriting_phorge_active.yml | 22 +++++++++++++++++++ ...20240301170844_instances_phorge_active.yml | 22 +++++++++++++++++++ .../20240301170915_groups_phorge_active.yml | 22 +++++++++++++++++++ ...171403_groups_inheriting_phorge_active.yml | 22 +++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 ee/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml create mode 100644 ee/config/metrics/counts_all/20240301170844_instances_phorge_active.yml create mode 100644 ee/config/metrics/counts_all/20240301170915_groups_phorge_active.yml create mode 100644 ee/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml diff --git a/ee/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml b/ee/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml new file mode 100644 index 00000000000000..ddeab8b6e580b2 --- /dev/null +++ b/ee/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml @@ -0,0 +1,22 @@ +--- +key_path: counts.projects_inheriting_phorge_active +description: Count of active projects inheriting integrations for Phorge +product_section: dev +product_stage: manage +product_group: integrations +value_type: number +status: active +milestone: "16.10" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 +time_frame: all +data_source: database +data_category: optional +instrumentation_class: +performance_indicator_type: [] +distribution: +- ce +- ee +tier: +- free +- premium +- ultimate diff --git a/ee/config/metrics/counts_all/20240301170844_instances_phorge_active.yml b/ee/config/metrics/counts_all/20240301170844_instances_phorge_active.yml new file mode 100644 index 00000000000000..d5b3bac7d04807 --- /dev/null +++ b/ee/config/metrics/counts_all/20240301170844_instances_phorge_active.yml @@ -0,0 +1,22 @@ +--- +key_path: counts.instances_phorge_active +description: Count of active instance-level integrations for Phorge +product_section: dev +product_stage: manage +product_group: integrations +value_type: number +status: active +milestone: "16.10" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 +time_frame: all +data_source: database +data_category: optional +instrumentation_class: +performance_indicator_type: [] +distribution: +- ce +- ee +tier: +- free +- premium +- ultimate diff --git a/ee/config/metrics/counts_all/20240301170915_groups_phorge_active.yml b/ee/config/metrics/counts_all/20240301170915_groups_phorge_active.yml new file mode 100644 index 00000000000000..e212cdfc4cc4ac --- /dev/null +++ b/ee/config/metrics/counts_all/20240301170915_groups_phorge_active.yml @@ -0,0 +1,22 @@ +--- +key_path: counts.groups_phorge_active +description: Count of groups with active integrations for Phorge +product_section: dev +product_stage: manage +product_group: integrations +value_type: number +status: active +milestone: "16.10" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 +time_frame: all +data_source: database +data_category: optional +instrumentation_class: +performance_indicator_type: [] +distribution: +- ce +- ee +tier: +- free +- premium +- ultimate diff --git a/ee/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml b/ee/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml new file mode 100644 index 00000000000000..980a3762a0c02a --- /dev/null +++ b/ee/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml @@ -0,0 +1,22 @@ +--- +key_path: counts.groups_inheriting_phorge_active +description: Count of active groups inheriting integrations for Phorge +product_section: dev +product_stage: manage +product_group: integrations +value_type: number +status: active +milestone: "16.10" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 +time_frame: all +data_source: database +data_category: optional +instrumentation_class: +performance_indicator_type: [] +distribution: +- ce +- ee +tier: +- free +- premium +- ultimate -- GitLab From a19174e9701723886b49d9f4f1f7f90980f87b49 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Fri, 1 Mar 2024 09:33:47 -0800 Subject: [PATCH 11/25] Use TableSyntax pipe style in Phorge spec --- spec/models/integrations/phorge_spec.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/spec/models/integrations/phorge_spec.rb b/spec/models/integrations/phorge_spec.rb index e98f7b08bdf591..fd5ece490eb427 100644 --- a/spec/models/integrations/phorge_spec.rb +++ b/spec/models/integrations/phorge_spec.rb @@ -35,15 +35,11 @@ subject { reference_pattern } context 'when text contains a Phorge Maniphest task reference' do - let(:reference) { 'T123' } - - where(:text) do - [ - 'Referencing T123', - 'Referencing T123, mid sentance', - 'Referencing (T123) parenthetically', - 'Referencing #T123 octothorpically? :)' - ] + where(:text, :reference) do + 'Referencing T111' | 'T111' + 'Referencing T222, mid sentance' | 'T222' + 'Referencing (T333) parenthetically' | 'T333' + 'Referencing #T444 octothorpically? :)' | 'T444' end with_them do -- GitLab From 2140cdee60ab8f4e4a2d70aafc79a00cf61899a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C4=8Cavoj?= Date: Mon, 4 Mar 2024 17:03:38 +0000 Subject: [PATCH 12/25] Rephrase Phorge spec examples and fix typo in docs --- doc/user/project/integrations/phorge.md | 2 +- spec/models/integrations/phorge_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/user/project/integrations/phorge.md b/doc/user/project/integrations/phorge.md index c8a24eef8e4e50..b89dbe4c552bf7 100644 --- a/doc/user/project/integrations/phorge.md +++ b/doc/user/project/integrations/phorge.md @@ -8,7 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w DETAILS: **Tier:** Free, Premium, Ultimate -**Offering:** SaaS, self-managed +**Offering:** SaaS, Self-managed > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.10. diff --git a/spec/models/integrations/phorge_spec.rb b/spec/models/integrations/phorge_spec.rb index fd5ece490eb427..895578ed9a8f7f 100644 --- a/spec/models/integrations/phorge_spec.rb +++ b/spec/models/integrations/phorge_spec.rb @@ -37,9 +37,9 @@ context 'when text contains a Phorge Maniphest task reference' do where(:text, :reference) do 'Referencing T111' | 'T111' - 'Referencing T222, mid sentance' | 'T222' - 'Referencing (T333) parenthetically' | 'T333' - 'Referencing #T444 octothorpically? :)' | 'T444' + 'Referencing T222, mid sentence' | 'T222' + 'Referencing (T333) in parentheses' | 'T333' + 'Referencing #T444 with a hash prefix' | 'T444' end with_them do -- GitLab From 34f1102fbe990b9a87a06bb7688635ef960ed738 Mon Sep 17 00:00:00 2001 From: Dan Duvall Date: Mon, 4 Mar 2024 09:23:04 -0800 Subject: [PATCH 13/25] Move Phorge metrics definitions to config/metrics --- .../metrics/counts_all/20240229180548_projects_phorge_active.yml | 1 - .../20240301170823_projects_inheriting_phorge_active.yml | 1 - .../counts_all/20240301170844_instances_phorge_active.yml | 1 - .../metrics/counts_all/20240301170915_groups_phorge_active.yml | 1 - .../20240301171403_groups_inheriting_phorge_active.yml | 1 - 5 files changed, 5 deletions(-) rename {ee/config => config}/metrics/counts_all/20240229180548_projects_phorge_active.yml (95%) rename {ee/config => config}/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml (95%) rename {ee/config => config}/metrics/counts_all/20240301170844_instances_phorge_active.yml (95%) rename {ee/config => config}/metrics/counts_all/20240301170915_groups_phorge_active.yml (95%) rename {ee/config => config}/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml (95%) diff --git a/ee/config/metrics/counts_all/20240229180548_projects_phorge_active.yml b/config/metrics/counts_all/20240229180548_projects_phorge_active.yml similarity index 95% rename from ee/config/metrics/counts_all/20240229180548_projects_phorge_active.yml rename to config/metrics/counts_all/20240229180548_projects_phorge_active.yml index 70501700b6d013..08250db4ec7955 100644 --- a/ee/config/metrics/counts_all/20240229180548_projects_phorge_active.yml +++ b/config/metrics/counts_all/20240229180548_projects_phorge_active.yml @@ -11,7 +11,6 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database data_category: optional -instrumentation_class: performance_indicator_type: [] distribution: - ce diff --git a/ee/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml b/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml similarity index 95% rename from ee/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml rename to config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml index ddeab8b6e580b2..2f1bdccb9a0e49 100644 --- a/ee/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml +++ b/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml @@ -11,7 +11,6 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database data_category: optional -instrumentation_class: performance_indicator_type: [] distribution: - ce diff --git a/ee/config/metrics/counts_all/20240301170844_instances_phorge_active.yml b/config/metrics/counts_all/20240301170844_instances_phorge_active.yml similarity index 95% rename from ee/config/metrics/counts_all/20240301170844_instances_phorge_active.yml rename to config/metrics/counts_all/20240301170844_instances_phorge_active.yml index d5b3bac7d04807..d49a1ac5d3a773 100644 --- a/ee/config/metrics/counts_all/20240301170844_instances_phorge_active.yml +++ b/config/metrics/counts_all/20240301170844_instances_phorge_active.yml @@ -11,7 +11,6 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database data_category: optional -instrumentation_class: performance_indicator_type: [] distribution: - ce diff --git a/ee/config/metrics/counts_all/20240301170915_groups_phorge_active.yml b/config/metrics/counts_all/20240301170915_groups_phorge_active.yml similarity index 95% rename from ee/config/metrics/counts_all/20240301170915_groups_phorge_active.yml rename to config/metrics/counts_all/20240301170915_groups_phorge_active.yml index e212cdfc4cc4ac..93cbf26a874e18 100644 --- a/ee/config/metrics/counts_all/20240301170915_groups_phorge_active.yml +++ b/config/metrics/counts_all/20240301170915_groups_phorge_active.yml @@ -11,7 +11,6 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database data_category: optional -instrumentation_class: performance_indicator_type: [] distribution: - ce diff --git a/ee/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml b/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml similarity index 95% rename from ee/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml rename to config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml index 980a3762a0c02a..4f5532afbb04dc 100644 --- a/ee/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml +++ b/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml @@ -11,7 +11,6 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database data_category: optional -instrumentation_class: performance_indicator_type: [] distribution: - ce -- GitLab From 3de718c0d3add7b52287442bd13118174e7dd059 Mon Sep 17 00:00:00 2001 From: Nicolas Dular Date: Wed, 27 Mar 2024 19:53:06 +0000 Subject: [PATCH 14/25] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/integrations/phorge.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/project/integrations/phorge.md b/doc/user/project/integrations/phorge.md index b89dbe4c552bf7..84508df7dee009 100644 --- a/doc/user/project/integrations/phorge.md +++ b/doc/user/project/integrations/phorge.md @@ -8,7 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w DETAILS: **Tier:** Free, Premium, Ultimate -**Offering:** SaaS, Self-managed +**Offering:** GitLab.com, Self-managed, GitLab Dedicated > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.10. -- GitLab From f0995bce62bdbc20e345a4c47c3c9e4972a0f197 Mon Sep 17 00:00:00 2001 From: Evan Read Date: Wed, 27 Mar 2024 19:56:49 +0000 Subject: [PATCH 15/25] Apply 1 suggestion(s) to 1 file(s) --- doc/api/integrations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/integrations.md b/doc/api/integrations.md index 5dd2a786c18775..30fb4be127a721 100644 --- a/doc/api/integrations.md +++ b/doc/api/integrations.md @@ -1416,7 +1416,7 @@ GET /projects/:id/integrations/packagist ## Phorge -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.10. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.11. ### Set up Phorge -- GitLab From 5a60b0d062ad535e7bac20d572ff27780c04ed50 Mon Sep 17 00:00:00 2001 From: Evan Read Date: Wed, 27 Mar 2024 20:04:23 +0000 Subject: [PATCH 16/25] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/integrations/phorge.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/project/integrations/phorge.md b/doc/user/project/integrations/phorge.md index 84508df7dee009..9f8ad7429308eb 100644 --- a/doc/user/project/integrations/phorge.md +++ b/doc/user/project/integrations/phorge.md @@ -10,7 +10,7 @@ DETAILS: **Tier:** Free, Premium, Ultimate **Offering:** GitLab.com, Self-managed, GitLab Dedicated -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.10. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.11. You can use [Phorge](https://we.phorge.it/) as an external issue tracker. To enable the Phorge integration in a project: -- GitLab From f0dbd766e3e2335f02de119231f6828f64ee876c Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Wed, 27 Mar 2024 21:01:51 +0000 Subject: [PATCH 17/25] Add Phorge to spelling-exceptions.txt --- doc/.vale/gitlab/spelling-exceptions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/.vale/gitlab/spelling-exceptions.txt b/doc/.vale/gitlab/spelling-exceptions.txt index 44de1f0fd641cc..c1fd6413818558 100644 --- a/doc/.vale/gitlab/spelling-exceptions.txt +++ b/doc/.vale/gitlab/spelling-exceptions.txt @@ -684,6 +684,7 @@ Phabricator phaser phasers phpenv +Phorge PHPUnit PIDs pipenv -- GitLab From fbe60e8259f074e14308d78334c455972530ba39 Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Thu, 28 Mar 2024 16:31:56 +0000 Subject: [PATCH 18/25] Apply 5 suggestion(s) to 2 file(s) --- doc/api/integrations.md | 2 +- doc/user/project/integrations/phorge.md | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/doc/api/integrations.md b/doc/api/integrations.md index 30fb4be127a721..cd60a56802a83a 100644 --- a/doc/api/integrations.md +++ b/doc/api/integrations.md @@ -1429,7 +1429,7 @@ PUT /projects/:id/integrations/phorge Parameters: | Parameter | Type | Required | Description | -| ------------- | ------ | -------- | -------------- | +|-----------------|--------|----------|-----------------------| | `issues_url` | string | true | URL of the issue. | | `project_url` | string | true | URL of the project. | | `new_issue_url` | string | true | URL of the new issue. | diff --git a/doc/user/project/integrations/phorge.md b/doc/user/project/integrations/phorge.md index 9f8ad7429308eb..e9c5c083f39335 100644 --- a/doc/user/project/integrations/phorge.md +++ b/doc/user/project/integrations/phorge.md @@ -13,28 +13,25 @@ DETAILS: > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.11. You can use [Phorge](https://we.phorge.it/) as an external issue tracker. -To enable the Phorge integration in a project: +To configure Phorge in a GitLab project: 1. On the left sidebar, select **Search or go to** and find your project. 1. Select **Settings > Integrations**. 1. Select **Phorge**. 1. Under **Enable integration**, select the **Active** checkbox. -1. Fill in the required fields: - - - **Project URL**: The URL to the Phorge project to link to this GitLab project. - - **Issue URL**: The URL to the Phorge project issue to link to this GitLab project. - The URL must contain `:id`. GitLab replaces this token with the Phorge Maniphest task ID (e.g. `T123`). - - **New issue URL**: URL to create a new maniphest task item. You may wish - to prefill a specific set of tags related to this project using `?tags=`. - +1. In **Project URL**, enter the URL to the Phorge project. +1. In **Issue URL**, enter the URL to the Phorge project issue. + The URL must contain `:id`. GitLab replaces this token with the Maniphest task ID (for example, `T123`). +1. In **New issue URL**, enter the URL to a new Phorge project issue. + To prefill tags related to this project, you can use `?tags=`. 1. Optional. Select **Test settings**. 1. Select **Save changes**. After you have configured and enabled Phorge, you see the Phorge link on the GitLab project pages, which takes you to your Phorge project. -## Reference Phorge issues/tasks in GitLab +## Reference Phorge issues and tasks in GitLab You can reference your Phorge Maniphest tasks using: -- `T`, where `` is a Phorge Maniphest task ID number (example `T123`). +You can reference your Phorge Maniphest tasks using `T`, where `` is a Phorge Maniphest task ID number. For example, `T123`. -- GitLab From a493bcf5cdafcba55464cc56cee5fb61a22ee0da Mon Sep 17 00:00:00 2001 From: Ashraf Khamis Date: Thu, 28 Mar 2024 17:30:09 +0000 Subject: [PATCH 19/25] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/integrations/phorge.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/project/integrations/phorge.md b/doc/user/project/integrations/phorge.md index e9c5c083f39335..2c4dbf6c108182 100644 --- a/doc/user/project/integrations/phorge.md +++ b/doc/user/project/integrations/phorge.md @@ -12,7 +12,7 @@ DETAILS: > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.11. -You can use [Phorge](https://we.phorge.it/) as an external issue tracker. +You can use [Phorge](https://we.phorge.it/) as an external issue tracker in GitLab. To configure Phorge in a GitLab project: 1. On the left sidebar, select **Search or go to** and find your project. -- GitLab From ea7c03f2765972fedd541b87e120f969290a7c57 Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Thu, 28 Mar 2024 17:49:54 +0000 Subject: [PATCH 20/25] Add "Maniphest" to spelling-exceptions.txt --- doc/.vale/gitlab/spelling-exceptions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/.vale/gitlab/spelling-exceptions.txt b/doc/.vale/gitlab/spelling-exceptions.txt index c1fd6413818558..76df4a29585f26 100644 --- a/doc/.vale/gitlab/spelling-exceptions.txt +++ b/doc/.vale/gitlab/spelling-exceptions.txt @@ -560,6 +560,7 @@ Mailroom Makefile Makefiles malloc +Maniphest Markdown markdownlint Marketo -- GitLab From 5d77fe53df6f5188ea5d0b99d05653e7cd964852 Mon Sep 17 00:00:00 2001 From: Ashraf Khamis Date: Mon, 1 Apr 2024 18:41:03 +0000 Subject: [PATCH 21/25] Apply 2 suggestion(s) to 1 file(s) --- doc/user/project/integrations/phorge.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/user/project/integrations/phorge.md b/doc/user/project/integrations/phorge.md index 2c4dbf6c108182..670f486e08b8fc 100644 --- a/doc/user/project/integrations/phorge.md +++ b/doc/user/project/integrations/phorge.md @@ -13,6 +13,9 @@ DETAILS: > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863) in GitLab 16.11. You can use [Phorge](https://we.phorge.it/) as an external issue tracker in GitLab. + +## Configure the integration + To configure Phorge in a GitLab project: 1. On the left sidebar, select **Search or go to** and find your project. @@ -27,11 +30,6 @@ To configure Phorge in a GitLab project: 1. Optional. Select **Test settings**. 1. Select **Save changes**. -After you have configured and enabled Phorge, you see the Phorge link on the GitLab project pages, -which takes you to your Phorge project. - -## Reference Phorge issues and tasks in GitLab - -You can reference your Phorge Maniphest tasks using: - -You can reference your Phorge Maniphest tasks using `T`, where `` is a Phorge Maniphest task ID number. For example, `T123`. +In that GitLab project, you can see a link to your Phorge project. +You can now reference your Phorge issues and tasks in GitLab with +`T`, where `` is a Maniphest task ID (for example, `T123`). -- GitLab From f1814d9f9a3cfc3cdd0f4dcd70c165985bce1ffd Mon Sep 17 00:00:00 2001 From: Bojan Marjanovic Date: Tue, 2 Apr 2024 15:37:23 +0000 Subject: [PATCH 22/25] Apply 5 suggestion(s) to 5 file(s) --- .../counts_all/20240229180548_projects_phorge_active.yml | 2 +- .../20240301170823_projects_inheriting_phorge_active.yml | 2 +- .../counts_all/20240301170844_instances_phorge_active.yml | 2 +- .../metrics/counts_all/20240301170915_groups_phorge_active.yml | 2 +- .../20240301171403_groups_inheriting_phorge_active.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/metrics/counts_all/20240229180548_projects_phorge_active.yml b/config/metrics/counts_all/20240229180548_projects_phorge_active.yml index 08250db4ec7955..20da23f37a960c 100644 --- a/config/metrics/counts_all/20240229180548_projects_phorge_active.yml +++ b/config/metrics/counts_all/20240229180548_projects_phorge_active.yml @@ -6,7 +6,7 @@ product_stage: manage product_group: integrations value_type: number status: active -milestone: "16.10" +milestone: "16.11" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database diff --git a/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml b/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml index 2f1bdccb9a0e49..2ad59539695ee3 100644 --- a/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml +++ b/config/metrics/counts_all/20240301170823_projects_inheriting_phorge_active.yml @@ -6,7 +6,7 @@ product_stage: manage product_group: integrations value_type: number status: active -milestone: "16.10" +milestone: "16.11" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database diff --git a/config/metrics/counts_all/20240301170844_instances_phorge_active.yml b/config/metrics/counts_all/20240301170844_instances_phorge_active.yml index d49a1ac5d3a773..9ec941ab781424 100644 --- a/config/metrics/counts_all/20240301170844_instances_phorge_active.yml +++ b/config/metrics/counts_all/20240301170844_instances_phorge_active.yml @@ -6,7 +6,7 @@ product_stage: manage product_group: integrations value_type: number status: active -milestone: "16.10" +milestone: "16.11" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database diff --git a/config/metrics/counts_all/20240301170915_groups_phorge_active.yml b/config/metrics/counts_all/20240301170915_groups_phorge_active.yml index 93cbf26a874e18..0471127bd23651 100644 --- a/config/metrics/counts_all/20240301170915_groups_phorge_active.yml +++ b/config/metrics/counts_all/20240301170915_groups_phorge_active.yml @@ -6,7 +6,7 @@ product_stage: manage product_group: integrations value_type: number status: active -milestone: "16.10" +milestone: "16.11" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database diff --git a/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml b/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml index 4f5532afbb04dc..cb2fa8f789b12e 100644 --- a/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml +++ b/config/metrics/counts_all/20240301171403_groups_inheriting_phorge_active.yml @@ -6,7 +6,7 @@ product_stage: manage product_group: integrations value_type: number status: active -milestone: "16.10" +milestone: "16.11" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863 time_frame: all data_source: database -- GitLab From 0fdac1a4286c55da20c3ed84b8f7d321645b7c3f Mon Sep 17 00:00:00 2001 From: Bojan Marjanovic Date: Tue, 2 Apr 2024 16:38:47 +0000 Subject: [PATCH 23/25] Apply 1 suggestion(s) to 1 file(s) --- doc/api/integrations.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/api/integrations.md b/doc/api/integrations.md index 099da09185821f..5425bbf0349d8c 100644 --- a/doc/api/integrations.md +++ b/doc/api/integrations.md @@ -1432,7 +1432,6 @@ Parameters: |-----------------|--------|----------|-----------------------| | `issues_url` | string | true | URL of the issue. | | `project_url` | string | true | URL of the project. | -| `new_issue_url` | string | true | URL of the new issue. | ### Disable Phorge -- GitLab From a1af28d01a053917208a2a066a705ec506271c7a Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Thu, 4 Apr 2024 09:36:38 -0600 Subject: [PATCH 24/25] phorge integration: rubocop disable Gitlab/Rails/SafeFormat --- app/models/integrations/phorge.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/integrations/phorge.rb b/app/models/integrations/phorge.rb index 7b4ed1993c5968..5d7c8c1d88f5d6 100644 --- a/app/models/integrations/phorge.rb +++ b/app/models/integrations/phorge.rb @@ -42,10 +42,12 @@ def self.help target: '_blank', rel: 'noopener noreferrer' + # rubocop:disable Gitlab/Rails/SafeFormat format( s_("IssueTracker|Use Phorge as this project's issue tracker. %{docs_link}").html_safe, docs_link: docs_link.html_safe ) + # rubocop:enable Gitlab/Rails/SafeFormat end # rubocop:enable Rails/OutputSafety -- GitLab From fa75d896e69702f99237fe13eeb166bd80001db4 Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Thu, 4 Apr 2024 10:04:44 -0600 Subject: [PATCH 25/25] phorge integration: provide context for rubocop disable --- app/models/integrations/phorge.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/integrations/phorge.rb b/app/models/integrations/phorge.rb index 5d7c8c1d88f5d6..822cbd8d07748d 100644 --- a/app/models/integrations/phorge.rb +++ b/app/models/integrations/phorge.rb @@ -42,7 +42,7 @@ def self.help target: '_blank', rel: 'noopener noreferrer' - # rubocop:disable Gitlab/Rails/SafeFormat + # rubocop:disable Gitlab/Rails/SafeFormat -- See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/145863#note_1845580057 format( s_("IssueTracker|Use Phorge as this project's issue tracker. %{docs_link}").html_safe, docs_link: docs_link.html_safe -- GitLab