Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-01-04 00:13:13 +00:00
parent 3ff10e08a5
commit 5b75872891
8 changed files with 99 additions and 29 deletions

View file

@ -69,6 +69,12 @@ export default {
runnerDeleteModalId() {
return `delete-runner-modal-${this.runnerId}`;
},
canUpdate() {
return this.runner.userPermissions?.updateRunner;
},
canDelete() {
return this.runner.userPermissions?.deleteRunner;
},
},
methods: {
async onToggleActive() {
@ -156,7 +162,7 @@ export default {
See https://gitlab.com/gitlab-org/gitlab/-/issues/334802
-->
<gl-button
v-if="runner.adminUrl"
v-if="canUpdate && runner.adminUrl"
v-gl-tooltip.hover.viewport="$options.I18N_EDIT"
:href="runner.adminUrl"
:aria-label="$options.I18N_EDIT"
@ -164,6 +170,7 @@ export default {
data-testid="edit-runner"
/>
<gl-button
v-if="canUpdate"
v-gl-tooltip.hover.viewport="toggleActiveTitle"
:aria-label="toggleActiveTitle"
:icon="toggleActiveIcon"
@ -172,6 +179,7 @@ export default {
@click="onToggleActive"
/>
<gl-button
v-if="canDelete"
v-gl-tooltip.hover.viewport="deleteTitle"
v-gl-modal="runnerDeleteModalId"
:aria-label="deleteTitle"
@ -182,6 +190,7 @@ export default {
/>
<runner-delete-modal
v-if="canDelete"
:ref="runnerDeleteModalId"
:modal-id="runnerDeleteModalId"
:runner-name="runnerName"

View file

@ -12,4 +12,8 @@ fragment RunnerNode on CiRunner {
tagList
contactedAt
status(legacyMode: null)
userPermissions {
updateRunner
deleteRunner
}
}

View file

@ -151,7 +151,7 @@ Plan.default.actual_limits.update!(web_hook_calls: 10)
Set the limit to `0` to disable it.
- **Default rate limit**: Disabled.
- **Default rate limit**: Disabled (unlimited).
## Gitaly concurrency limit
@ -230,10 +230,8 @@ There is a limit when embedding metrics in GitLab Flavored Markdown (GFM) for pe
## Number of webhooks
On GitLab.com, the [maximum number of webhooks and their size](../user/gitlab_com/index.md#webhooks) per project, and per group, is limited.
To set this limit for a self-managed installation, where the default is `100` project webhooks and `50` group webhooks, run the following in the
[GitLab Rails console](operations/rails_console.md#starting-a-rails-console-session):
To set the maximum number of group or project webhooks for a self-managed installation,
run the following in the [GitLab Rails console](operations/rails_console.md#starting-a-rails-console-session):
```ruby
# If limits don't exist for the default plan, you can create one with:
@ -248,6 +246,11 @@ Plan.default.actual_limits.update!(group_hooks: 100)
Set the limit to `0` to disable it.
- **Default maximum number of webhooks**: `100` per project, `50` per group
- **Maximum payload size**: 25 MB
For GitLab.com, see the [webhook limits for GitLab.com](../user/gitlab_com/index.md#webhooks).
## Pull Mirroring Interval
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/237891) in GitLab 13.7.

View file

@ -118,15 +118,18 @@ and they will assist you with any issues you are having.
kubectl get events -w --namespace=gitlab
```
- Most of the useful GitLab tools (console, Rake tasks, etc) are found in the task-runner
pod. You may enter it and run commands inside or run them from the outside:
- Most of the useful GitLab tools (console, Rake tasks, etc) are found in the toolbox
pod. You may enter it and run commands inside or run them from the outside.
NOTE:
The `task-runner` pod was renamed to `toolbox` in GitLab 14.2 (charts 5.2).
```shell
# find the pod
kubectl get pods | grep task-runner
kubectl --namespace gitlab get pods -lapp=toolbox
# enter it
kubectl exec -it <task-runner-pod-name> -- bash
kubectl exec -it <toolbox-pod-name> -- bash
# open rails console
# rails console can be also called from other GitLab pods
@ -139,10 +142,10 @@ and they will assist you with any issues you are having.
/usr/local/bin/gitlab-rake gitlab:check
# open console without entering pod
kubectl exec -it <task-runner-pod-name> -- /srv/gitlab/bin/rails console
kubectl exec -it <toolbox-pod-name> -- /srv/gitlab/bin/rails console
# check the status of DB migrations
kubectl exec -it <task-runner-pod-name> -- /usr/local/bin/gitlab-rake db:migrate:status
kubectl exec -it <toolbox-pod-name> -- /usr/local/bin/gitlab-rake db:migrate:status
```
You can also use `gitlab-rake`, instead of `/usr/local/bin/gitlab-rake`.
@ -163,12 +166,15 @@ and they will assist you with any issues you are having.
kubectl get secret <secret-name> -ojsonpath={.data.password} | base64 --decode ; echo
```
- How to connect to a GitLab PostgreSQL database:
- How to connect to a GitLab PostgreSQL database.
NOTE:
The `task-runner` pod was renamed to `toolbox` in GitLab 14.2 (charts 5.2).
In GitLab 14.2 (chart 5.2) and later:
```shell
kubectl exec -it <task-runner-pod-name> -- /srv/gitlab/bin/rails dbconsole --include-password --database main
kubectl exec -it <toolbox-pod-name> -- /srv/gitlab/bin/rails dbconsole --include-password --database main
```
In GitLab 14.1 (chart 5.1) and earlier:

View file

@ -13,7 +13,7 @@ your applications.
Metrics help you understand the health and performance of your infrastructure,
applications, and systems by providing insights into your application's reliability,
stability, and performance. GitLab provides a dashboard out-of-the-box, which you
stability, and performance. GitLab provides a default dashboard that you
can extend with custom metrics, and augment with additional custom dashboards. You
can track the metrics that matter most to your team, generate automated alerts when
performance degrades, and manage those alerts - all within GitLab.

View file

@ -115,12 +115,8 @@ the host, based on your installed version of GitLab:
If you're using the [GitLab Helm chart](https://gitlab.com/gitlab-org/charts/gitlab)
on a Kubernetes cluster, you can run the backup task by using `kubectl` to run the `backup-utility`
script on the GitLab task runner pod. For more details, see
[backing up a GitLab installation](https://gitlab.com/gitlab-org/charts/gitlab/blob/master/doc/backup-restore/backup.md#backing-up-a-gitlab-installation).
```shell
kubectl exec -it <gitlab task-runner pod> -- backup-utility
```
script on the GitLab toolbox pod. For more details, see the
[charts backup documentation](https://docs.gitlab.com/charts/backup-restore/backup.html).
Similar to the Kubernetes case, if you have scaled out your GitLab cluster to
use multiple application servers, you should pick a designated node (that isn't

View file

@ -209,13 +209,17 @@ also load certain page content directly from common public CDN hostnames.
## Webhooks
The following limits apply for [Webhooks](../project/integrations/webhooks.md):
The following limits apply for [webhooks](../project/integrations/webhooks.md):
| Setting | GitLab.com | Default |
|----------------------|-------------|---------|
| [Webhook rate limit](../../administration/instance_limits.md#webhook-rate-limit) | `120` calls per minute for GitLab Free, unlimited for GitLab Premium and GitLab Ultimate | Unlimited |
| [Number of webhooks](../../administration/instance_limits.md#number-of-webhooks) | `100` per project, `50` per group | `100` per project, `50` per group |
| Maximum payload size | 25 MB | 25 MB |
| Setting | Default for GitLab.com |
|----------------------|-------------------------|
| Webhook rate limit | `120` calls per minute for GitLab Free, unlimited for GitLab Premium and GitLab Ultimate |
| Number of webhooks | `100` per project, `50` per group |
| Maximum payload size | 25 MB |
For self-managed instance limits, see
[Webhook rate limit](../../administration/instance_limits.md#webhook-rate-limit)
and [Number of webhooks](../../administration/instance_limits.md#number-of-webhooks).
## Runner SaaS

View file

@ -40,7 +40,7 @@ describe('RunnerTypeCell', () => {
const findDeleteBtn = () => wrapper.findByTestId('delete-runner');
const getTooltip = (w) => getBinding(w.element, 'gl-tooltip')?.value;
const createComponent = ({ active = true } = {}, options) => {
const createComponent = (runner = {}, options) => {
wrapper = extendedWrapper(
shallowMount(RunnerActionCell, {
propsData: {
@ -48,7 +48,9 @@ describe('RunnerTypeCell', () => {
id: mockRunner.id,
shortSha: mockRunner.shortSha,
adminUrl: mockRunner.adminUrl,
active,
userPermissions: mockRunner.userPermissions,
active: mockRunner.active,
...runner,
},
},
localVue,
@ -103,6 +105,25 @@ describe('RunnerTypeCell', () => {
expect(findEditBtn().attributes('href')).toBe(mockRunner.adminUrl);
});
it('Does not render the runner edit link when user cannot update', () => {
createComponent({
userPermissions: {
...mockRunner.userPermissions,
updateRunner: false,
},
});
expect(findEditBtn().exists()).toBe(false);
});
it('Does not render the runner edit link when adminUrl is not provided', () => {
createComponent({
adminUrl: null,
});
expect(findEditBtn().exists()).toBe(false);
});
});
describe('Toggle active action', () => {
@ -213,6 +234,17 @@ describe('RunnerTypeCell', () => {
});
});
});
it('Does not render the runner toggle active button when user cannot update', () => {
createComponent({
userPermissions: {
...mockRunner.userPermissions,
updateRunner: false,
},
});
expect(findToggleActiveBtn().exists()).toBe(false);
});
});
describe('Delete action', () => {
@ -225,6 +257,10 @@ describe('RunnerTypeCell', () => {
);
});
it('Renders delete button', () => {
expect(findDeleteBtn().exists()).toBe(true);
});
it('Delete button opens delete modal', () => {
const modalId = getBinding(findDeleteBtn().element, 'gl-modal').value;
@ -259,6 +295,18 @@ describe('RunnerTypeCell', () => {
});
});
it('Does not render the runner delete button when user cannot delete', () => {
createComponent({
userPermissions: {
...mockRunner.userPermissions,
deleteRunner: false,
},
});
expect(findDeleteBtn().exists()).toBe(false);
expect(findRunnerDeleteModal().exists()).toBe(false);
});
describe('When delete is clicked', () => {
beforeEach(() => {
findRunnerDeleteModal().vm.$emit('primary');