Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-10-06 09:08:09 +00:00
parent 52b1470ada
commit b558fe14cf
5 changed files with 67 additions and 54 deletions

View file

@ -211,19 +211,6 @@ namespace = Namespace.find_by_full_path("<new_namespace>")
::Projects::TransferService.new(p, current_user).execute(namespace)
```
### Bulk update service integration password for _all_ projects
For example, change the Jira user's password for all projects that have the Jira
integration active:
```ruby
p = Project.find_by_sql("SELECT p.id FROM projects p LEFT JOIN services s ON p.id = s.project_id WHERE s.type = 'JiraService' AND s.active = true")
p.each do |project|
project.jira_integration.update_attribute(:password, '<your-new-password>')
end
```
### Bulk update push rules for _all_ projects
For example, enable **Check whether the commit author is a GitLab user** and **Do not allow users to remove Git tags with `git push`** checkboxes, and create a filter for allowing commits from a specific email domain only:
@ -241,40 +228,6 @@ Project.find_each do |p|
end
```
### Bulk update to change all the Jira integrations to Jira instance-level values
To change all Jira project to use the instance-level integration settings:
1. In a Rails console:
```ruby
jira_integration_instance_id = Integrations::Jira.find_by(instance: true).id
Integrations::Jira.where(active: true, instance: false, template: false, inherit_from_id: nil).find_each do |integration|
integration.update_attribute(:inherit_from_id, jira_integration_instance_id)
end
```
1. Modify and save again the instance-level integration from the UI to propagate the changes to all the group-level and project-level integrations.
### Check if Jira Cloud is linked to a namespace
```ruby
JiraConnectSubscription.where(namespace: Namespace.by_path('group/subgroup'))
```
### Check if Jira Cloud is linked to a project
```ruby
Project.find_by_full_path('path/to/project').jira_subscription_exists?
```
### Check if Jira Cloud URL is linked to any namespace
```ruby
installation = JiraConnectInstallation.find_by_base_url("https://customer_name.atlassian.net")
installation.subscriptions
```
### Bulk update to disable the Slack Notification service
To disable notifications for all projects that have Slack service enabled, do:

View file

@ -170,7 +170,7 @@ Supported attributes:
| `id` | integer/string | **{check-circle}** Yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding) owned by the authenticated user. |
| `ref` | string | **{check-circle}** Yes | The branch or tag to run the pipeline on. |
| `token` | string | **{check-circle}** Yes | The trigger token or CI/CD job token. |
| `variables` | array | **{dotted-circle}** No | An array containing the variables available in the pipeline, matching the structure `[{ 'key': 'UPLOAD_TO_S3', 'variable_type': 'file', 'value': 'true' }, {'key': 'TEST', 'value': 'test variable'}]`. If `variable_type` is excluded, it defaults to `env_var`. |
| `variables` | array | **{dotted-circle}** No | An [array of hashes](index.md#array-of-hashes) containing the variables available in the pipeline, matching the structure `[{ 'key': 'UPLOAD_TO_S3', 'variable_type': 'file', 'value': 'true' }, {'key': 'TEST', 'value': 'test variable'}]`. If `variable_type` is excluded, it defaults to `env_var`. |
Example request:

View file

@ -159,13 +159,13 @@ If the CI/CD configuration file is in a different project:
- The file must exist on its default branch, or specify the branch as refname.
- The path must be relative to the root directory in the other project.
- The path must include the group and project name at the end.
- The path must be followed by an `@` symbol and the full group and project path.
For example:
- `.gitlab-ci.yml@mygroup/another-project`
- `my/path/.my-custom-file.yml@mygroup/another-project`
- `my/path/.my-custom-file.yml@mygroup/another-project:refname`
- `.gitlab-ci.yml@namespace/another-project`
- `my/path/.my-custom-file.yml@namespace/sub-group/another-project`
- `my/path/.my-custom-file.yml@namespace/sub-group1/sub-group2/another-project:refname`
If the configuration file is in a separate project, you can set more granular permissions. For example:

View file

@ -122,3 +122,54 @@ and complete the CAPTCHA.
There is a [known bug](https://gitlab.com/gitlab-org/gitlab/-/issues/341571)
where the Jira integration sometimes does not work for a project that has been imported.
As a workaround, disable the integration and then re-enable it.
### Bulk change all Jira integrations to Jira instance-level values
To change all Jira projects to use instance-level integration settings:
1. In a [Rails console](../../administration/operations/rails_console.md#starting-a-rails-console-session), run the following:
```ruby
jira_integration_instance_id = Integrations::Jira.find_by(instance: true).id
Integrations::Jira.where(active: true, instance: false, template: false, inherit_from_id: nil).find_each do |integration|
integration.update_attribute(:inherit_from_id, jira_integration_instance_id)
end
```
1. Modify and save the instance-level integration from the UI to propagate the changes to all group-level and project-level integrations.
### Check if Jira Cloud is linked
You can use the [Rails console](../../administration/operations/rails_console.md#starting-a-rails-console-session) to check if Jira Cloud is linked to:
A specified namespace:
```ruby
JiraConnectSubscription.where(namespace: Namespace.by_path('group/subgroup'))
```
A specified project:
```ruby
Project.find_by_full_path('path/to/project').jira_subscription_exists?
```
Any namespace:
```ruby
installation = JiraConnectInstallation.find_by_base_url("https://customer_name.atlassian.net")
installation.subscriptions
```
### Bulk update the service integration password for all projects
To reset the Jira user's password for all projects with active Jira integrations,
run the following in a [Rails console](../../administration/operations/rails_console.md#starting-a-rails-console-session):
```ruby
p = Project.find_by_sql("SELECT p.id FROM projects p LEFT JOIN services s ON p.id = s.project_id WHERE s.type = 'JiraService' AND s.active = true")
p.each do |project|
project.jira_integration.update_attribute(:password, '<your-new-password>')
end
```

View file

@ -106,12 +106,12 @@ Best practices for a webhook receiver:
### Failing webhooks
> - Introduced in GitLab 13.12 [with a flag](../../../administration/feature_flags.md) named `web_hooks_disable_failed`. Disabled by default.
> - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/329849) in GitLab 14.9.
> Introduced in GitLab 13.12 [with a flag](../../../administration/feature_flags.md) named `web_hooks_disable_failed`. Disabled by default.
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available,
ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `web_hooks_disable_failed`.
On GitLab.com, this feature is not available.
The feature is not ready for production use.
If a webhook fails repeatedly, it may be disabled automatically.
@ -310,6 +310,15 @@ Missing intermediate certificates are common causes of verification failure.
### Re-enable disabled webhooks
> - Introduced in GitLab 15.2 [with a flag](../../../administration/feature_flags.md) named `webhooks_failed_callout`. Disabled by default.
> - The [`web_hooks_disable_failed` flag](#failing-webhooks) must also be enabled for this feature to work. Disabled by default.
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available,
ask an administrator to [enable the feature flags](../../../administration/feature_flags.md) named `webhooks_failed_callout` and `web_hooks_disable_failed`.
On GitLab.com, this feature is not available.
The feature is not ready for production use.
If a webhook is failing, a banner displays at the top of the edit page explaining
why it is disabled, and when it will be automatically re-enabled. For example: