Commit 73cbbb91 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch '300598-msj-github' into 'master'

Review and revise Integrations/GitHub UI text

See merge request gitlab-org/gitlab!57389
parents b81409fc 476f2c81
...@@ -18,38 +18,39 @@ and is automatically configured on [GitHub import](../../../integration/github.m ...@@ -18,38 +18,39 @@ and is automatically configured on [GitHub import](../../../integration/github.m
## Configuration ## Configuration
### Complete these steps on GitHub
This integration requires a [GitHub API token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) This integration requires a [GitHub API token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
with `repo:status` access granted: with `repo:status` access granted.
Complete these steps on GitHub:
1. Go to your "Personal access tokens" page at <https://github.com/settings/tokens> 1. Go to your **Personal access tokens** page at <https://github.com/settings/tokens>.
1. Click "Generate New Token" 1. Select **Generate new token**.
1. Ensure that `repo:status` is checked and click "Generate token" 1. Under **Note**, enter a name for the new token.
1. Copy the generated token to use on GitLab 1. Ensure that `repo:status` is checked and select **Generate token**.
1. Copy the generated token to use in GitLab.
### Complete these steps on GitLab Complete these steps in GitLab:
1. Navigate to the project you want to configure. 1. Go to the project you want to configure.
1. Navigate to the [Integrations page](overview.md#accessing-integrations) 1. Go to the [Integrations page](overview.md#accessing-integrations)
1. Click "GitHub". 1. Select **GitHub**.
1. Ensure that the **Active** toggle is enabled. 1. Ensure that the **Active** toggle is enabled.
1. Paste the token you've generated on GitHub 1. Paste the token you generated on GitHub.
1. Enter the path to your project on GitHub, such as `https://github.com/username/repository` 1. Enter the path to your project on GitHub, such as `https://github.com/username/repository`.
1. Optionally uncheck **Static status check names** checkbox to disable static status check names. 1. (Optional) To disable static status check names, clear the **Static status check names** checkbox.
1. Save or optionally click "Test Settings". 1. Select **Save changes** or optionally select **Test settings**.
Once the integration is configured, see [Pipelines for external pull requests](../../../ci/ci_cd_for_external_repos/#pipelines-for-external-pull-requests) After configuring the integration, see [Pipelines for external pull requests](../../../ci/ci_cd_for_external_repos/#pipelines-for-external-pull-requests)
to configure pipelines to run for open pull requests. to configure pipelines to run for open pull requests.
#### Static / dynamic status check names ### Static / dynamic status check names
> - Introduced in GitLab 11.5: using static status check names as opt-in option. > - Introduced in GitLab 11.5: using static status check names as opt-in option.
> - [In GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/-/issues/9931), static status check names is default behavior for new projects. > - [In GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/-/issues/9931), static status check names is default behavior for new projects.
This makes it possible to mark these status checks as _Required_ on GitHub. This makes it possible to mark these status checks as **Required** on GitHub.
With **Static status check names** enabled on the integration page, your
GitLab instance host name is appended to a status check name, When **Static status check names** is enabled on the integration page, your
whereas in case of dynamic status check names, a branch name is appended. GitLab instance host name is appended to a status check name.
![Configure GitHub Project Integration](img/github_configuration.png) When disabled, it uses dynamic status check names and appends the branch name.
...@@ -23,14 +23,14 @@ class GithubService < Service ...@@ -23,14 +23,14 @@ class GithubService < Service
end end
def description def description
"See pipeline statuses on GitHub for your commits and pull requests" s_("GithubIntegration|Obtain statuses for commits and pull requests.")
end end
def help def help
return unless project return unless project
docs_link = link_to _('Learn more'), help_page_url('user/project/repository/repository_mirroring') docs_link = link_to _('What is repository mirroring?'), help_page_url('user/project/repository/repository_mirroring')
s_("Integrations|This requires mirroring your GitHub repository to this project. %{docs_link}" % { docs_link: docs_link }).html_safe s_("GithubIntegration|This requires mirroring your GitHub repository to this project. %{docs_link}" % { docs_link: docs_link }).html_safe
end end
def self.to_param def self.to_param
...@@ -38,21 +38,28 @@ class GithubService < Service ...@@ -38,21 +38,28 @@ class GithubService < Service
end end
def fields def fields
learn_more_link_url = help_page_path('user/project/integrations/github', anchor: 'static--dynamic-status-check-name')
learn_more_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: learn_more_link_url }
static_context_field_help = s_('GithubIntegration|Select this if you want GitHub to mark status checks as "Required". %{learn_more_link_start}Learn more%{learn_more_link_end}.').html_safe % { learn_more_link_start: learn_more_link_start, learn_more_link_end: '</a>'.html_safe }
token_url = 'https://github.com/settings/tokens'
token_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: token_url }
token_field_help = s_('GithubIntegration|Create a %{token_link_start}personal access token%{token_link_end} with %{status_html} access granted and paste it here.').html_safe % { token_link_start: token_link_start, token_link_end: '</a>'.html_safe, status_html: '<code>repo:status</code>'.html_safe }
[ [
{ type: 'password', { type: 'password',
name: "token", name: "token",
required: true, required: true,
placeholder: "e.g. 8d3f016698e...", placeholder: "8d3f016698e...",
help: 'Create a <a href="https://github.com/settings/tokens">personal access token</a> with <code>repo:status</code> access granted and paste it here.'.html_safe }, help: token_field_help },
{ type: 'text', { type: 'text',
name: "repository_url", name: "repository_url",
title: 'Repository URL', title: s_('GithubIntegration|Repository URL'),
required: true, required: true,
placeholder: 'e.g. https://github.com/owner/repository' }, placeholder: 'https://github.com/owner/repository' },
{ type: 'checkbox', { type: 'checkbox',
name: "static_context", name: "static_context",
title: 'Static status check names', title: s_('GithubIntegration|Static status check names (optional)'),
help: 'GitHub status checks need static name in order to be marked as "required".' } help: static_context_field_help }
] ]
end end
......
---
title: Review and revise Integrations/GitHub UI text
merge_request: 57389
author:
type: other
...@@ -14450,6 +14450,24 @@ msgstr "" ...@@ -14450,6 +14450,24 @@ msgstr ""
msgid "Gitea Import" msgid "Gitea Import"
msgstr "" msgstr ""
msgid "GithubIntegration|Create a %{token_link_start}personal access token%{token_link_end} with %{status_html} access granted and paste it here."
msgstr ""
msgid "GithubIntegration|Obtain statuses for commits and pull requests."
msgstr ""
msgid "GithubIntegration|Repository URL"
msgstr ""
msgid "GithubIntegration|Select this if you want GitHub to mark status checks as \"Required\". %{learn_more_link_start}Learn more%{learn_more_link_end}."
msgstr ""
msgid "GithubIntegration|Static status check names (optional)"
msgstr ""
msgid "GithubIntegration|This requires mirroring your GitHub repository to this project. %{docs_link}"
msgstr ""
msgid "Gitlab Pages" msgid "Gitlab Pages"
msgstr "" msgstr ""
...@@ -16709,9 +16727,6 @@ msgstr "" ...@@ -16709,9 +16727,6 @@ msgstr ""
msgid "Integrations|This integration, and inheriting projects were reset." msgid "Integrations|This integration, and inheriting projects were reset."
msgstr "" msgstr ""
msgid "Integrations|This requires mirroring your GitHub repository to this project. %{docs_link}"
msgstr ""
msgid "Integrations|To keep this project going, create a new issue." msgid "Integrations|To keep this project going, create a new issue."
msgstr "" msgstr ""
...@@ -34339,6 +34354,9 @@ msgstr "" ...@@ -34339,6 +34354,9 @@ msgstr ""
msgid "What does this command do?" msgid "What does this command do?"
msgstr "" msgstr ""
msgid "What is repository mirroring?"
msgstr ""
msgid "What is squashing?" msgid "What is squashing?"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment