summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-16 09:09:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-16 09:09:28 +0000
commit9c7b3812a22465b77ee24657ad1b446b81ffbc74 (patch)
tree7185947a0d6528af2779209a62cafc17f1a8a243
parent000087abd5a11442a7e34b0e5f3bf86cb40fa8e4 (diff)
downloadgitlab-ce-9c7b3812a22465b77ee24657ad1b446b81ffbc74.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue5
-rw-r--r--app/assets/javascripts/api.js29
-rw-r--r--app/assets/javascripts/registry/settings/components/settings_form.vue8
-rw-r--r--app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue6
-rw-r--r--changelogs/unreleased/migration-confirm-project-bot-users.yml5
-rw-r--r--db/post_migrate/20200713071042_confirm_project_bot_users.rb30
-rw-r--r--db/structure.sql1
-rw-r--r--doc/ci/README.md3
-rw-r--r--doc/ci/examples/README.md1
-rw-r--r--doc/ci/introduction/index.md3
-rw-r--r--doc/ci/junit_test_reports.md2
-rw-r--r--doc/topics/autodevops/stages.md22
-rw-r--r--doc/user/admin_area/settings/index.md1
-rw-r--r--doc/user/project/merge_requests/code_quality.md3
-rw-r--r--doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md3
-rw-r--r--doc/user/project/repository/branches/index.md50
-rw-r--r--package.json2
-rw-r--r--spec/frontend/alert_settings/alert_settings_form_spec.js1
-rw-r--r--spec/frontend/api_spec.js71
-rw-r--r--spec/frontend/jira_import/components/__snapshots__/jira_import_form_spec.js.snap38
-rw-r--r--spec/frontend/registry/shared/components/__snapshots__/expiration_policy_fields_spec.js.snap6
-rw-r--r--spec/migrations/confirm_project_bot_users_spec.rb84
-rw-r--r--yarn.lock8
23 files changed, 319 insertions, 63 deletions
diff --git a/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue b/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
index 6d1fc29ff84..6e7da070bbc 100644
--- a/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
+++ b/app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
@@ -203,8 +203,7 @@ export default {
}
return { ...el, disabled: false };
});
- const [selected] = this.options;
- this.selectedEndpoint = selected.value;
+ this.selectedEndpoint = this.options.find(({ value }) => value === 'opsgenie').value;
if (this.targetUrl === null) {
this.targetUrl = this.selectedService.targetUrl;
}
@@ -497,7 +496,7 @@ export default {
>
<template #append>
<clipboard-button
- :text="selectedService.authKey"
+ :text="selectedService.authKey || ''"
:title="$options.i18n.copyToClipboard"
class="gl-m-0!"
/>
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js
index d1cbd79994b..c84e73ccdb4 100644
--- a/app/assets/javascripts/api.js
+++ b/app/assets/javascripts/api.js
@@ -11,6 +11,9 @@ const Api = {
groupMembersPath: '/api/:version/groups/:id/members',
subgroupsPath: '/api/:version/groups/:id/subgroups',
namespacesPath: '/api/:version/namespaces.json',
+ groupPackagesPath: '/api/:version/groups/:id/packages',
+ projectPackagesPath: '/api/:version/projects/:id/packages',
+ projectPackagePath: '/api/:version/projects/:id/packages/:package_id',
groupProjectsPath: '/api/:version/groups/:id/projects.json',
projectsPath: '/api/:version/projects.json',
projectPath: '/api/:version/projects/:id',
@@ -66,6 +69,32 @@ const Api = {
});
},
+ groupPackages(id, options = {}) {
+ const url = Api.buildUrl(this.groupPackagesPath).replace(':id', id);
+ return axios.get(url, options);
+ },
+
+ projectPackages(id, options = {}) {
+ const url = Api.buildUrl(this.projectPackagesPath).replace(':id', id);
+ return axios.get(url, options);
+ },
+
+ buildProjectPackageUrl(projectId, packageId) {
+ return Api.buildUrl(this.projectPackagePath)
+ .replace(':id', projectId)
+ .replace(':package_id', packageId);
+ },
+
+ projectPackage(projectId, packageId) {
+ const url = this.buildProjectPackageUrl(projectId, packageId);
+ return axios.get(url);
+ },
+
+ deleteProjectPackage(projectId, packageId) {
+ const url = this.buildProjectPackageUrl(projectId, packageId);
+ return axios.delete(url);
+ },
+
groupMembers(id, options) {
const url = Api.buildUrl(this.groupMembersPath).replace(':id', encodeURIComponent(id));
diff --git a/app/assets/javascripts/registry/settings/components/settings_form.vue b/app/assets/javascripts/registry/settings/components/settings_form.vue
index 6a41e162af9..f129922c1d2 100644
--- a/app/assets/javascripts/registry/settings/components/settings_form.vue
+++ b/app/assets/javascripts/registry/settings/components/settings_form.vue
@@ -103,11 +103,11 @@ export default {
/>
</template>
<template #footer>
- <div class="d-flex justify-content-end">
+ <div class="gl-display-flex gl-justify-content-end">
<gl-deprecated-button
ref="cancel-button"
type="reset"
- class="mr-2 d-block"
+ class="gl-mr-3 gl-display-block"
:disabled="isCancelButtonDisabled"
>
{{ __('Cancel') }}
@@ -117,10 +117,10 @@ export default {
type="submit"
:disabled="isSubmitButtonDisabled"
variant="success"
- class="d-flex justify-content-center align-items-center js-no-auto-disable"
+ class="gl-display-flex gl-justify-content-center gl-align-items-center js-no-auto-disable"
>
{{ $options.i18n.SET_CLEANUP_POLICY_BUTTON }}
- <gl-loading-icon v-if="isLoading" class="ml-2" />
+ <gl-loading-icon v-if="isLoading" class="gl-ml-3" />
</gl-deprecated-button>
</div>
</template>
diff --git a/app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue b/app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue
index 54d7d195734..1ff2f6f99e5 100644
--- a/app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue
+++ b/app/assets/javascripts/registry/shared/components/expiration_policy_fields.vue
@@ -177,7 +177,7 @@ export default {
</script>
<template>
- <div ref="form-elements" class="lh-2">
+ <div ref="form-elements" class="gl-line-height-20">
<gl-form-group
:id="idGenerator('expiration-policy-toggle-group')"
:label-cols="labelCols"
@@ -185,13 +185,13 @@ export default {
:label-for="idGenerator('expiration-policy-toggle')"
:label="$options.i18n.ENABLE_TOGGLE_LABEL"
>
- <div class="d-flex align-items-start">
+ <div class="gl-display-flex">
<gl-toggle
:id="idGenerator('expiration-policy-toggle')"
v-model="enabled"
:disabled="isLoading"
/>
- <span class="mb-2 ml-2 lh-2">
+ <span class="gl-mb-3 gl-ml-3 gl-line-height-20">
<gl-sprintf :message="$options.i18n.ENABLE_TOGGLE_DESCRIPTION">
<template #toggleStatus>
<strong>{{ policyEnabledText }}</strong>
diff --git a/changelogs/unreleased/migration-confirm-project-bot-users.yml b/changelogs/unreleased/migration-confirm-project-bot-users.yml
new file mode 100644
index 00000000000..6e29aa5e162
--- /dev/null
+++ b/changelogs/unreleased/migration-confirm-project-bot-users.yml
@@ -0,0 +1,5 @@
+---
+title: Mark existing Project Bot Users as confirmed
+merge_request: 36692
+author:
+type: fixed
diff --git a/db/post_migrate/20200713071042_confirm_project_bot_users.rb b/db/post_migrate/20200713071042_confirm_project_bot_users.rb
new file mode 100644
index 00000000000..0578fc42ef2
--- /dev/null
+++ b/db/post_migrate/20200713071042_confirm_project_bot_users.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class ConfirmProjectBotUsers < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ class User < ApplicationRecord
+ self.table_name = 'users'
+
+ include ::EachBatch
+
+ USER_TYPE_PROJECT_BOT = 6
+
+ scope :project_bots, -> { where(user_type: USER_TYPE_PROJECT_BOT) }
+ scope :unconfirmed, -> { where(confirmed_at: nil) }
+ end
+
+ def up
+ User.reset_column_information
+
+ User.project_bots.unconfirmed.each_batch do |relation|
+ relation.update_all('confirmed_at = created_at')
+ end
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/structure.sql b/db/structure.sql
index a7556b6a3c5..2e9127d68a7 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -23772,5 +23772,6 @@ COPY "schema_migrations" (version) FROM STDIN;
20200710102846
20200710105332
20200710130234
+20200713071042
\.
diff --git a/doc/ci/README.md b/doc/ci/README.md
index 724f71da118..5ac087a0aa4 100644
--- a/doc/ci/README.md
+++ b/doc/ci/README.md
@@ -126,7 +126,8 @@ Its feature set is listed on the table below according to DevOps stages.
| [ChatOps](chatops/README.md) | Trigger CI jobs from chat, with results sent back to the channel. |
|---+---|
| **Verify** ||
-| [Browser Performance Testing](../user/project/merge_requests/browser_performance_testing.md) | Quickly determine the performance impact of pending code changes. |
+| [Browser Performance Testing](../user/project/merge_requests/browser_performance_testing.md) | Quickly determine the browser performance impact of pending code changes. |
+| [Load Performance Testing](../user/project/merge_requests/load_performance_testing.md) | Quickly determine the server performance impact of pending code changes. |
| [CI services](services/README.md) | Link Docker containers with your base image.|
| [Code Quality](../user/project/merge_requests/code_quality.md) **(STARTER)** | Analyze your source code quality. |
| [GitLab CI/CD for external repositories](ci_cd_for_external_repos/index.md) **(PREMIUM)** | Get the benefits of GitLab CI/CD combined with repositories in GitHub and Bitbucket Cloud. |
diff --git a/doc/ci/examples/README.md b/doc/ci/examples/README.md
index 7213151dcd8..37ccef10567 100644
--- a/doc/ci/examples/README.md
+++ b/doc/ci/examples/README.md
@@ -25,6 +25,7 @@ The following table lists examples with step-by-step tutorials that are containe
| Use case | Resource |
|:------------------------------|:---------------------------------------------------------------------------------------------------------------------------|
| Browser performance testing | [Browser Performance Testing with the Sitespeed.io container](../../user/project/merge_requests/browser_performance_testing.md). |
+| Load performance testing | [Load Performance Testing with the k6 container](../../user/project/merge_requests/load_performance_testing.md). |
| Clojure | [Test a Clojure application with GitLab CI/CD](test-clojure-application.md). |
| Deployment with Dpl | [Using `dpl` as deployment tool](deployment/README.md). |
| Elixir | [Testing a Phoenix application with GitLab CI/CD](test_phoenix_app_with_gitlab_ci_cd/index.md). |
diff --git a/doc/ci/introduction/index.md b/doc/ci/introduction/index.md
index 1836c2a4112..3931d89e7c2 100644
--- a/doc/ci/introduction/index.md
+++ b/doc/ci/introduction/index.md
@@ -189,7 +189,8 @@ according to each stage (Verify, Package, Release).
1. **Verify**:
- Automatically build and test your application with Continuous Integration.
- Analyze your source code quality with [GitLab Code Quality](../../user/project/merge_requests/code_quality.md). **(STARTER)**
- - Determine the performance impact of code changes with [Browser Performance Testing](../../user/project/merge_requests/browser_performance_testing.md). **(PREMIUM)**
+ - Determine the browser performance impact of code changes with [Browser Performance Testing](../../user/project/merge_requests/browser_performance_testing.md). **(PREMIUM)**
+ - Determine the server performance impact of code changes with [Load Performance Testing](../../user/project/merge_requests/load_performance_testing.md). **(PREMIUM)**
- Perform a series of tests, such as [Container Scanning](../../user/application_security/container_scanning/index.md) **(ULTIMATE)**, [Dependency Scanning](../../user/application_security/dependency_scanning/index.md) **(ULTIMATE)**, and [JUnit tests](../junit_test_reports.md).
- Deploy your changes with [Review Apps](../review_apps/index.md) to preview the app changes on every branch.
1. **Package**:
diff --git a/doc/ci/junit_test_reports.md b/doc/ci/junit_test_reports.md
index 39a20254f51..aedda3c8341 100644
--- a/doc/ci/junit_test_reports.md
+++ b/doc/ci/junit_test_reports.md
@@ -264,7 +264,7 @@ following command:
```ruby
Feature.enable(:junit_pipeline_view)
-# Enable the feature for a specific project
+# Enable the feature for a specific project, GitLab 13.0 and above only.
Feature.enable(:junit_pipeline_view, Project.find(<your-project-id-here>))
```
diff --git a/doc/topics/autodevops/stages.md b/doc/topics/autodevops/stages.md
index ae2be21ddc9..c724a58b31d 100644
--- a/doc/topics/autodevops/stages.md
+++ b/doc/topics/autodevops/stages.md
@@ -295,7 +295,8 @@ You can disable DAST:
> Introduced in [GitLab Premium](https://about.gitlab.com/pricing/) 10.4.
-Auto Browser Performance Testing measures the performance of a web page with the
+Auto [Browser Performance Testing](../../user/project/merge_requests/browser_performance_testing.md)
+measures the browser performance of a web page with the
[Sitespeed.io container](https://hub.docker.com/r/sitespeedio/sitespeed.io/),
creates a JSON report including the overall performance score for each page, and
uploads the report as an artifact. By default, it tests the root page of your Review and
@@ -308,9 +309,26 @@ file named `.gitlab-urls.txt` in the root directory, one file per line. For exam
/direction
```
-Any performance differences between the source and target branches are also
+Any browser performance differences between the source and target branches are also
[shown in the merge request widget](../../user/project/merge_requests/browser_performance_testing.md).
+## Auto Load Performance Testing **(PREMIUM)**
+
+> Introduced in [GitLab Premium](https://about.gitlab.com/pricing/) 13.2.
+
+Auto [Load Performance Testing](../../user/project/merge_requests/load_performance_testing.md)
+measures the server performance of an application with the
+[k6 container](https://hub.docker.com/r/loadimpact/k6/),
+creates a JSON report including several key result metrics, and
+uploads the report as an artifact.
+
+Some initial setup is required. A [k6](https://k6.io/) test needs to be
+written that's tailored to your specific application. The test also needs to be
+configured so it can pick up the environment's dynamic URL via an environment variable.
+
+Any load performance test result differences between the source and target branches are also
+[shown in the merge request widget](../../user/project/merge_requests/load_performance_testing.md).
+
## Auto Deploy
This is an optional step, since many projects don't have a Kubernetes cluster
diff --git a/doc/user/admin_area/settings/index.md b/doc/user/admin_area/settings/index.md
index df087722fcf..8c1e82f838b 100644
--- a/doc/user/admin_area/settings/index.md
+++ b/doc/user/admin_area/settings/index.md
@@ -43,6 +43,7 @@ Access the default page for admin area settings by navigating to
| Option | Description |
| ------ | ----------- |
+| [Repository's custom initial branch name](../../project/repository/branches/index.md#custom-initial-branch-name-core-only) | Set a custom branch name rather than master for all the new repositories created within your instance. |
| [Repository mirror](visibility_and_access_controls.md#allow-mirrors-to-be-set-up-for-projects) | Configure repository mirroring. |
| [Repository storage](../../../administration/repository_storage_types.md) | Configure storage path settings. |
| Repository maintenance | ([Repository checks](../../../administration/repository_checks.md) and [Housekeeping](../../../administration/housekeeping.md)). Configure automatic Git checks and housekeeping on repositories. |
diff --git a/doc/user/project/merge_requests/code_quality.md b/doc/user/project/merge_requests/code_quality.md
index 99ad8c7ae45..1d360728c54 100644
--- a/doc/user/project/merge_requests/code_quality.md
+++ b/doc/user/project/merge_requests/code_quality.md
@@ -26,7 +26,7 @@ Code Quality:
- Can be extended through [Analysis Plugins](https://docs.codeclimate.com/docs/list-of-engines) or a [custom tool](#implementing-a-custom-tool).
Going a step further, GitLab can show the Code Quality report right
-in the merge request widget area:
+in the merge request widget area if a report from the target branch is available to compare to:
![Code Quality Widget](img/code_quality.png)
@@ -333,6 +333,7 @@ This can be due to multiple reasons:
- You just added the Code Quality job in your `.gitlab-ci.yml`. The report does not
have anything to compare to yet, so no information can be displayed. Future merge
requests will have something to compare to.
+- Your pipeline is not set to run the code quality job on your default branch. If there is no report generated from the default branch, your MR branch reports will not have anything to compare to.
- If no [degradation or error is detected](https://docs.codeclimate.com/docs/maintainability#section-checks),
nothing will be displayed.
- The [`artifacts:expire_in`](../../../ci/yaml/README.md#artifactsexpire_in) CI/CD
diff --git a/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md b/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md
index 5e84e37e225..ab404d8d8a5 100644
--- a/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md
+++ b/doc/user/project/merge_requests/testing_and_reports_in_merge_requests.md
@@ -14,7 +14,8 @@ or link to useful information directly from merge requests:
| Feature | Description |
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Accessibility Testing](accessibility_testing.md) | Automatically report A11y violations for changed pages in merge requests. |
-| [Browser Performance Testing](browser_performance_testing.md) **(PREMIUM)** | Quickly determine the performance impact of pending code changes. |
+| [Browser Performance Testing](browser_performance_testing.md) **(PREMIUM)** | Quickly determine the browser performance impact of pending code changes. |
+| [Load Performance Testing](load_performance_testing.md) **(PREMIUM)** | Quickly determine the server performance impact of pending code changes. |
| [Code Quality](code_quality.md) **(STARTER)** | Analyze your source code quality using the [Code Climate](https://codeclimate.com/) analyzer and show the Code Climate report right in the merge request widget area. |
| [Display arbitrary job artifacts](../../../ci/yaml/README.md#artifactsexpose_as) | Configure CI pipelines with the `artifacts:expose_as` parameter to directly link to selected [artifacts](../../../ci/pipelines/job_artifacts.md) in merge requests. |
| [GitLab CI/CD](../../../ci/README.md) | Build, test, and deploy your code in a per-branch basis with built-in CI/CD. |
diff --git a/doc/user/project/repository/branches/index.md b/doc/user/project/repository/branches/index.md
index 5fc6aa184bd..f94ca7ac106 100644
--- a/doc/user/project/repository/branches/index.md
+++ b/doc/user/project/repository/branches/index.md
@@ -41,17 +41,51 @@ See also:
## Default branch
When you create a new [project](../../index.md), GitLab sets `master` as the default
-branch for your project. You can choose another branch to be your project's
+branch of the repository. You can choose another branch to be your project's
default under your project's **Settings > Repository**.
-The default branch is the branch affected by the
-[issue closing pattern](../../issues/managing_issues.md#closing-issues-automatically),
-which means that _an issue will be closed when a merge request is merged to
-the **default branch**_.
+When closing issues directly from merge requests through the [issue closing pattern](../../issues/managing_issues.md#closing-issues-automatically),
+the target is the project's **default branch**.
-The default branch is also protected against accidental deletion. Read through
-the documentation on [protected branches](../../protected_branches.md#protected-branches)
-to learn more.
+The default branch is also initially [protected](../../protected_branches.md#protected-branches)
+against accidental deletion and forced pushes.
+
+### Custom initial branch name **(CORE ONLY)**
+
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/221013) in GitLab 13.2.
+> - It's deployed behind a feature flag, enabled by default.
+> - It's enabled on GitLab.com.
+> - It cannot be enabled or disabled per-project.
+> - It's recommended for production use.
+> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-custom-initial-branch-name-core-only). **(CORE ONLY)**
+
+By default, when you create a new project in GitLab, the initial branch is called `master`.
+For self-managed instances, a GitLab administrator can customize the initial branch name to something
+else. This way, every new project created from then on will start from the custom branch name rather than `master`. To do so:
+
+1. Go to the **{admin}** **Admin Area > Settings > Repository** and expand **Default initial
+ branch name**.
+1. Change the default initial branch to a custom name of your choice.
+1. **Save Changes**.
+
+#### Enable or disable custom initial branch name **(CORE ONLY)**
+
+Setting the default initial branch name is under development but ready for production use.
+It is deployed behind a feature flag that is **enabled by default**.
+[GitLab administrators with access to the GitLab Rails console](../../../../administration/feature_flags.md)
+can opt to disable it for your instance.
+
+To disable it:
+
+```ruby
+Feature.disable(:global_default_branch_name)
+```
+
+To enable it:
+
+```ruby
+Feature.enable(:global_default_branch_name)
+```
## Compare
diff --git a/package.json b/package.json
index c8d5a2ed1d2..68cc4b96e25 100644
--- a/package.json
+++ b/package.json
@@ -43,7 +43,7 @@
"@babel/preset-env": "^7.10.1",
"@gitlab/at.js": "1.5.5",
"@gitlab/svgs": "1.152.0",
- "@gitlab/ui": "17.26.0",
+ "@gitlab/ui": "17.29.0",
"@gitlab/visual-review-tools": "1.6.1",
"@rails/actioncable": "^6.0.3-1",
"@sentry/browser": "^5.10.2",
diff --git a/spec/frontend/alert_settings/alert_settings_form_spec.js b/spec/frontend/alert_settings/alert_settings_form_spec.js
index e45c05032ca..1e730554bbb 100644
--- a/spec/frontend/alert_settings/alert_settings_form_spec.js
+++ b/spec/frontend/alert_settings/alert_settings_form_spec.js
@@ -177,6 +177,7 @@ describe('AlertsSettingsForm', () => {
it('shows a input for the opsgenie target URL', () => {
expect(findApiUrl().exists()).toBe(true);
+ expect(findSelect().attributes('value')).toBe('opsgenie');
});
});
diff --git a/spec/frontend/api_spec.js b/spec/frontend/api_spec.js
index 9536dd83afb..c94637e04af 100644
--- a/spec/frontend/api_spec.js
+++ b/spec/frontend/api_spec.js
@@ -46,6 +46,77 @@ describe('Api', () => {
});
});
+ describe('packages', () => {
+ const projectId = 'project_a';
+ const packageId = 'package_b';
+ const apiResponse = [{ id: 1, name: 'foo' }];
+
+ describe('groupPackages', () => {
+ const groupId = 'group_a';
+
+ it('fetch all group packages', () => {
+ const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/groups/${groupId}/packages`;
+ jest.spyOn(axios, 'get');
+ mock.onGet(expectedUrl).replyOnce(200, apiResponse);
+
+ return Api.groupPackages(groupId).then(({ data }) => {
+ expect(data).toEqual(apiResponse);
+ expect(axios.get).toHaveBeenCalledWith(expectedUrl, {});
+ });
+ });
+ });
+
+ describe('projectPackages', () => {
+ it('fetch all project packages', () => {
+ const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectId}/packages`;
+ jest.spyOn(axios, 'get');
+ mock.onGet(expectedUrl).replyOnce(200, apiResponse);
+
+ return Api.projectPackages(projectId).then(({ data }) => {
+ expect(data).toEqual(apiResponse);
+ expect(axios.get).toHaveBeenCalledWith(expectedUrl, {});
+ });
+ });
+ });
+
+ describe('buildProjectPackageUrl', () => {
+ it('returns the right url', () => {
+ const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/projects/${projectId}/packages/${packageId}`;
+ const url = Api.buildProjectPackageUrl(projectId, packageId);
+ expect(url).toEqual(expectedUrl);
+ });
+ });
+
+ describe('projectPackage', () => {
+ it('fetch package details', () => {
+ const expectedUrl = `foo`;
+ jest.spyOn(Api, 'buildProjectPackageUrl').mockReturnValue(expectedUrl);
+ jest.spyOn(axios, 'get');
+ mock.onGet(expectedUrl).replyOnce(200, apiResponse);
+
+ return Api.projectPackage(projectId, packageId).then(({ data }) => {
+ expect(data).toEqual(apiResponse);
+ expect(axios.get).toHaveBeenCalledWith(expectedUrl);
+ });
+ });
+ });
+
+ describe('deleteProjectPackage', () => {
+ it('delete a package', () => {
+ const expectedUrl = `foo`;
+
+ jest.spyOn(Api, 'buildProjectPackageUrl').mockReturnValue(expectedUrl);
+ jest.spyOn(axios, 'delete');
+ mock.onDelete(expectedUrl).replyOnce(200, true);
+
+ return Api.deleteProjectPackage(projectId, packageId).then(({ data }) => {
+ expect(data).toEqual(true);
+ expect(axios.delete).toHaveBeenCalledWith(expectedUrl);
+ });
+ });
+ });
+ });
+
describe('group', () => {
it('fetches a group', done => {
const groupId = '123456';
diff --git a/spec/frontend/jira_import/components/__snapshots__/jira_import_form_spec.js.snap b/spec/frontend/jira_import/components/__snapshots__/jira_import_form_spec.js.snap
index edd3ca1ced2..975c31bb59c 100644
--- a/spec/frontend/jira_import/components/__snapshots__/jira_import_form_spec.js.snap
+++ b/spec/frontend/jira_import/components/__snapshots__/jira_import_form_spec.js.snap
@@ -66,6 +66,7 @@ exports[`JiraImportForm table body shows correct information in each cell 1`] =
<svg
aria-label="Will be mapped to"
class="gl-icon s16"
+ data-testid="arrow-right-icon"
>
<use
href="#arrow-right"
@@ -98,6 +99,7 @@ exports[`JiraImportForm table body shows correct information in each cell 1`] =
<svg
class="dropdown-chevron gl-icon s16"
+ data-testid="chevron-down-icon"
>
<use
href="#chevron-down"
@@ -116,6 +118,7 @@ exports[`JiraImportForm table body shows correct information in each cell 1`] =
>
<svg
class="gl-search-box-by-type-search-icon gl-icon s16"
+ data-testid="search-icon"
>
<use
href="#search"
@@ -134,21 +137,7 @@ exports[`JiraImportForm table body shows correct information in each cell 1`] =
>
<!---->
- <button
- aria-hidden="true"
- class="gl-clear-icon-button gl-search-box-by-type-clear gl-clear-icon-button"
- name="clear"
- style="display: none;"
- title="Clear"
- >
- <svg
- class="gl-icon s16"
- >
- <use
- href="#clear"
- />
- </svg>
- </button>
+ <!---->
</div>
</div>
@@ -188,6 +177,7 @@ exports[`JiraImportForm table body shows correct information in each cell 1`] =
<svg
aria-label="Will be mapped to"
class="gl-icon s16"
+ data-testid="arrow-right-icon"
>
<use
href="#arrow-right"
@@ -220,6 +210,7 @@ exports[`JiraImportForm table body shows correct information in each cell 1`] =
<svg
class="dropdown-chevron gl-icon s16"
+ data-testid="chevron-down-icon"
>
<use
href="#chevron-down"
@@ -238,6 +229,7 @@ exports[`JiraImportForm table body shows correct information in each cell 1`] =
>
<svg
class="gl-search-box-by-type-search-icon gl-icon s16"
+ data-testid="search-icon"
>
<use
href="#search"
@@ -256,21 +248,7 @@ exports[`JiraImportForm table body shows correct information in each cell 1`] =
>
<!---->
- <button
- aria-hidden="true"
- class="gl-clear-icon-button gl-search-box-by-type-clear gl-clear-icon-button"
- name="clear"
- style="display: none;"
- title="Clear"
- >
- <svg
- class="gl-icon s16"
- >
- <use
- href="#clear"
- />
- </svg>
- </button>
+ <!---->
</div>
</div>
diff --git a/spec/frontend/registry/shared/components/__snapshots__/expiration_policy_fields_spec.js.snap b/spec/frontend/registry/shared/components/__snapshots__/expiration_policy_fields_spec.js.snap
index 882f1b3211a..69953fb5e03 100644
--- a/spec/frontend/registry/shared/components/__snapshots__/expiration_policy_fields_spec.js.snap
+++ b/spec/frontend/registry/shared/components/__snapshots__/expiration_policy_fields_spec.js.snap
@@ -2,7 +2,7 @@
exports[`Expiration Policy Form renders 1`] = `
<div
- class="lh-2"
+ class="gl-line-height-20"
>
<gl-form-group-stub
id="expiration-policy-toggle-group"
@@ -12,7 +12,7 @@ exports[`Expiration Policy Form renders 1`] = `
label-for="expiration-policy-toggle"
>
<div
- class="d-flex align-items-start"
+ class="gl-display-flex"
>
<gl-toggle-stub
id="expiration-policy-toggle"
@@ -20,7 +20,7 @@ exports[`Expiration Policy Form renders 1`] = `
/>
<span
- class="mb-2 ml-2 lh-2"
+ class="gl-mb-3 gl-ml-3 gl-line-height-20"
>
<strong>
Disabled
diff --git a/spec/migrations/confirm_project_bot_users_spec.rb b/spec/migrations/confirm_project_bot_users_spec.rb
new file mode 100644
index 00000000000..11aa08d16a9
--- /dev/null
+++ b/spec/migrations/confirm_project_bot_users_spec.rb
@@ -0,0 +1,84 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require Rails.root.join('db', 'post_migrate', '20200713071042_confirm_project_bot_users.rb')
+
+RSpec.describe ConfirmProjectBotUsers, :migration do
+ let(:users) { table(:users) }
+
+ context 'project bot users that are currently unconfirmed' do
+ let!(:project_bot_1) do
+ create_user!(
+ name: 'bot_1',
+ email: 'bot_1@example.com',
+ created_at: 2.days.ago,
+ user_type: described_class::User::USER_TYPE_PROJECT_BOT
+ )
+ end
+
+ let!(:project_bot_2) do
+ create_user!(
+ name: 'bot_2',
+ email: 'bot_2@example.com',
+ created_at: 4.days.ago,
+ user_type: described_class::User::USER_TYPE_PROJECT_BOT
+ )
+ end
+
+ it 'updates their `confirmed_at` attribute' do
+ expect { migrate! }
+ .to change { project_bot_1.reload.confirmed_at }
+ .and change { project_bot_2.reload.confirmed_at }
+ end
+
+ it 'sets `confirmed_at` to be the same as their `created_at` attribute' do
+ migrate!
+
+ [project_bot_1, project_bot_2].each do |bot|
+ expect(bot.reload.confirmed_at).to eq(bot.created_at)
+ end
+ end
+ end
+
+ context 'project bot users that are currently confirmed' do
+ let!(:confirmed_project_bot) do
+ create_user!(
+ name: 'bot_1',
+ email: 'bot_1@example.com',
+ user_type: described_class::User::USER_TYPE_PROJECT_BOT,
+ confirmed_at: 1.day.ago
+ )
+ end
+
+ it 'does not update their `confirmed_at` attribute' do
+ expect { migrate! }.not_to change { confirmed_project_bot.reload.confirmed_at }
+ end
+ end
+
+ context 'human users that are currently unconfirmed' do
+ let!(:unconfirmed_human) do
+ create_user!(
+ name: 'human',
+ email: 'human@example.com',
+ user_type: nil
+ )
+ end
+
+ it 'does not update their `confirmed_at` attribute' do
+ expect { migrate! }.not_to change { unconfirmed_human.reload.confirmed_at }
+ end
+ end
+
+ private
+
+ def create_user!(name:, email:, user_type:, created_at: Time.now, confirmed_at: nil)
+ users.create!(
+ name: name,
+ email: email,
+ username: name,
+ projects_limit: 0,
+ user_type: user_type,
+ confirmed_at: confirmed_at
+ )
+ end
+end
diff --git a/yarn.lock b/yarn.lock
index b0f9250928a..edd56a9ace1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -848,10 +848,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.152.0.tgz#663c9a5f073f59b66f4241ef2d3fea2205846905"
integrity sha512-daZHOBVAwjsU6n60IycanoO/JymfQ36vrr46OUdWjHdp0ATYrgh+01LcxiSNLdlyndIRqHWGtwmuilokM9q6Vg==
-"@gitlab/ui@17.26.0":
- version "17.26.0"
- resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-17.26.0.tgz#d8efad47c3f4dc32e0586f3f5e4e2e3e0c2babf6"
- integrity sha512-0QgzMK8MFGaqBB8yYntjYjUnzKFQ9a8d4mjufIyeKq6WomuMYHTFJgUj0+cEQ6uuTRtNk3MMuy3ZHBJg1wGzTw==
+"@gitlab/ui@17.29.0":
+ version "17.29.0"
+ resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-17.29.0.tgz#74fbe7e7675455297d9928bd84a0810be19a4bb6"
+ integrity sha512-526AcBt2kOmx+c9WgVbOxqi1xc08zIa6AkyAf+4VIG3IM3hjBNjPV932goBlWY9iQJq7FN8YFocePJmt4e+lUA==
dependencies:
"@babel/standalone" "^7.0.0"
"@gitlab/vue-toasted" "^1.3.0"