Commit 876c6b51 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 0bdaa26af7b9
......@@ -36,9 +36,16 @@ Personas are described at https://about.gitlab.com/handbook/marketing/product-ma
Add all known Documentation Requirements here, per https://docs.gitlab.com/ee/development/documentation/feature-change-workflow.html#documentation-requirements
If this feature requires changing permissions, this document https://docs.gitlab.com/ee/user/permissions.html must be updated accordingly. -->
### Testing
### Availability & Testing
<!-- What risks does this change pose? How might it affect the quality of the product? What additional test coverage or changes to tests will be needed? Will it require cross-browser testing? See the test engineering process for further help: https://about.gitlab.com/handbook/engineering/quality/test-engineering/ -->
<!-- What risks does this change pose to our availability? How might it affect the quality of the product? What additional test coverage or changes to tests will be needed? Will it require cross-browser testing?
Please list the test areas (unit, integration and end-to-end) that needs to be added or updated to ensure that this feature will work as intended. Plese use the list below as guidance.
* Unit test changes
* Integration test changes
* End-to-end test change
See the test engineering planning process and reach out to your counterpart Software Engineer in Test for assistance : https://about.gitlab.com/handbook/engineering/quality/test-engineering/#test-planning -->
### What does success look like, and how can we measure that?
......
......@@ -301,24 +301,6 @@ RSpec/AnyInstanceOf:
Enabled: false
# Cops for upgrade to gitlab-styles 3.1.0
Rails/SafeNavigationWithBlank:
Enabled: false
Rails/ApplicationController:
Enabled: false
Rails/ApplicationMailer:
Enabled: false
Rails/RakeEnvironment:
Enabled: false
Rails/HelperInstanceVariable:
Enabled: false
Rails/EnumHash:
Enabled: false
RSpec/ReceiveCounts:
Enabled: false
......@@ -362,10 +344,13 @@ RSpec/UnspecifiedException:
Enabled: false
RSpec/HaveGitlabHttpStatus:
Enabled: false
Enabled: true
Include:
- 'spec/support/shared_examples/**/*'
Style/MultilineWhenThen:
Enabled: false
Style/FloatDivision:
Enabled: false
\ No newline at end of file
This diff is collapsed.
......@@ -8,6 +8,9 @@ export default {
},
},
computed: {
displayAsCell() {
return !(this.line.rich_text || this.line.text);
},
lineType() {
return this.line.type;
},
......@@ -23,11 +26,9 @@ export default {
<td class="diff-line-num new_line border-top-0 border-bottom-0" :class="lineType">
{{ line.new_line }}
</td>
<td class="line_content" :class="lineType">
<td class="line_content" :class="[{ 'd-table-cell': displayAsCell }, lineType]">
<span v-if="line.rich_text" v-html="line.rich_text"></span>
<span v-else-if="line.text">{{ line.text }}</span>
<!-- TODO: replace this hack with zero-width whitespace when we have rich_text from BE -->
<span v-else>&#8203;</span>
</td>
</tr>
</template>
......@@ -41,6 +41,7 @@
.mh-50vh { max-height: 50vh; }
.gl-w-64 { width: px-to-rem($grid-size * 8); }
.gl-h-32 { height: px-to-rem($grid-size * 4); }
.gl-h-64 { height: px-to-rem($grid-size * 8); }
.gl-text-purple { color: $purple; }
......@@ -59,4 +60,3 @@
.gl-text-red-700 { @include gl-text-red-700; }
.gl-text-orange-700 { @include gl-text-orange-700; }
.gl-text-green-700 { @include gl-text-green-700; }
......@@ -223,19 +223,19 @@ def update_tracked_fields!(request)
after_initialize :set_projects_limit
# User's Layout preference
enum layout: [:fixed, :fluid]
enum layout: { fixed: 0, fluid: 1 }
# User's Dashboard preference
# Note: When adding an option, it MUST go on the end of the array.
enum dashboard: [:projects, :stars, :project_activity, :starred_project_activity, :groups, :todos, :issues, :merge_requests, :operations]
enum dashboard: { projects: 0, stars: 1, project_activity: 2, starred_project_activity: 3, groups: 4, todos: 5, issues: 6, merge_requests: 7, operations: 8 }
# User's Project preference
# Note: When adding an option, it MUST go on the end of the array.
enum project_view: [:readme, :activity, :files]
enum project_view: { readme: 0, activity: 1, files: 2 }
# User's role
# Note: When adding an option, it MUST go on the end of the array.
enum role: [:software_developer, :development_team_lead, :devops_engineer, :systems_administrator, :security_analyst, :data_analyst, :product_manager, :product_designer, :other], _suffix: true
enum role: { software_developer: 0, development_team_lead: 1, devops_engineer: 2, systems_administrator: 3, security_analyst: 4, data_analyst: 5, product_manager: 6, product_designer: 7, other: 8 }, _suffix: true
delegate :path, to: :namespace, allow_nil: true, prefix: true
delegate :notes_filter_for, to: :user_preference
......
......@@ -9,7 +9,7 @@
Enable version check
.form-text.text-muted
GitLab will inform you if a new version is available.
= link_to 'Learn more', help_page_path("user/admin_area/settings/usage_statistics", anchor: "version-check")
= link_to 'Learn more', help_page_path('user/admin_area/settings/usage_statistics', anchor: 'version-check-core-only')
about what information is shared with GitLab Inc.
.form-group
- can_be_configured = @application_setting.usage_ping_can_be_configured?
......@@ -21,7 +21,7 @@
- if can_be_configured
%p.mb-2= _('To help improve GitLab and its user experience, GitLab will periodically collect usage information.')
- usage_ping_path = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'usage-ping')
- usage_ping_path = help_page_path('user/admin_area/settings/usage_statistics', anchor: 'usage-ping-core-only')
- usage_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: usage_ping_path }
%p.mb-2= s_('%{usage_ping_link_start}Learn more%{usage_ping_link_end} about what information is shared with GitLab Inc.').html_safe % { usage_ping_link_start: usage_ping_link_start, usage_ping_link_end: '</a>'.html_safe }
......
......@@ -6,27 +6,25 @@
- if can?(current_user, :admin_cluster, @cluster)
- unless @cluster.provided_by_user?
.append-bottom-20
%label.append-bottom-10
.sub-section.form-group
%h4
= @cluster.provider_label
%p
- provider_link = link_to(@cluster.provider_label, @cluster.provider_management_url, target: '_blank', rel: 'noopener noreferrer')
= s_('ClusterIntegration|Manage your Kubernetes cluster by visiting %{provider_link}').html_safe % { provider_link: provider_link }
= form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster, html: { class: 'cluster_management_form' } do |field|
%h5
= s_('ClusterIntegration|Cluster management project (alpha)')
.sub-section.form-group
= form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster, html: { class: 'cluster_management_form' } do |field|
%h4
= s_('ClusterIntegration|Cluster management project (alpha)')
.form-group
.form-text.text-muted
= project_select_tag('cluster[management_project_id]', class: 'hidden-filter-value', toggle_class: 'js-project-search js-project-filter js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-project js-filter-submit',
placeholder: _('Select project'), idAttribute: 'id', data: { order_by: 'last_activity_at', idattribute: 'id', simple_filter: true, allow_clear: true, include_groups: false, include_projects_in_subgroups: true, group_id: group_id, user_id: user_id }, value: @cluster.management_project_id)
.text-muted
= s_('ClusterIntegration|A cluster management project can be used to run deployment jobs with Kubernetes <code>cluster-admin</code> privileges.').html_safe
= link_to _('More information'), help_page_path('user/clusters/management_project.md'), target: '_blank'
.form-group
= field.submit _('Save changes'), class: 'btn btn-success qa-save-domain'
%p
= project_select_tag('cluster[management_project_id]', class: 'hidden-filter-value', toggle_class: 'js-project-search js-project-filter js-filter-submit', dropdown_class: 'dropdown-menu-selectable dropdown-menu-project js-filter-submit',
placeholder: _('Select project'), idAttribute: 'id', data: { order_by: 'last_activity_at', idattribute: 'id', simple_filter: true, allow_clear: true, include_groups: false, include_projects_in_subgroups: true, group_id: group_id, user_id: user_id }, value: @cluster.management_project_id)
.text-muted
= s_('ClusterIntegration|A cluster management project can be used to run deployment jobs with Kubernetes <code>cluster-admin</code> privileges.').html_safe
= link_to _('More information'), help_page_path('user/clusters/management_project.md'), target: '_blank'
= field.submit _('Save changes'), class: 'btn btn-success'
- if @cluster.managed?
.sub-section.form-group
......
......@@ -9,6 +9,6 @@
- usage_ping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: usage_ping_path }
= s_('User Cohorts are only shown when the %{usage_ping_link_start}usage ping%{usage_ping_link_end} is enabled.').html_safe % { usage_ping_link_start: usage_ping_link_start, usage_ping_link_end: '</a>'.html_safe }
- if current_user.admin?
- application_settings_path = admin_application_settings_path(anchor: 'usage-statistics')
- application_settings_path = metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings')
- application_settings_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: application_settings_path }
= s_('To enable it and see User Cohorts, visit %{application_settings_link_start}application settings%{application_settings_link_end}.').html_safe % { application_settings_link_start: application_settings_link_start, application_settings_link_end: '</a>'.html_safe }
- if session[:ask_for_usage_stats_consent]
.ping-consent-message.alert.alert-warning.flex-alert
- settings_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer" class="alert-link">'.html_safe % { url: admin_application_settings_path(anchor: 'js-usage-settings') }
- settings_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer" class="alert-link">'.html_safe % { url: metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings') }
- info_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer" class="alert-link">'.html_safe % { url: help_page_path('user/admin_area/settings/usage_statistics.md') }
.alert-message
= s_('To help improve GitLab, we would like to periodically collect usage information. This can be changed at any time in %{settings_link_start}Settings%{link_end}. %{info_link_start}More Information%{link_end}').html_safe % { settings_link_start: settings_link_start, info_link_start: info_link_start, link_end: '</a>'.html_safe }
......
---
title: Fix loading of sub-epics caused by wrong subscription check.
merge_request: 23184
author:
type: fixed
---
title: Use consistent layout in cluster advanced settings
merge_request: 22656
author:
type: other
---
title: Allow SSH keys API endpoint to be requested for a given username
merge_request: 22899
author: Rajendra Kadam
type: changed
......@@ -677,12 +677,12 @@ Parameters:
Get a list of a specified user's SSH keys.
```
GET /users/:id/keys
GET /users/:id_or_username/keys
```
Parameters:
- `id` (required) - id of specified user
| Attribute | Type | Required | Description |
| ---------------- | ------ | -------- | ----------- |
| `id_or_username` | string | yes | The id or username of the user to get the SSH keys for. |
## Single SSH key
......
......@@ -85,6 +85,35 @@ subgraph "gitlab-qa pipeline"
1. The result of the GitLab QA pipeline is being
propagated upstream, through Omnibus, back to the CE / EE merge request.
Please note, we plan to [add more specific information](https://gitlab.com/gitlab-org/quality/team-tasks/issues/156)
about the tests included in each job/scenario that runs in `gitlab-qa`.
##### Running custom tests
The [existing scenarios](https://gitlab.com/gitlab-org/gitlab-qa/blob/master/docs/what_tests_can_be_run.md)
that run in the downstream `gitlab-qa` pipeline include many tests, but there are times when you might want to run a
test or a group of tests that are different than the groups in any of the existing scenarios.
For example, when we [dequarantine](https://about.gitlab.com/handbook/engineering/quality/guidelines/debugging-qa-test-failures/#dequarantining-tests)
a flaky test we first want to make sure that it's no longer flaky.
We can do that using the `ce:custom-parallel` and `ee:custom-parallel` jobs.
Both are manual jobs that you can configure using custom variables.
When you click the name (not the play icon) of one of the parallel jobs,
you'll be prompted to enter variables. You can use any of [the variables
that can be used with `gitlab-qa`](https://gitlab.com/gitlab-org/gitlab-qa/blob/master/docs/what_tests_can_be_run.md#supported-gitlab-environment-variables)
as well as these:
| Variable | Description |
|-|-|
| `QA_SCENARIO` | The scenario to run (default `Test::Instance::Image`) |
| `QA_TESTS` | The test(s) to run (no default, which means run all the tests in the scenario). Use file paths as you would when running tests via RSpec, e.g., `qa/specs/features/ee/browser_ui` would include all the `EE` UI tests. |
| `QA_RSPEC_TAGS` | The RSpec tags to add (no default) |
For now [manual jobs with custom variables will not use the same variable
when retried](https://gitlab.com/gitlab-org/gitlab/issues/31367), so if you want to run the same test(s) multiple times,
specify the same variables in each `custom-parallel` job (up to as
many of the 10 available jobs that you want to run).
#### Using the `review-qa-all` jobs
On every pipeline during the `test` stage, the `review-qa-smoke` job is
......@@ -105,8 +134,9 @@ See [Review Apps][review-apps] for more details about Review Apps.
## How do I run the tests?
There are two main options for running the tests. If you simply want to run the
existing tests against a live GitLab instance or against a pre-built docker image
If you are not [testing code in a merge request](#testing-code-in-merge-requests),
there are two main options for running the tests. If you simply want to run
the existing tests against a live GitLab instance or against a pre-built docker image
you can use the [GitLab QA orchestrator][gitlab-qa-readme]. See also [examples
of the test scenarios you can run via the orchestrator](https://gitlab.com/gitlab-org/gitlab-qa/blob/master/docs/what_tests_can_be_run.md#examples).
......
......@@ -252,17 +252,15 @@ def reorder_users(users)
success Entities::SSHKey
end
params do
requires :id, type: Integer, desc: 'The ID of the user'
requires :user_id, type: String, desc: 'The ID or username of the user'
use :pagination
end
# rubocop: disable CodeReuse/ActiveRecord
get ':id/keys' do
user = User.find_by(id: params[:id])
get ':user_id/keys', requirements: API::USER_REQUIREMENTS do
user = find_user(params[:user_id])
not_found!('User') unless user && can?(current_user, :read_user, user)
present paginate(user.keys), with: Entities::SSHKey
end
# rubocop: enable CodeReuse/ActiveRecord
desc 'Delete an existing SSH key from a specified user. Available only for admins.' do
success Entities::SSHKey
......
......@@ -638,6 +638,12 @@ msgstr ""
msgid "1st contribution!"
msgstr ""
msgid "2 days"
msgstr ""
msgid "2 weeks"
msgstr ""
msgid "20-29 contributions"
msgstr ""
......@@ -665,6 +671,9 @@ msgstr ""
msgid "30+ contributions"
msgstr ""
msgid "4 hours"
msgstr ""
msgid "403|Please contact your GitLab administrator to get permission."
msgstr ""
......@@ -7183,6 +7192,9 @@ msgstr ""
msgid "Environments|Show all"
msgstr ""
msgid "Environments|Show last"
msgstr ""
msgid "Environments|Stop"
msgstr ""
......@@ -13082,6 +13094,9 @@ msgstr ""
msgid "Past due"
msgstr ""
msgid "Past week"
msgstr ""
msgid "Paste a machine public key here. Read more about how to generate it %{link_start}here%{link_end}"
msgstr ""
......@@ -21776,6 +21791,9 @@ msgstr ""
msgid "ciReport|%{linkStartTag}Learn more about SAST %{linkEndTag}"
msgstr ""
msgid "ciReport|%{linkStartTag}Learn more about codequality reports %{linkEndTag}"
msgstr ""
msgid "ciReport|%{namespace} is affected by %{vulnerability}."
msgstr ""
......@@ -21864,6 +21882,9 @@ msgstr ""
msgid "ciReport|Automatically apply the patch in a new branch"
msgstr ""
msgid "ciReport|Base pipeline codequality artifact not found"
msgstr ""
msgid "ciReport|Class"
msgstr ""
......
......@@ -124,9 +124,6 @@ describe('Dashboard', () => {
.then(() => {
expect(wrapper.vm.showEmptyState).toEqual(false);
expect(wrapper.vm.$el.querySelector('.prometheus-panel')).toEqual(null);
// TODO: The last expectation doesn't belong here, it belongs in a `group_group_spec.js` file
// Issue: https://gitlab.com/gitlab-org/gitlab/issues/118780
// expect(wrapper.vm.$el.querySelector('.prometheus-graph-group')).toBeTruthy();
done();
})
......
......@@ -63,21 +63,59 @@ describe('SuggestionDiffRow', () => {
it('renders the plain text when it is available but rich text is not', () => {
factory({
propsData: {
line: Object.assign({}, newLine, { rich_text: undefined }),
line: {
...newLine,
rich_text: undefined,
},
},
});
expect(wrapper.find('td.line_content').text()).toEqual('newplaintext');
});
it('renders a zero-width space when it has no plain or rich texts', () => {
it('switches to table-cell display when it has no plain or rich texts', () => {
factory({
propsData: {
line: Object.assign({}, newLine, { rich_text: undefined, text: undefined }),
line: {
...newLine,
text: undefined,
rich_text: undefined,
},
},
});
expect(wrapper.find('td.line_content').text()).toEqual('\u200B');
const lineContent = wrapper.find('td.line_content');
expect(lineContent.classes()).toContain('d-table-cell');
expect(lineContent.text()).toEqual('');
});
it('does not switch to table-cell display if it has either plain or rich texts', () => {
let lineContent;
factory({
propsData: {
line: {
...newLine,
text: undefined,
},
},
});
lineContent = wrapper.find('td.line_content');
expect(lineContent.classes()).not.toContain('d-table-cell');
factory({
propsData: {
line: {
...newLine,
rich_text: undefined,
},
},
});
lineContent = wrapper.find('td.line_content');
expect(lineContent.classes()).not.toContain('d-table-cell');
});
});
......
......@@ -913,6 +913,27 @@
end
end
describe 'GET /user/:user_id/keys' do
it 'returns 404 for non-existing user' do
get api("/users/#{not_existing_user_id}/keys")
expect(response).to have_gitlab_http_status(404)
expect(json_response['message']).to eq('404 User Not Found')
end
it 'returns array of ssh keys' do
user.keys << key
user.save
get api("/users/#{user.username}/keys")
expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array
expect(json_response.first['title']).to eq(key.title)
end
end
describe 'DELETE /user/:id/keys/:key_id' do
before do
admin
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment