Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
8c438dd7a6
commit
41aebff8ec
|
@ -801,7 +801,7 @@ export default class FilteredSearchManager {
|
|||
paths.push(`search=${sanitized}`);
|
||||
}
|
||||
|
||||
let parameterizedUrl = `?scope=all&utf8=%E2%9C%93&${paths.join('&')}`;
|
||||
let parameterizedUrl = `?scope=all&${paths.join('&')}`;
|
||||
|
||||
if (this.anchor) {
|
||||
parameterizedUrl += `#${this.anchor}`;
|
||||
|
|
|
@ -10,6 +10,7 @@ import {
|
|||
GlIcon,
|
||||
GlEmptyState,
|
||||
} from '@gitlab/ui';
|
||||
import { isValidSlaDueAt } from 'ee_else_ce/vue_shared/components/incidents/utils';
|
||||
import { visitUrl, mergeUrlParams, joinPaths } from '~/lib/utils/url_utility';
|
||||
import { s__ } from '~/locale';
|
||||
import { INCIDENT_SEVERITY } from '~/sidebar/components/severity/constants';
|
||||
|
@ -287,6 +288,7 @@ export default {
|
|||
errorAlertDismissed() {
|
||||
this.isErrorAlertDismissed = true;
|
||||
},
|
||||
isValidSlaDueAt,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -367,7 +369,13 @@ export default {
|
|||
</template>
|
||||
|
||||
<template v-if="slaFeatureAvailable" #cell(incidentSla)="{ item }">
|
||||
<service-level-agreement-cell :sla-due-at="item.slaDueAt" data-testid="incident-sla" />
|
||||
<service-level-agreement-cell
|
||||
v-if="isValidSlaDueAt(item.slaDueAt)"
|
||||
:issue-iid="item.iid"
|
||||
:project-path="projectPath"
|
||||
:sla-due-at="item.slaDueAt"
|
||||
data-testid="incident-sla"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template #cell(assignees)="{ item }">
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
import Vue from 'vue';
|
||||
import { parseBoolean } from '~/lib/utils/common_utils';
|
||||
import PackagesApp from '~/packages/details/components/app.vue';
|
||||
import createStore from '~/packages/details/store';
|
||||
import Translate from '~/vue_shared/translate';
|
||||
|
||||
Vue.use(Translate);
|
||||
|
||||
export default () => {
|
||||
const el = document.querySelector('#js-vue-packages-detail');
|
||||
const { package: packageJson, canDelete: canDeleteStr, ...rest } = el.dataset;
|
||||
const packageEntity = JSON.parse(packageJson);
|
||||
const canDelete = parseBoolean(canDeleteStr);
|
||||
|
||||
const store = createStore({
|
||||
packageEntity,
|
||||
packageFiles: packageEntity.package_files,
|
||||
canDelete,
|
||||
...rest,
|
||||
});
|
||||
|
||||
return new Vue({
|
||||
el,
|
||||
store,
|
||||
render(createElement) {
|
||||
return createElement(PackagesApp);
|
||||
},
|
||||
});
|
||||
};
|
|
@ -113,7 +113,6 @@ export default {
|
|||
}),
|
||||
visibility: initFormField({
|
||||
value: this.projectVisibility,
|
||||
skipValidation: true,
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
@ -326,7 +325,11 @@ export default {
|
|||
/>
|
||||
</gl-form-group>
|
||||
|
||||
<gl-form-group>
|
||||
<gl-form-group
|
||||
v-validation:[form.showValidation]
|
||||
:invalid-feedback="s__('ForkProject|Please select a visibility level')"
|
||||
:state="form.fields.visibility.state"
|
||||
>
|
||||
<label>
|
||||
{{ s__('ForkProject|Visibility level') }}
|
||||
<gl-link :href="visibilityHelpPath" target="_blank">
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import initDetails from '~/packages_and_registries/infrastructure_registry/details_app_bundle';
|
||||
|
||||
initDetails();
|
|
@ -3,7 +3,6 @@ import { GlModal, GlForm, GlFormCheckbox, GlSprintf, GlFormGroup } from '@gitlab
|
|||
import { mapActions, mapState } from 'vuex';
|
||||
import { BV_SHOW_MODAL } from '~/lib/utils/constants';
|
||||
import csrf from '~/lib/utils/csrf';
|
||||
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
|
||||
import eventHub from '../event_hub';
|
||||
import BranchesDropdown from './branches_dropdown.vue';
|
||||
import ProjectsDropdown from './projects_dropdown.vue';
|
||||
|
@ -18,7 +17,6 @@ export default {
|
|||
GlSprintf,
|
||||
GlFormGroup,
|
||||
},
|
||||
mixins: [glFeatureFlagsMixin()],
|
||||
inject: {
|
||||
prependedText: {
|
||||
default: '',
|
||||
|
@ -116,7 +114,7 @@ export default {
|
|||
<input type="hidden" name="authenticity_token" :value="$options.csrf.token" />
|
||||
|
||||
<gl-form-group
|
||||
v-if="glFeatures.pickIntoProject && isCherryPick"
|
||||
v-if="isCherryPick"
|
||||
:label="i18n.projectLabel"
|
||||
label-for="start_project"
|
||||
data-testid="dropdown-group"
|
||||
|
|
|
@ -48,7 +48,7 @@ const createEventPayload = (el, { suffix = '' } = {}) => {
|
|||
|
||||
const action = (trackAction || trackEvent) + (suffix || '');
|
||||
let value = trackValue || el.value || undefined;
|
||||
if (el.type === 'checkbox' && !el.checked) value = false;
|
||||
if (el.type === 'checkbox' && !el.checked) value = 0;
|
||||
|
||||
let extra = trackExtra;
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import { noop } from 'lodash';
|
||||
|
||||
export const isValidSlaDueAt = noop;
|
|
@ -18,7 +18,7 @@ module CreatesCommit
|
|||
|
||||
@start_branch ||= @ref || @branch_name
|
||||
|
||||
start_project = Feature.enabled?(:pick_into_project, @project, default_enabled: :yaml) ? @project_to_commit_into : @project
|
||||
start_project = @project_to_commit_into
|
||||
|
||||
commit_params = @commit_params.merge(
|
||||
start_project: start_project,
|
||||
|
|
|
@ -19,9 +19,6 @@ class Projects::CommitController < Projects::ApplicationController
|
|||
before_action :define_commit_box_vars, only: [:show, :pipelines]
|
||||
before_action :define_note_vars, only: [:show, :diff_for_path, :diff_files]
|
||||
before_action :authorize_edit_tree!, only: [:revert, :cherry_pick]
|
||||
before_action do
|
||||
push_frontend_feature_flag(:pick_into_project, @project, default_enabled: :yaml)
|
||||
end
|
||||
|
||||
BRANCH_SEARCH_LIMIT = 1000
|
||||
COMMIT_DIFFS_PER_PAGE = 20
|
||||
|
@ -220,7 +217,6 @@ class Projects::CommitController < Projects::ApplicationController
|
|||
|
||||
def find_cherry_pick_target_project
|
||||
return @project if params[:target_project_id].blank?
|
||||
return @project unless Feature.enabled?(:pick_into_project, @project, default_enabled: :yaml)
|
||||
|
||||
MergeRequestTargetProjectFinder
|
||||
.new(current_user: current_user, source_project: @project, project_feature: :repository)
|
||||
|
|
|
@ -3,7 +3,19 @@
|
|||
module Projects
|
||||
module Packages
|
||||
class InfrastructureRegistryController < Projects::ApplicationController
|
||||
before_action :verify_feature_enabled!
|
||||
feature_category :infrastructure_as_code
|
||||
|
||||
def show
|
||||
@package = project.packages.find(params[:id])
|
||||
@package_files = @package.package_files.recent
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def verify_feature_enabled!
|
||||
render_404 unless Feature.enabled?(:infrastructure_registry_page)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -137,8 +137,6 @@ module CommitsHelper
|
|||
end
|
||||
|
||||
def cherry_pick_projects_data(project)
|
||||
return [] unless Feature.enabled?(:pick_into_project, project, default_enabled: :yaml)
|
||||
|
||||
[project, project.forked_from_project].compact.map do |project|
|
||||
{
|
||||
id: project.id.to_s,
|
||||
|
|
|
@ -116,7 +116,7 @@ module Projects
|
|||
log_destroy_event
|
||||
trash_relation_repositories!
|
||||
trash_project_repositories!
|
||||
destroy_web_hooks! if Feature.enabled?(:destroy_webhooks_before_the_project, project, default_enabled: :yaml)
|
||||
destroy_web_hooks!
|
||||
|
||||
# Rails attempts to load all related records into memory before
|
||||
# destroying: https://github.com/rails/rails/issues/22510
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
- add_to_breadcrumbs _("Infrastructure Registry"), project_packages_path(@project)
|
||||
- add_to_breadcrumbs @package.name, project_packages_path(@project)
|
||||
- breadcrumb_title @package.version
|
||||
- page_title _("Infrastructure Registry")
|
||||
- @content_class = "limit-container-width" unless fluid_layout
|
||||
|
||||
.row
|
||||
.col-12
|
||||
#js-vue-packages-detail{ data: { package: package_from_presenter(@package),
|
||||
can_delete: can?(current_user, :destroy_package, @project).to_s,
|
||||
svg_path: image_path('illustrations/no-packages.svg'),
|
||||
project_name: @project.name,
|
||||
project_list_url: project_infrastructure_registry_index_path(@project)} }
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
name: destroy_webhooks_before_the_project
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59754
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/328393
|
||||
milestone: '13.12'
|
||||
type: development
|
||||
group: group::source code
|
||||
default_enabled: true
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
name: pick_into_project
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55970
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/324154
|
||||
milestone: '13.10'
|
||||
type: development
|
||||
group: group::source code
|
||||
default_enabled: true
|
|
@ -0,0 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# This file was introduced during upgrading Rails from 5.2 to 6.0.
|
||||
# This file can be removed when `config.load_defaults 6.0` is introduced.
|
||||
|
||||
# Don't force requests from old versions of IE to be UTF-8 encoded.
|
||||
Rails.application.config.action_view.default_enforce_utf8 = false
|
|
@ -279,9 +279,13 @@ Rails.application.routes.draw do
|
|||
|
||||
# Issue https://gitlab.com/gitlab-org/gitlab/-/issues/210024
|
||||
scope as: 'deprecated' do
|
||||
draw :snippets
|
||||
# Issue https://gitlab.com/gitlab-org/gitlab/-/issues/223719
|
||||
get '/snippets/:id/raw',
|
||||
to: 'snippets#raw',
|
||||
format: false,
|
||||
constraints: { id: /\d+/ }
|
||||
|
||||
Gitlab::Routing.redirect_legacy_paths(self, :profile)
|
||||
Gitlab::Routing.redirect_legacy_paths(self, :profile, :snippets)
|
||||
end
|
||||
|
||||
Gitlab.ee do
|
||||
|
|
|
@ -50,7 +50,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
|
|||
end
|
||||
end
|
||||
|
||||
resources :infrastructure_registry, only: [:index], module: :packages
|
||||
resources :infrastructure_registry, only: [:index, :show], module: :packages
|
||||
|
||||
resources :jobs, only: [:index, :show], constraints: { id: /\d+/ } do
|
||||
collection do
|
||||
|
@ -567,13 +567,13 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
|
|||
# Issue https://gitlab.com/gitlab-org/gitlab/issues/118849
|
||||
draw :repository
|
||||
|
||||
# Issue https://gitlab.com/gitlab-org/gitlab/-/issues/29572
|
||||
resources :snippets, concerns: :awardable, constraints: { id: /\d+/ } do # rubocop: disable Cop/PutProjectRoutesUnderScope
|
||||
member do
|
||||
get :raw # rubocop:todo Cop/PutProjectRoutesUnderScope
|
||||
post :mark_as_spam # rubocop:todo Cop/PutProjectRoutesUnderScope
|
||||
end
|
||||
end
|
||||
# Issue https://gitlab.com/gitlab-org/gitlab/-/issues/223719
|
||||
# rubocop: disable Cop/PutProjectRoutesUnderScope
|
||||
get '/snippets/:id/raw',
|
||||
to: 'snippets#raw',
|
||||
format: false,
|
||||
constraints: { id: /\d+/ }
|
||||
# rubocop: enable Cop/PutProjectRoutesUnderScope
|
||||
end
|
||||
|
||||
# All new routes should go under /-/ scope.
|
||||
|
@ -589,7 +589,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
|
|||
:tracing,
|
||||
:serverless, :clusters, :audit_events, :wikis, :merge_requests,
|
||||
:vulnerability_feedback, :security, :dependencies, :issues,
|
||||
:pipelines, :pipeline_schedules)
|
||||
:pipelines, :pipeline_schedules, :snippets)
|
||||
end
|
||||
|
||||
# rubocop: disable Cop/PutProjectRoutesUnderScope
|
||||
|
|
|
@ -64,7 +64,7 @@ GET /groups/:id/wikis/:slug
|
|||
| Attribute | Type | Required | Description |
|
||||
| --------- | ------- | -------- | --------------------- |
|
||||
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) |
|
||||
| `slug` | string | yes | The slug (a unique string) of the wiki page |
|
||||
| `slug` | string | yes | URL-encoded slug (a unique string) of the wiki page, such as `dir%2Fpage_name` |
|
||||
|
||||
```shell
|
||||
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/wikis/home"
|
||||
|
@ -127,7 +127,7 @@ PUT /groups/:id/wikis/:slug
|
|||
| `content` | string | yes if `title` is not provided | The content of the wiki page |
|
||||
| `title` | string | yes if `content` is not provided | The title of the wiki page |
|
||||
| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, `asciidoc` and `org` |
|
||||
| `slug` | string | yes | The slug (a unique identifier) of the wiki page |
|
||||
| `slug` | string | yes | URL encoded slug (a unique string) of the wiki page. Ex. dir%2Fpage_name |
|
||||
|
||||
```shell
|
||||
curl --request PUT --data "format=rdoc&content=documentation&title=Docs" \
|
||||
|
@ -157,7 +157,7 @@ DELETE /groups/:id/wikis/:slug
|
|||
| Attribute | Type | Required | Description |
|
||||
| --------- | ------- | -------- | --------------------- |
|
||||
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) |
|
||||
| `slug` | string | yes | The slug (a unique identifier) of the wiki page |
|
||||
| `slug` | string | yes | URL-encoded slug (a unique string) of the wiki page, such as `dir%2Fpage_name` |
|
||||
|
||||
```shell
|
||||
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/wikis/foo"
|
||||
|
|
|
@ -74,10 +74,6 @@ Example response:
|
|||
"key": "OpenJDK",
|
||||
"name": "OpenJDK"
|
||||
},
|
||||
{
|
||||
"key": "OpenJDK-alpine",
|
||||
"name": "OpenJDK-alpine"
|
||||
},
|
||||
{
|
||||
"key": "PHP",
|
||||
"name": "PHP"
|
||||
|
|
|
@ -64,7 +64,7 @@ GET /projects/:id/wikis/:slug
|
|||
| Attribute | Type | Required | Description |
|
||||
| --------- | ------- | -------- | --------------------- |
|
||||
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
|
||||
| `slug` | string | yes | The slug (a unique string) of the wiki page |
|
||||
| `slug` | string | yes | URLencoded slug (a unique string) of the wiki page, such as `dir%2Fpage_name` |
|
||||
|
||||
```shell
|
||||
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/wikis/home"
|
||||
|
@ -125,7 +125,7 @@ PUT /projects/:id/wikis/:slug
|
|||
| `content` | string | yes if `title` is not provided | The content of the wiki page |
|
||||
| `title` | string | yes if `content` is not provided | The title of the wiki page |
|
||||
| `format` | string | no | The format of the wiki page. Available formats are: `markdown` (default), `rdoc`, `asciidoc` and `org` |
|
||||
| `slug` | string | yes | The slug (a unique string) of the wiki page |
|
||||
| `slug` | string | yes | URL-encoded slug (a unique string) of the wiki page, such as `dir%2Fpage_name` |
|
||||
|
||||
```shell
|
||||
curl --request PUT --data "format=rdoc&content=documentation&title=Docs" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/wikis/foo"
|
||||
|
@ -153,7 +153,7 @@ DELETE /projects/:id/wikis/:slug
|
|||
| Attribute | Type | Required | Description |
|
||||
| --------- | ------- | -------- | --------------------- |
|
||||
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) |
|
||||
| `slug` | string | yes | The slug (a unique string) of the wiki page |
|
||||
| `slug` | string | yes | URL-encoded slug (a unique string) of the wiki page, such as `dir%2Fpage_name` |
|
||||
|
||||
```shell
|
||||
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/wikis/foo"
|
||||
|
|
|
@ -63,10 +63,7 @@ git cherry-pick -m 2 7a39eb0
|
|||
### Cherry-pick into a project
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/21268) in GitLab 13.11.
|
||||
> - It's [deployed behind a feature flag](../../feature_flags.md), disabled by default.
|
||||
> - It's disabled on GitLab.com.
|
||||
> - It's not recommended for production use.
|
||||
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-cherry-picking-into-a-project). **(FREE SELF)**
|
||||
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/324154) in GitLab 14.0
|
||||
|
||||
WARNING:
|
||||
This feature might not be available to you. Check the **version history** note above for details.
|
||||
|
@ -81,25 +78,6 @@ merge request is from a fork:
|
|||
1. (Optional) Select **Start a new merge request** if you're ready to create a merge request.
|
||||
1. Click **Cherry-pick**.
|
||||
|
||||
### Enable or disable cherry-picking into a project **(FREE SELF)**
|
||||
|
||||
Cherry-picking into a project is under development and not ready for production use. It is
|
||||
deployed behind a feature flag that is **disabled by default**.
|
||||
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
|
||||
can enable it.
|
||||
|
||||
To enable it:
|
||||
|
||||
```ruby
|
||||
Feature.enable(:pick_into_project)
|
||||
```
|
||||
|
||||
To disable it:
|
||||
|
||||
```ruby
|
||||
Feature.disable(:pick_into_project)
|
||||
```
|
||||
|
||||
## Related links
|
||||
|
||||
- The [Commits API](../../../api/commits.md) enables you to add custom messages
|
||||
|
|
|
@ -14341,6 +14341,9 @@ msgstr ""
|
|||
msgid "ForkProject|Please select a namespace"
|
||||
msgstr ""
|
||||
|
||||
msgid "ForkProject|Please select a visibility level"
|
||||
msgstr ""
|
||||
|
||||
msgid "ForkProject|Private"
|
||||
msgstr ""
|
||||
|
||||
|
@ -15745,13 +15748,16 @@ msgstr ""
|
|||
msgid "GroupActivityMetrics|Issues opened"
|
||||
msgstr ""
|
||||
|
||||
msgid "GroupActivityMetrics|Last 90 days"
|
||||
msgstr ""
|
||||
|
||||
msgid "GroupActivityMetrics|Members added"
|
||||
msgstr ""
|
||||
|
||||
msgid "GroupActivityMetrics|Merge Requests opened"
|
||||
msgstr ""
|
||||
|
||||
msgid "GroupActivityMetrics|Recent activity (last 90 days)"
|
||||
msgid "GroupActivityMetrics|Recent activity"
|
||||
msgstr ""
|
||||
|
||||
msgid "GroupImport|Failed to import group."
|
||||
|
@ -17357,6 +17363,9 @@ msgstr ""
|
|||
msgid "IncidentManagement|%{minutes} minutes remaining"
|
||||
msgstr ""
|
||||
|
||||
msgid "IncidentManagement|Achieved SLA"
|
||||
msgstr ""
|
||||
|
||||
msgid "IncidentManagement|All"
|
||||
msgstr ""
|
||||
|
||||
|
@ -17396,6 +17405,9 @@ msgstr ""
|
|||
msgid "IncidentManagement|Medium - S3"
|
||||
msgstr ""
|
||||
|
||||
msgid "IncidentManagement|Missed SLA"
|
||||
msgstr ""
|
||||
|
||||
msgid "IncidentManagement|No incidents to display."
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -380,18 +380,6 @@ RSpec.describe Projects::CommitController do
|
|||
expect(response).to have_gitlab_http_status(:not_found)
|
||||
end
|
||||
end
|
||||
|
||||
context 'disable pick_into_project feature flag' do
|
||||
before do
|
||||
stub_feature_flags(pick_into_project: false)
|
||||
end
|
||||
|
||||
it 'does not cherry pick a commit from fork to upstream' do
|
||||
send_request
|
||||
|
||||
expect(project.commit('feature').message).not_to include(forked_project.commit.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Infrastructure Registry' do
|
||||
let_it_be(:user) { create(:user) }
|
||||
let_it_be(:project) { create(:project) }
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
project.add_maintainer(user)
|
||||
end
|
||||
|
||||
context 'when feature is not available' do
|
||||
before do
|
||||
stub_feature_flags(infrastructure_registry_page: false)
|
||||
end
|
||||
|
||||
it 'gives 404' do
|
||||
visit_project_infrastructure_registry
|
||||
|
||||
expect(status_code).to eq(404)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when feature is available', :js do
|
||||
before do
|
||||
visit_project_infrastructure_registry
|
||||
end
|
||||
|
||||
context 'when there are packages' do
|
||||
let_it_be(:terraform_module) { create(:terraform_module_package, project: project, created_at: 1.day.ago, version: '1.0.0') }
|
||||
let_it_be(:terraform_module2) { create(:terraform_module_package, project: project, created_at: 2.days.ago, version: '2.0.0') }
|
||||
let_it_be(:packages) { [terraform_module, terraform_module2] }
|
||||
|
||||
it_behaves_like 'packages list'
|
||||
|
||||
context 'deleting a package' do
|
||||
let_it_be(:project) { create(:project) }
|
||||
let_it_be(:terraform_module) { create(:terraform_module_package, project: project) }
|
||||
|
||||
it 'allows you to delete a module', :aggregate_failures do
|
||||
# this is still using the package copy in the UI too
|
||||
click_button('Remove package')
|
||||
click_button('Delete package')
|
||||
|
||||
expect(page).to have_content 'Package deleted successfully'
|
||||
expect(page).not_to have_content(terraform_module.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'displays the empty message' do
|
||||
expect(page).to have_content('You have no Terraform modules in your project')
|
||||
end
|
||||
end
|
||||
|
||||
def visit_project_infrastructure_registry
|
||||
visit project_infrastructure_registry_index_path(project)
|
||||
end
|
||||
end
|
|
@ -185,7 +185,7 @@ describe('Filtered Search Manager', () => {
|
|||
});
|
||||
|
||||
describe('search', () => {
|
||||
const defaultParams = '?scope=all&utf8=%E2%9C%93';
|
||||
const defaultParams = '?scope=all';
|
||||
const defaultState = '&state=opened';
|
||||
|
||||
it('should search with a single word', (done) => {
|
||||
|
|
|
@ -43,12 +43,10 @@ describe('Incidents List', () => {
|
|||
const findLoader = () => wrapper.find(GlLoadingIcon);
|
||||
const findTimeAgo = () => wrapper.findAll(TimeAgoTooltip);
|
||||
const findAssignees = () => wrapper.findAll('[data-testid="incident-assignees"]');
|
||||
const findIncidentSlaHeader = () => wrapper.find('[data-testid="incident-management-sla"]');
|
||||
const findCreateIncidentBtn = () => wrapper.find('[data-testid="createIncidentBtn"]');
|
||||
const findClosedIcon = () => wrapper.findAll("[data-testid='incident-closed']");
|
||||
const findEmptyState = () => wrapper.find(GlEmptyState);
|
||||
const findSeverity = () => wrapper.findAll(SeverityToken);
|
||||
const findIncidentSla = () => wrapper.findAll("[data-testid='incident-sla']");
|
||||
|
||||
function mountComponent({ data = {}, loading = false, provide = {} } = {}) {
|
||||
wrapper = mount(IncidentsList, {
|
||||
|
@ -188,35 +186,6 @@ describe('Incidents List', () => {
|
|||
joinPaths(`/project/issues/incident`, mockIncidents[0].iid),
|
||||
);
|
||||
});
|
||||
|
||||
describe('Incident SLA field', () => {
|
||||
it('displays the column when the feature is available', () => {
|
||||
mountComponent({
|
||||
data: { incidents: { list: mockIncidents } },
|
||||
provide: { slaFeatureAvailable: true },
|
||||
});
|
||||
|
||||
expect(findIncidentSlaHeader().text()).toContain('Time to SLA');
|
||||
});
|
||||
|
||||
it('does not display the column when the feature is not available', () => {
|
||||
mountComponent({
|
||||
data: { incidents: { list: mockIncidents } },
|
||||
provide: { slaFeatureAvailable: false },
|
||||
});
|
||||
|
||||
expect(findIncidentSlaHeader().exists()).toBe(false);
|
||||
});
|
||||
|
||||
it('renders an SLA for each incident', () => {
|
||||
mountComponent({
|
||||
data: { incidents: { list: mockIncidents } },
|
||||
provide: { slaFeatureAvailable: true },
|
||||
});
|
||||
|
||||
expect(findIncidentSla().length).toBe(mockIncidents.length);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Create Incident', () => {
|
||||
|
|
|
@ -302,7 +302,6 @@ describe('Issuables list component', () => {
|
|||
my_reaction_emoji: 'airplane',
|
||||
scope: 'all',
|
||||
state: 'opened',
|
||||
utf8: '✓',
|
||||
weight: '0',
|
||||
milestone: 'v3.0',
|
||||
labels: 'Aquapod,Astro',
|
||||
|
@ -312,7 +311,7 @@ describe('Issuables list component', () => {
|
|||
|
||||
describe('when page is not present in params', () => {
|
||||
const query =
|
||||
'?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&utf8=%E2%9C%93&weight=0¬[label_name][]=Afterpod¬[milestone_title][]=13';
|
||||
'?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&weight=0¬[label_name][]=Afterpod¬[milestone_title][]=13';
|
||||
|
||||
beforeEach(() => {
|
||||
setUrl(query);
|
||||
|
@ -356,7 +355,7 @@ describe('Issuables list component', () => {
|
|||
|
||||
describe('when page is present in the param', () => {
|
||||
const query =
|
||||
'?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&utf8=%E2%9C%93&weight=0&page=3';
|
||||
'?assignee_username=root&author_username=root&confidential=yes&label_name%5B%5D=Aquapod&label_name%5B%5D=Astro&milestone_title=v3.0&my_reaction_emoji=airplane&scope=all&sort=priority&state=opened&weight=0&page=3';
|
||||
|
||||
beforeEach(() => {
|
||||
setUrl(query);
|
||||
|
|
|
@ -261,7 +261,7 @@ describe('ForkForm component', () => {
|
|||
});
|
||||
|
||||
describe('onSubmit', () => {
|
||||
beforeEach(() => {
|
||||
const setupComponent = (fields = {}) => {
|
||||
jest.spyOn(urlUtility, 'redirectTo').mockImplementation();
|
||||
|
||||
mockGetRequest();
|
||||
|
@ -271,9 +271,14 @@ describe('ForkForm component', () => {
|
|||
namespaces: MOCK_NAMESPACES_RESPONSE,
|
||||
form: {
|
||||
state: true,
|
||||
...fields,
|
||||
},
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
setupComponent();
|
||||
});
|
||||
|
||||
const selectedMockNamespaceIndex = 1;
|
||||
|
@ -305,6 +310,23 @@ describe('ForkForm component', () => {
|
|||
|
||||
expect(urlUtility.redirectTo).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('does not make POST request if no visbility is checked', async () => {
|
||||
jest.spyOn(axios, 'post');
|
||||
|
||||
setupComponent({
|
||||
fields: {
|
||||
visibility: {
|
||||
value: null,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await submitForm();
|
||||
|
||||
expect(wrapper.find('[name="visibility"]:checked').exists()).toBe(false);
|
||||
expect(axios.post).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('with valid form', () => {
|
||||
|
|
|
@ -159,12 +159,7 @@ describe('CommitFormModal', () => {
|
|||
});
|
||||
|
||||
it('Changes the target_project_id input value', async () => {
|
||||
createComponent(
|
||||
shallowMount,
|
||||
{},
|
||||
{ glFeatures: { pickIntoProject: true } },
|
||||
{ isCherryPick: true },
|
||||
);
|
||||
createComponent(shallowMount, {}, {}, { isCherryPick: true });
|
||||
findProjectsDropdown().vm.$emit('selectProject', '_changed_project_value_');
|
||||
|
||||
await wrapper.vm.$nextTick();
|
||||
|
|
|
@ -232,7 +232,7 @@ describe('Tracking', () => {
|
|||
Tracking.bindDocument('_category_'); // only happens once
|
||||
setHTMLFixture(`
|
||||
<input data-track-${term}="click_input1" data-track-label="_label_" value="_value_"/>
|
||||
<input data-track-${term}="click_input2" data-track-value="_value_override_" value="_value_"/>
|
||||
<input data-track-${term}="click_input2" data-track-value="_value_override_" value=0/>
|
||||
<input type="checkbox" data-track-${term}="toggle_checkbox" value="_value_" checked/>
|
||||
<input class="dropdown" data-track-${term}="toggle_dropdown"/>
|
||||
<div data-track-${term}="nested_event"><span class="nested"></span></div>
|
||||
|
@ -272,7 +272,7 @@ describe('Tracking', () => {
|
|||
checkbox.click(); // unchecking
|
||||
|
||||
expect(eventSpy).toHaveBeenCalledWith('_category_', 'toggle_checkbox', {
|
||||
value: false,
|
||||
value: 0,
|
||||
});
|
||||
|
||||
checkbox.click(); // checking
|
||||
|
|
|
@ -205,16 +205,6 @@ RSpec.describe CommitsHelper do
|
|||
{ id: forked_project.id.to_s, name: forked_project.full_path, refsUrl: refs_project_path(forked_project) }
|
||||
])
|
||||
end
|
||||
|
||||
context 'pick_into_project is disabled' do
|
||||
before do
|
||||
stub_feature_flags(pick_into_project: false)
|
||||
end
|
||||
|
||||
it 'does not calculate target projects' do
|
||||
expect(helper.cherry_pick_projects_data(project)).to eq([])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#commit_options_dropdown_data" do
|
||||
|
|
|
@ -113,7 +113,7 @@ RSpec.describe Gitlab::PathRegex do
|
|||
|
||||
let(:deprecated_routes) do
|
||||
# profile was deprecated in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51646
|
||||
%w(profile)
|
||||
%w(profile s)
|
||||
end
|
||||
|
||||
let(:ee_top_level_words) do
|
||||
|
|
|
@ -320,9 +320,11 @@ RSpec.describe 'project routing' do
|
|||
expect(get('/gitlab/gitlabhq/-/snippets/1')).to route_to('projects/snippets#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
|
||||
end
|
||||
|
||||
it 'to #show from unscope routing' do
|
||||
expect(get('/gitlab/gitlabhq/snippets/1')).to route_to('projects/snippets#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
|
||||
it 'to #raw from unscope routing' do
|
||||
expect(get('/gitlab/gitlabhq/snippets/1/raw')).to route_to('projects/snippets#raw', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1')
|
||||
end
|
||||
|
||||
it_behaves_like 'redirecting a legacy path', '/gitlab/gitlabhq/snippets/1', '/gitlab/gitlabhq/-/snippets/1'
|
||||
end
|
||||
|
||||
# test_project_hook POST /:project_id/-/hooks/:id/test(.:format) hooks#test
|
||||
|
|
|
@ -96,9 +96,11 @@ RSpec.describe SnippetsController, "routing" do
|
|||
expect(get("/-/snippets/1")).to route_to('snippets#show', id: '1')
|
||||
end
|
||||
|
||||
it 'to #show from unscoped routing' do
|
||||
expect(get("/snippets/1")).to route_to('snippets#show', id: '1')
|
||||
it 'to #raw from unscoped routing' do
|
||||
expect(get("/snippets/1/raw")).to route_to('snippets#raw', id: '1')
|
||||
end
|
||||
|
||||
it_behaves_like 'redirecting a legacy path', '/snippets/1', '/-/snippets/1'
|
||||
end
|
||||
|
||||
# help GET /help(.:format) help#index
|
||||
|
|
|
@ -447,23 +447,6 @@ RSpec.describe Projects::DestroyService, :aggregate_failures do
|
|||
|
||||
it_behaves_like 'handles errors thrown during async destroy', "Failed to remove webhooks"
|
||||
end
|
||||
|
||||
context 'when "destroy_webhooks_before_the_project" flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(destroy_webhooks_before_the_project: false)
|
||||
end
|
||||
|
||||
it 'does not call WebHooks::DestroyService' do
|
||||
expect(WebHooks::DestroyService).not_to receive(:new)
|
||||
|
||||
expect do
|
||||
destroy_project(project, user)
|
||||
end.to change(WebHook, :count).by(-2)
|
||||
.and change(WebHookLog, :count).by(-1)
|
||||
|
||||
expect(another_project_web_hook.reload).to be
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'error while destroying', :sidekiq_inline do
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
FROM openjdk:8-alpine
|
||||
|
||||
COPY . /usr/src/myapp
|
||||
WORKDIR /usr/src/myapp
|
||||
|
||||
RUN javac Main.java
|
||||
|
||||
CMD ["java", "Main"]
|
Loading…
Reference in New Issue