Skip to content
Snippets Groups Projects
Commit b375c6c0 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 988b28ec
No related branches found
No related tags found
No related merge requests found
Showing
with 215 additions and 157 deletions
Loading
Loading
@@ -23,22 +23,22 @@ Use [BrowserStack](https://www.browserstack.com/) to test with our supported bro
 
Current high-level frontend goals are listed on [Frontend Epics](https://gitlab.com/groups/gitlab-org/-/epics?label_name%5B%5D=frontend).
 
## [Principles](principles.md)
## Principles
 
High-level guidelines for contributing to GitLab.
[High-level guidelines](principles.md) for contributing to GitLab.
 
## [Development Process](development_process.md)
## Development Process
 
How we plan and execute the work on the frontend.
How we [plan and execute](development_process.md) the work on the frontend.
 
## [Architecture](architecture.md)
## Architecture
 
How we go about making fundamental design decisions in GitLab's frontend team
How we go about [making fundamental design decisions](architecture.md) in GitLab's frontend team
or make changes to our frontend development guidelines.
 
## [Testing](../testing_guide/frontend_testing.md)
## Testing
 
How we write frontend tests, run the GitLab test suite, and debug test related
How we write [frontend tests](../testing_guide/frontend_testing.md), run the GitLab test suite, and debug test related
issues.
 
## Pajamas Design System
Loading
Loading
@@ -46,29 +46,33 @@ issues.
Reusable components with technical and usage guidelines can be found in our
[Pajamas Design System](https://design.gitlab.com/).
 
## [Design Patterns](design_patterns.md)
## Design Patterns
 
Common JavaScript design patterns in GitLab's codebase.
Common JavaScript [design patterns](design_patterns.md) in GitLab's codebase.
 
## [Vue.js Best Practices](vue.md)
## Vue.js Best Practices
 
Vue specific design patterns and practices.
Vue specific [design patterns and practices](vue.md).
 
## [Vuex](vuex.md)
## Vuex
 
Vuex specific design patterns and practices.
[Vuex](vuex.md) specific design patterns and practices.
 
## [Axios](axios.md)
## Axios
 
Axios specific practices and gotchas.
[Axios](axios.md) specific practices and gotchas.
 
## [GraphQL](graphql.md)
## GraphQL
 
How to use GraphQL
How to use [GraphQL](graphql.md).
 
## [Icons and Illustrations](icons.md)
## Icons and Illustrations
 
How we use SVG for our Icons and Illustrations.
How we use SVG for our [Icons and Illustrations](icons.md).
## Dependencies
General information about frontend [dependencies](dependencies.md) and how we manage them.
 
## Frontend FAQ
 
Loading
Loading
Loading
Loading
@@ -344,7 +344,7 @@ Integration (CI) server. By using deploy keys, you don't have to set up a
dummy user account.
 
If you are a project maintainer or owner, you can add a deploy key in the
project's **Settings > Repository** page by expanding the
project's **{settings}** **Settings > CI / CD** page by expanding the
**Deploy Keys** section. Specify a title for the new
deploy key and paste a public SSH key. After this, the machine that uses
the corresponding private SSH key has read-only or read-write (if enabled)
Loading
Loading
@@ -387,7 +387,7 @@ of broader usage for something like "Anywhere you need to give read access to
your repository".
 
Once a GitLab administrator adds the Global Deployment key, project maintainers
and owners can add it in project's **Settings > Repository** page by expanding the
and owners can add it in project's **{settings}** **Settings > CI / CD** page by expanding the
**Deploy Keys** section and clicking **Enable** next to the appropriate key listed
under **Public deploy keys available to any project**.
 
Loading
Loading
Loading
Loading
@@ -268,6 +268,14 @@ https://example.gitlab.com/<namespace>/<project>/badges/<branch>/coverage.svg?st
 
[Environment variables](../../../ci/variables/README.html#gitlab-cicd-environment-variables) can be set in an environment to be available to a runner.
 
## Deploy Keys
With Deploy Keys, GitLab allows you to import SSH public keys. You can then have
read only or read/write access to your project from the machines the keys were generated from.
SSH keys added to your project settings will be used for continuous integration,
staging, or production servers.
<!-- ## Troubleshooting
 
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
Loading
Loading
Loading
Loading
@@ -75,7 +75,7 @@ ready.
To keep files in the repository organized it is often helpful to create a new
directory.
 
From a project's files page, click the '+' button to the right of the branch selector.
From a project's files page, click the plus button (`+`) to the right of the branch selector.
Choose **New directory** from the dropdown.
 
![New directory dropdown](img/web_editor_new_directory_dropdown.png)
Loading
Loading
@@ -91,14 +91,21 @@ There are multiple ways to create a branch from GitLab's web interface.
 
### Create a new branch from an issue
 
> [Introduced][ce-2808] in GitLab 8.6.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/2808) in GitLab 8.6.
If your development workflow dictates to have an issue for every merge
request, you can quickly create a branch directly from the issue to speed the process up.
The new branch, and later its merge request, will be marked as related to this issue.
Once merged, the MR will automatically close the issue.
You can see a **Create merge request** dropdown below the issue description.
 
In case your development workflow dictates to have an issue for every merge
request, you can quickly create a branch right on the issue page which will be
tied with the issue itself. You can see a **Create merge request** dropdown
below the issue description unless there is already a branch with the same
name or a referenced merge request or your project (still) has an active
[fork relationship](../settings/index.md#advanced-settings).
NOTE: **Note:**
You won't see the **Create merge request** button if there is already a branch with the same
name or a referenced merge request or your project has an active
fork relationship.
If you would like to make this button appear, a possible workaround is to [remove your project's
fork relationship](../settings/index.md#removing-a-fork-relationship). Once removed, the fork
relationship cannot be restored and you will no longer be able to send merge requests to the source.
 
![Create Button](img/web_editor_new_branch_from_issue_create_button_v12_6.png)
 
Loading
Loading
@@ -181,8 +188,6 @@ If you'd prefer _not_ to use your primary email address for commits created
through the web editor, you can choose to use another of your linked email
addresses from the **User Settings > Edit Profile** page.
 
[ce-2808]: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/2808
<!-- ## Troubleshooting
 
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
Loading
Loading
Loading
Loading
@@ -215,9 +215,12 @@ To remove a project:
This action either:
 
- Removes a project including all associated resources (issues, merge requests etc).
- Since [GitLab 12.6](https://gitlab.com/gitlab-org/gitlab/issues/32935), on [Premium or Silver](https://about.gitlab.com/pricing/) or higher tiers, marks a project for deletion. The deletion will happen 7 days later by default, but this can be changed in the [instance settings](../../admin_area/settings/visibility_and_access_controls.md#default-deletion-adjourned-period-premium-only).
- Since [GitLab 12.6](https://gitlab.com/gitlab-org/gitlab/issues/32935), on
[GitLab Premium or GitLab.com Silver](https://about.gitlab.com/pricing/) or higher tiers, marks a project for
deletion. The deletion will happen 7 days later by default, but this can be changed in the
[instance settings](../../admin_area/settings/visibility_and_access_controls.md#default-deletion-adjourned-period-premium-only).
 
### Restore a project **(PREMIUM)**
#### Restore a project **(PREMIUM)**
 
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/32935) in GitLab 12.6.
 
Loading
Loading
@@ -234,6 +237,9 @@ If you want to use the fork for yourself and don't need to send
[merge requests](../merge_requests.md) to the upstream project,
you can safely remove the fork relationship.
 
CAUTION: **Caution:**
Once removed, the fork relationship cannot be restored. You will no longer be able to send merge requests to the source, and if anyone has forked your project, their fork will also lose the relationship.
To do so:
 
1. Navigate to your project's **Settings > General > Advanced**.
Loading
Loading
Loading
Loading
@@ -22,11 +22,18 @@ module Banzai
doc
end
 
# Implement in child class.
# Child class must provide the metrics_dashboard_url.
#
# Return a Nokogiri::XML::Element to embed in the
# markdown.
# markdown which provides a url to the metric_dashboard endpoint where
# data can be requested through a prometheus proxy. InlineMetricsRedactorFilter
# is responsible for premissions to see this div (and relies on the class 'js-render-metrics' ).
def create_element(params)
doc.document.create_element(
'div',
class: 'js-render-metrics',
'data-dashboard-url': metrics_dashboard_url(params)
)
end
 
# Implement in child class unless overriding #embed_params
Loading
Loading
@@ -71,6 +78,13 @@ module Banzai
Gitlab::Metrics::Dashboard::Url.parse_query(url)
end
end
# Implement in child class.
#
# Provides a full url to request the relevant panels of metric data.
def metrics_dashboard_url
raise NotImplementedError
end
end
end
end
Loading
Loading
@@ -10,11 +10,7 @@ module Banzai
def create_element(params)
begin_loading_dashboard(params[:url])
 
doc.document.create_element(
'div',
class: 'js-render-metrics',
'data-dashboard-url': metrics_dashboard_url(params)
)
super
end
 
def embed_params(node)
Loading
Loading
Loading
Loading
@@ -5,16 +5,6 @@ module Banzai
# HTML filter that inserts a placeholder element for each
# reference to a metrics dashboard.
class InlineMetricsFilter < Banzai::Filter::InlineEmbedsFilter
# Placeholder element for the frontend to use as an
# injection point for charts.
def create_element(params)
doc.document.create_element(
'div',
class: 'js-render-metrics',
'data-dashboard-url': metrics_dashboard_url(params)
)
end
# Search params for selecting metrics links. A few
# simple checks is enough to boost performance without
# the cost of doing a full regex match.
Loading
Loading
# frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
class Build
class Associations < Chain::Base
def perform!
return unless @command.bridge
@pipeline.build_source_pipeline(
source_pipeline: @command.bridge.pipeline,
source_project: @command.bridge.project,
source_bridge: @command.bridge,
project: @command.project
)
end
def break?
false
end
end
end
end
end
end
end
Loading
Loading
@@ -2066,6 +2066,9 @@ msgstr ""
msgid "Application settings saved successfully"
msgstr ""
 
msgid "Application settings update failed"
msgstr ""
msgid "Application uninstalled but failed to destroy: %{error_message}"
msgstr ""
 
Loading
Loading
Loading
Loading
@@ -39,7 +39,7 @@
"@babel/preset-env": "^7.8.4",
"@gitlab/at.js": "^1.5.5",
"@gitlab/svgs": "^1.104.0",
"@gitlab/ui": "^9.18.2",
"@gitlab/ui": "^9.20.0",
"@gitlab/visual-review-tools": "1.5.1",
"@sentry/browser": "^5.10.2",
"@sourcegraph/code-host-integration": "0.0.30",
Loading
Loading
Loading
Loading
@@ -6,12 +6,11 @@ module QA
it 'user creates an event in the activity page upon Git push' do
Flow::Login.sign_in
 
project_push = Resource::Repository::ProjectPush.fabricate! do |push|
Resource::Repository::ProjectPush.fabricate! do |push|
push.file_name = 'README.md'
push.file_content = '# This is a test project'
push.commit_message = 'Add README.md'
end
project_push.project.visit!
end.project.visit!
 
Page::Project::Menu.perform(&:click_activity)
Page::Project::Activity.perform(&:click_push_events)
Loading
Loading
Loading
Loading
@@ -19,10 +19,10 @@ describe Projects::DeployKeysController do
end
 
context 'when html requested' do
it 'redirects to project settings with the correct anchor' do
it 'redirects to project ci / cd settings with the correct anchor' do
get :index, params: params
 
expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-deploy-keys-settings'))
expect(response).to redirect_to(project_settings_ci_cd_path(project, anchor: 'js-deploy-keys-settings'))
end
end
 
Loading
Loading
@@ -87,13 +87,13 @@ describe Projects::DeployKeysController do
it 'creates a new deploy key for the project' do
expect { post :create, params: create_params }.to change(project.deploy_keys, :count).by(1)
 
expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-deploy-keys-settings'))
expect(response).to redirect_to(project_settings_ci_cd_path(project, anchor: 'js-deploy-keys-settings'))
end
 
it 'redirects to project settings with the correct anchor' do
post :create, params: create_params
 
expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-deploy-keys-settings'))
expect(response).to redirect_to(project_settings_ci_cd_path(project, anchor: 'js-deploy-keys-settings'))
end
 
context 'when the deploy key is invalid' do
Loading
Loading
@@ -153,7 +153,7 @@ describe Projects::DeployKeysController do
 
expect(DeployKeysProject.where(project_id: project.id, deploy_key_id: deploy_key.id).count).to eq(1)
expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(namespace_project_settings_repository_path(anchor: 'js-deploy-keys-settings'))
expect(response).to redirect_to(namespace_project_settings_ci_cd_path(anchor: 'js-deploy-keys-settings'))
end
 
it 'returns 404' do
Loading
Loading
@@ -175,7 +175,7 @@ describe Projects::DeployKeysController do
 
expect(DeployKeysProject.where(project_id: project.id, deploy_key_id: deploy_key.id).count).to eq(1)
expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(namespace_project_settings_repository_path(anchor: 'js-deploy-keys-settings'))
expect(response).to redirect_to(namespace_project_settings_ci_cd_path(anchor: 'js-deploy-keys-settings'))
end
end
end
Loading
Loading
@@ -216,7 +216,7 @@ describe Projects::DeployKeysController do
put :disable, params: { id: deploy_key.id, namespace_id: project.namespace, project_id: project }
 
expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(namespace_project_settings_repository_path(anchor: 'js-deploy-keys-settings'))
expect(response).to redirect_to(namespace_project_settings_ci_cd_path(anchor: 'js-deploy-keys-settings'))
 
expect { DeployKey.find(deploy_key.id) }.to raise_error(ActiveRecord::RecordNotFound)
end
Loading
Loading
@@ -239,7 +239,7 @@ describe Projects::DeployKeysController do
end.to change { DeployKey.count }.by(-1)
 
expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(namespace_project_settings_repository_path(anchor: 'js-deploy-keys-settings'))
expect(response).to redirect_to(namespace_project_settings_ci_cd_path(anchor: 'js-deploy-keys-settings'))
 
expect { DeployKey.find(deploy_key.id) }.to raise_error(ActiveRecord::RecordNotFound)
end
Loading
Loading
Loading
Loading
@@ -17,9 +17,9 @@ describe 'Project deploy keys', :js do
end
 
it 'removes association between project and deploy key' do
visit project_settings_repository_path(project)
visit project_settings_ci_cd_path(project)
 
page.within(find('.deploy-keys')) do
page.within(find('.qa-deploy-keys-settings')) do
expect(page).to have_selector('.deploy-key', count: 1)
 
accept_confirm { find('.ic-remove').click }
Loading
Loading
Loading
Loading
@@ -2,10 +2,10 @@
 
require 'spec_helper'
 
describe 'Projects > Settings > CI/CD settings' do
let(:project) { create(:project_empty_repo) }
let(:user) { create(:user) }
let(:role) { :maintainer }
describe 'Projects > Settings > CI / CD settings' do
let_it_be(:project) { create(:project_empty_repo) }
let_it_be(:user) { create(:user) }
let_it_be(:role) { :maintainer }
 
context 'Deploy tokens' do
let!(:deploy_token) { create(:deploy_token, projects: [project]) }
Loading
Loading
@@ -21,4 +21,92 @@ describe 'Projects > Settings > CI/CD settings' do
let(:entity_type) { 'project' }
end
end
context 'Deploy Keys', :js do
let_it_be(:private_deploy_key) { create(:deploy_key, title: 'private_deploy_key', public: false) }
let_it_be(:public_deploy_key) { create(:another_deploy_key, title: 'public_deploy_key', public: true) }
let(:new_ssh_key) { attributes_for(:key)[:key] }
before do
project.add_role(user, role)
sign_in(user)
end
it 'get list of keys' do
project.deploy_keys << private_deploy_key
project.deploy_keys << public_deploy_key
visit project_settings_ci_cd_path(project)
expect(page).to have_content('private_deploy_key')
expect(page).to have_content('public_deploy_key')
end
it 'add a new deploy key' do
visit project_settings_ci_cd_path(project)
fill_in 'deploy_key_title', with: 'new_deploy_key'
fill_in 'deploy_key_key', with: new_ssh_key
check 'deploy_key_deploy_keys_projects_attributes_0_can_push'
click_button 'Add key'
expect(page).to have_content('new_deploy_key')
expect(page).to have_content('Write access allowed')
end
it 'edit an existing deploy key' do
project.deploy_keys << private_deploy_key
visit project_settings_ci_cd_path(project)
find('.deploy-key', text: private_deploy_key.title).find('.ic-pencil').click
fill_in 'deploy_key_title', with: 'updated_deploy_key'
check 'deploy_key_deploy_keys_projects_attributes_0_can_push'
click_button 'Save changes'
expect(page).to have_content('updated_deploy_key')
expect(page).to have_content('Write access allowed')
end
it 'edit an existing public deploy key to be writable' do
project.deploy_keys << public_deploy_key
visit project_settings_ci_cd_path(project)
find('.deploy-key', text: public_deploy_key.title).find('.ic-pencil').click
check 'deploy_key_deploy_keys_projects_attributes_0_can_push'
click_button 'Save changes'
expect(page).to have_content('public_deploy_key')
expect(page).to have_content('Write access allowed')
end
it 'edit a deploy key from projects user has access to' do
project2 = create(:project_empty_repo)
project2.add_role(user, role)
project2.deploy_keys << private_deploy_key
visit project_settings_ci_cd_path(project)
find('.js-deployKeys-tab-available_project_keys').click
find('.deploy-key', text: private_deploy_key.title).find('.ic-pencil').click
fill_in 'deploy_key_title', with: 'updated_deploy_key'
click_button 'Save changes'
find('.js-deployKeys-tab-available_project_keys').click
expect(page).to have_content('updated_deploy_key')
end
it 'remove an existing deploy key' do
project.deploy_keys << private_deploy_key
visit project_settings_ci_cd_path(project)
accept_confirm { find('.deploy-key', text: private_deploy_key.title).find('.ic-remove').click }
expect(page).not_to have_content(private_deploy_key.title)
end
end
end
Loading
Loading
@@ -25,89 +25,6 @@ describe 'Projects > Settings > Repository settings' do
context 'for maintainer' do
let(:role) { :maintainer }
 
context 'Deploy Keys', :js do
let(:private_deploy_key) { create(:deploy_key, title: 'private_deploy_key', public: false) }
let(:public_deploy_key) { create(:another_deploy_key, title: 'public_deploy_key', public: true) }
let(:new_ssh_key) { attributes_for(:key)[:key] }
it 'get list of keys' do
project.deploy_keys << private_deploy_key
project.deploy_keys << public_deploy_key
visit project_settings_repository_path(project)
expect(page).to have_content('private_deploy_key')
expect(page).to have_content('public_deploy_key')
end
it 'add a new deploy key' do
visit project_settings_repository_path(project)
fill_in 'deploy_key_title', with: 'new_deploy_key'
fill_in 'deploy_key_key', with: new_ssh_key
check 'deploy_key_deploy_keys_projects_attributes_0_can_push'
click_button 'Add key'
expect(page).to have_content('new_deploy_key')
expect(page).to have_content('Write access allowed')
end
it 'edit an existing deploy key' do
project.deploy_keys << private_deploy_key
visit project_settings_repository_path(project)
find('.deploy-key', text: private_deploy_key.title).find('.ic-pencil').click
fill_in 'deploy_key_title', with: 'updated_deploy_key'
check 'deploy_key_deploy_keys_projects_attributes_0_can_push'
click_button 'Save changes'
expect(page).to have_content('updated_deploy_key')
expect(page).to have_content('Write access allowed')
end
it 'edit an existing public deploy key to be writable' do
project.deploy_keys << public_deploy_key
visit project_settings_repository_path(project)
find('.deploy-key', text: public_deploy_key.title).find('.ic-pencil').click
check 'deploy_key_deploy_keys_projects_attributes_0_can_push'
click_button 'Save changes'
expect(page).to have_content('public_deploy_key')
expect(page).to have_content('Write access allowed')
end
it 'edit a deploy key from projects user has access to' do
project2 = create(:project_empty_repo)
project2.add_role(user, role)
project2.deploy_keys << private_deploy_key
visit project_settings_repository_path(project)
find('.js-deployKeys-tab-available_project_keys').click
find('.deploy-key', text: private_deploy_key.title).find('.ic-pencil').click
fill_in 'deploy_key_title', with: 'updated_deploy_key'
click_button 'Save changes'
find('.js-deployKeys-tab-available_project_keys').click
expect(page).to have_content('updated_deploy_key')
end
it 'remove an existing deploy key' do
project.deploy_keys << private_deploy_key
visit project_settings_repository_path(project)
accept_confirm { find('.deploy-key', text: private_deploy_key.title).find('.ic-remove').click }
expect(page).not_to have_content(private_deploy_key.title)
end
end
context 'remote mirror settings' do
let(:user2) { create(:user) }
 
Loading
Loading
Loading
Loading
@@ -20,7 +20,7 @@ describe "User interacts with deploy keys", :js do
click_button("Enable")
 
expect(page).not_to have_selector(".fa-spinner")
expect(current_path).to eq(project_settings_repository_path(project))
expect(current_path).to eq(project_settings_ci_cd_path(project))
 
find(".js-deployKeys-tab-enabled_keys").click
 
Loading
Loading
@@ -96,7 +96,7 @@ describe "User interacts with deploy keys", :js do
 
click_button("Add key")
 
expect(current_path).to eq(project_settings_repository_path(project))
expect(current_path).to eq(project_settings_ci_cd_path(project))
 
page.within(".deploy-keys") do
expect(page).to have_content(DEPLOY_KEY_TITLE)
Loading
Loading
Loading
Loading
@@ -64,7 +64,7 @@ describe AwardEmojiHelper do
it 'returns correct url' do
@project = issue.project
 
expected_url = "/#{@project.namespace.path}/#{@project.path}/issues/#{issue.iid}/toggle_award_emoji"
expected_url = "/#{@project.namespace.path}/#{@project.path}/-/issues/#{issue.iid}/toggle_award_emoji"
 
expect(subject).to eq(expected_url)
end
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe BoardsHelper do
@project = project
@board = create(:board, project: @project)
 
expect(build_issue_link_base).to eq("/#{@project.namespace.path}/#{@project.path}/issues")
expect(build_issue_link_base).to eq("/#{@project.namespace.path}/#{@project.path}/-/issues")
end
end
 
Loading
Loading
Loading
Loading
@@ -110,7 +110,7 @@ describe EventsHelper do
it 'returns a project issue url' do
event.target = create(:note_on_issue, note: 'nice work')
 
expect(subject).to eq("#{project_base_url}/issues/#{event.note_target.iid}#note_#{event.target.id}")
expect(subject).to eq("#{project_base_url}/-/issues/#{event.note_target.iid}#note_#{event.target.id}")
end
 
it 'returns a merge request url' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment