Commit 9044365a authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 0820b29d
<script> <script>
import _ from 'underscore';
import { GlTooltip } from '@gitlab/ui'; import { GlTooltip } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
...@@ -56,17 +57,36 @@ export default { ...@@ -56,17 +57,36 @@ export default {
collapseIcon() { collapseIcon() {
return this.isExpanded ? 'chevron-down' : 'chevron-right'; return this.isExpanded ? 'chevron-down' : 'chevron-right';
}, },
noCodeFn() { errorFnText() {
return this.errorFn ? sprintf(__('in %{errorFn} '), { errorFn: this.errorFn }) : ''; return this.errorFn
? sprintf(
__(`%{spanStart}in%{spanEnd} %{errorFn}`),
{
errorFn: `<strong>${_.escape(this.errorFn)}</strong>`,
spanStart: `<span class="text-tertiary">`,
spanEnd: `</span>`,
},
false,
)
: '';
}, },
noCodeLine() { errorPositionText() {
return this.errorLine return this.errorLine
? sprintf(__('at line %{errorLine}%{errorColumn}'), { ? sprintf(
errorLine: this.errorLine, __(`%{spanStart}at line%{spanEnd} %{errorLine}%{errorColumn}`),
errorColumn: this.errorColumn ? `:${this.errorColumn}` : '', {
}) errorLine: `<strong>${this.errorLine}</strong>`,
errorColumn: this.errorColumn ? `:<strong>${this.errorColumn}</strong>` : ``,
spanStart: `<span class="text-tertiary">`,
spanEnd: `</span>`,
},
false,
)
: ''; : '';
}, },
errorInfo() {
return `${this.errorFnText} ${this.errorPositionText}`;
},
}, },
methods: { methods: {
isHighlighted(lineNum) { isHighlighted(lineNum) {
...@@ -102,8 +122,7 @@ export default { ...@@ -102,8 +122,7 @@ export default {
<strong <strong
v-gl-tooltip v-gl-tooltip
:title="filePath" :title="filePath"
class="file-title-name d-inline-block overflow-hidden text-truncate" class="file-title-name d-inline-block overflow-hidden text-truncate limited-width"
:class="{ 'limited-width': !hasCode }"
data-container="body" data-container="body"
> >
{{ filePath }} {{ filePath }}
...@@ -113,7 +132,7 @@ export default { ...@@ -113,7 +132,7 @@ export default {
:text="filePath" :text="filePath"
css-class="btn-default btn-transparent btn-clipboard position-static" css-class="btn-default btn-transparent btn-clipboard position-static"
/> />
<span v-if="!hasCode" class="text-tertiary">{{ noCodeFn }}{{ noCodeLine }}</span> <span v-html="errorInfo"></span>
</div> </div>
</div> </div>
......
...@@ -222,7 +222,7 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -222,7 +222,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Disable form buttons while a form is submitting // Disable form buttons while a form is submitting
$body.on('ajax:complete, ajax:beforeSend, submit', 'form', function ajaxCompleteCallback(e) { $body.on('ajax:complete, ajax:beforeSend, submit', 'form', function ajaxCompleteCallback(e) {
const $buttons = $('[type="submit"], .js-disable-on-submit', this); const $buttons = $('[type="submit"], .js-disable-on-submit', this).not('.js-no-auto-disable');
switch (e.type) { switch (e.type) {
case 'ajax:beforeSend': case 'ajax:beforeSend':
case 'submit': case 'submit':
......
...@@ -5,6 +5,7 @@ import FileTable from './table/index.vue'; ...@@ -5,6 +5,7 @@ import FileTable from './table/index.vue';
import getRefMixin from '../mixins/get_ref'; import getRefMixin from '../mixins/get_ref';
import getFiles from '../queries/getFiles.query.graphql'; import getFiles from '../queries/getFiles.query.graphql';
import getProjectPath from '../queries/getProjectPath.query.graphql'; import getProjectPath from '../queries/getProjectPath.query.graphql';
import getVueFileListLfsBadge from '../queries/getVueFileListLfsBadge.query.graphql';
import FilePreview from './preview/index.vue'; import FilePreview from './preview/index.vue';
import { readmeFile } from '../utils/readme'; import { readmeFile } from '../utils/readme';
...@@ -20,6 +21,9 @@ export default { ...@@ -20,6 +21,9 @@ export default {
projectPath: { projectPath: {
query: getProjectPath, query: getProjectPath,
}, },
vueFileListLfsBadge: {
query: getVueFileListLfsBadge,
},
}, },
props: { props: {
path: { path: {
...@@ -43,6 +47,7 @@ export default { ...@@ -43,6 +47,7 @@ export default {
blobs: [], blobs: [],
}, },
isLoadingFiles: false, isLoadingFiles: false,
vueFileListLfsBadge: false,
}; };
}, },
computed: { computed: {
...@@ -77,6 +82,7 @@ export default { ...@@ -77,6 +82,7 @@ export default {
path: this.path || '/', path: this.path || '/',
nextPageCursor: this.nextPageCursor, nextPageCursor: this.nextPageCursor,
pageSize: PAGE_SIZE, pageSize: PAGE_SIZE,
vueLfsEnabled: this.vueFileListLfsBadge,
}, },
}) })
.then(({ data }) => { .then(({ data }) => {
......
...@@ -23,6 +23,7 @@ export default function setupVueRepositoryList() { ...@@ -23,6 +23,7 @@ export default function setupVueRepositoryList() {
projectPath, projectPath,
projectShortPath, projectShortPath,
ref, ref,
vueFileListLfsBadge: gon?.features?.vueFileListLfsBadge,
commits: [], commits: [],
}, },
}); });
......
...@@ -14,6 +14,7 @@ query getFiles( ...@@ -14,6 +14,7 @@ query getFiles(
$ref: String! $ref: String!
$pageSize: Int! $pageSize: Int!
$nextPageCursor: String $nextPageCursor: String
$vueLfsEnabled: Boolean = false
) { ) {
project(fullPath: $projectPath) { project(fullPath: $projectPath) {
repository { repository {
...@@ -46,7 +47,7 @@ query getFiles( ...@@ -46,7 +47,7 @@ query getFiles(
node { node {
...TreeEntry ...TreeEntry
webUrl webUrl
lfsOid lfsOid @include(if: $vueLfsEnabled)
} }
} }
pageInfo { pageInfo {
......
query getProjectShortPath {
vueFileListLfsBadge @client
}
...@@ -15,6 +15,10 @@ class Projects::TreeController < Projects::ApplicationController ...@@ -15,6 +15,10 @@ class Projects::TreeController < Projects::ApplicationController
before_action :authorize_download_code! before_action :authorize_download_code!
before_action :authorize_edit_tree!, only: [:create_dir] before_action :authorize_edit_tree!, only: [:create_dir]
before_action only: [:show] do
push_frontend_feature_flag(:vue_file_list_lfs_badge)
end
def show def show
return render_404 unless @repository.commit(@ref) return render_404 unless @repository.commit(@ref)
......
...@@ -266,7 +266,7 @@ module Ci ...@@ -266,7 +266,7 @@ module Ci
end end
before_transition on: :enqueue_preparing do |build| before_transition on: :enqueue_preparing do |build|
build.any_unmet_prerequisites? # If false is returned, it stops the transition !build.any_unmet_prerequisites? # If false is returned, it stops the transition
end end
after_transition created: :scheduled do |build| after_transition created: :scheduled do |build|
......
...@@ -11,6 +11,8 @@ module Clusters ...@@ -11,6 +11,8 @@ module Clusters
def on_success def on_success
app.make_installed! app.make_installed!
Gitlab::Tracking.event('cluster:applications', "cluster_application_#{app.name}_installed")
ensure ensure
remove_installation_pod remove_installation_pod
end end
......
---
title: Prevent builds from halting unnecessarily when completing prerequisites
merge_request: 22938
author:
type: fixed
---
title: Display fn, line num and column in stacktrace entry caption
merge_request: 22905
author:
type: added
---
title: Gracefully handle marking a project deletion multiple times
merge_request: 22949
author:
type: fixed
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
- cloud_native_installation - cloud_native_installation
- cluster_cost_optimization - cluster_cost_optimization
- cluster_monitoring - cluster_monitoring
- code_analytics
- code_quality - code_quality
- code_review - code_review
- collection - collection
......
...@@ -35,7 +35,7 @@ production: &base ...@@ -35,7 +35,7 @@ production: &base
https: false # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details https: false # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details
# The maximum time unicorn/puma can spend on the request. This needs to be smaller than the worker timeout. # The maximum time unicorn/puma can spend on the request. This needs to be smaller than the worker timeout.
# Default is 95% of the worker timeout # Default is 95% of the worker timeout
max_request_duration: 57 max_request_duration_seconds: 57
# Uncomment this line below if your ssh host is different from HTTP/HTTPS one # Uncomment this line below if your ssh host is different from HTTP/HTTPS one
# (you'd obviously need to replace ssh.host_example.com with your own host). # (you'd obviously need to replace ssh.host_example.com with your own host).
......
...@@ -123,6 +123,20 @@ a single node only, rather than as a PostgreSQL cluster. ...@@ -123,6 +123,20 @@ a single node only, rather than as a PostgreSQL cluster.
Configure the [**secondary** database](database.md) as a read-only replica of Configure the [**secondary** database](database.md) as a read-only replica of
the **primary** database. Use the following as a guide. the **primary** database. Use the following as a guide.
1. Generate an MD5 hash of the desired password for the database user that the
GitLab application will use to access the read-replica database:
Note that the username (`gitlab` by default) is incorporated into the hash.
```sh
gitlab-ctl pg-password-md5 gitlab
# Enter password: <your_password_here>
# Confirm password: <your_password_here>
# fca0b89a972d69f00eb3ec98a5838484
```
Use this hash to fill in `<md5_hash_of_your_password>` in the next step.
1. Edit `/etc/gitlab/gitlab.rb` in the replica database machine, and add the 1. Edit `/etc/gitlab/gitlab.rb` in the replica database machine, and add the
following: following:
...@@ -167,6 +181,22 @@ only a single machine, rather than as a PostgreSQL cluster. ...@@ -167,6 +181,22 @@ only a single machine, rather than as a PostgreSQL cluster.
Configure the tracking database. Configure the tracking database.
1. Generate an MD5 hash of the desired password for the database user that the
GitLab application will use to access the tracking database:
Note that the username (`gitlab_geo` by default) is incorporated into the
hash.
```sh
gitlab-ctl pg-password-md5 gitlab_geo
# Enter password: <your_password_here>
# Confirm password: <your_password_here>
# fca0b89a972d69f00eb3ec98a5838484
```
Use this hash to fill in `<tracking_database_password_md5_hash>` in the next
step.
1. Edit `/etc/gitlab/gitlab.rb` in the tracking database machine, and add the 1. Edit `/etc/gitlab/gitlab.rb` in the tracking database machine, and add the
following: following:
......
...@@ -494,16 +494,55 @@ The following steps are for Omnibus installs only. Using Geo with source-based i ...@@ -494,16 +494,55 @@ The following steps are for Omnibus installs only. Using Geo with source-based i
To check the configuration: To check the configuration:
1. SSH into an app node in the **secondary**:
```sh
sudo -i
```
Note: An app node is any machine running at least one of the following services:
- `puma`
- `unicorn`
- `sidekiq`
- `geo-logcursor`
1. Enter the database console: 1. Enter the database console:
If the tracking database is running on the same node:
```sh ```sh
gitlab-geo-psql gitlab-geo-psql
``` ```
1. Check whether any tables are present. If everything is working, you Or, if the tracking database is running on a different node, you must specify
should see something like this: the user and host when entering the database console:
```sh
gitlab-geo-psql -U gitlab_geo -h <IP of tracking database>
```
You will be prompted for the password of the `gitlab_geo` user. You can find
it in plaintext in `/etc/gitlab/gitlab.rb` at:
```ruby
geo_secondary['db_password'] = '<geo_tracking_db_password>'
```
This password is normally set on the tracking database during
[Step 3: Configure the tracking database on the secondary node](high_availability.md#step-3-configure-the-tracking-database-on-the-secondary-node),
and it is set on the app nodes during
[Step 4: Configure the frontend application servers on the secondary node](high_availability.md#step-4-configure-the-frontend-application-servers-on-the-secondary-node).
1. Check whether any tables are present with the following statement:
```sql ```sql
SELECT * from information_schema.foreign_tables;
```
If everything is working, you should see something like this:
```
gitlabhq_geo_production=# SELECT * from information_schema.foreign_tables; gitlabhq_geo_production=# SELECT * from information_schema.foreign_tables;
foreign_table_catalog | foreign_table_schema | foreign_table_name | foreign_server_catalog | foreign_server_name foreign_table_catalog | foreign_table_schema | foreign_table_name | foreign_server_catalog | foreign_server_name
-------------------------+----------------------+-------------------------------------------------+-------------------------+--------------------- -------------------------+----------------------+-------------------------------------------------+-------------------------+---------------------
...@@ -519,7 +558,7 @@ To check the configuration: ...@@ -519,7 +558,7 @@ To check the configuration:
1. Check that the foreign server mapping is correct via `\des+`. The 1. Check that the foreign server mapping is correct via `\des+`. The
results should look something like this: results should look something like this:
```sql ```
gitlabhq_geo_production=# \des+ gitlabhq_geo_production=# \des+
List of foreign servers List of foreign servers
-[ RECORD 1 ]--------+------------------------------------------------------------ -[ RECORD 1 ]--------+------------------------------------------------------------
...@@ -555,7 +594,7 @@ To check the configuration: ...@@ -555,7 +594,7 @@ To check the configuration:
1. Check that the user mapping is configured properly via `\deu+`: 1. Check that the user mapping is configured properly via `\deu+`:
```sql ```
gitlabhq_geo_production=# \deu+ gitlabhq_geo_production=# \deu+
List of user mappings List of user mappings
Server | User name | FDW Options Server | User name | FDW Options
......
...@@ -185,9 +185,9 @@ their color is `#428BCA`. ...@@ -185,9 +185,9 @@ their color is `#428BCA`.
`<Category Name>` is the category name as it is in the single source of truth for categories at `<Category Name>` is the category name as it is in the single source of truth for categories at
<https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/categories.yml>. <https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/data/categories.yml>.
For instance, the "Code Analytics" category is represented by the For instance, the "DevOps Score" category is represented by the
~"Category:Code Analytics" label in the `gitlab-org` group since its ~"Category:DevOps Score" label in the `gitlab-org` group since its
`code_analytics.name` value is "Code Analytics". `devops_score.name` value is "DevOps Score".
If a category's label doesn't respect this naming convention, it should be specified If a category's label doesn't respect this naming convention, it should be specified
with [the `label` attribute](https://about.gitlab.com/handbook/marketing/website/#category-attributes) with [the `label` attribute](https://about.gitlab.com/handbook/marketing/website/#category-attributes)
......
...@@ -73,3 +73,8 @@ Ensure a [Product Designer](https://about.gitlab.com/company/team/?department=ux ...@@ -73,3 +73,8 @@ Ensure a [Product Designer](https://about.gitlab.com/company/team/?department=ux
reviews the use of the non-conforming component as part of the MR review. Make a reviews the use of the non-conforming component as part of the MR review. Make a
follow up issue and attach it to the component implementation epic found within the follow up issue and attach it to the component implementation epic found within the
[Components of Pajamas Design System epic](https://gitlab.com/groups/gitlab-org/-/epics/973). [Components of Pajamas Design System epic](https://gitlab.com/groups/gitlab-org/-/epics/973).
### 4. My submit form button becomes disabled after submitting
If you are using a submit button inside a form and you attach an `onSubmit` event listener on the form element, [this piece of code](https://gitlab.com/gitlab-org/gitlab/blob/794c247a910e2759ce9b401356432a38a4535d49/app/assets/javascripts/main.js#L225) will add a `disabled` class selector to the submit button when the form is submitted.
To avoid this behavior, add the class `js-no-auto-disable` to the button.
...@@ -373,6 +373,12 @@ msgstr "" ...@@ -373,6 +373,12 @@ msgstr ""
msgid "%{spammable_titlecase} was submitted to Akismet successfully." msgid "%{spammable_titlecase} was submitted to Akismet successfully."
msgstr "" msgstr ""
msgid "%{spanStart}at line%{spanEnd} %{errorLine}%{errorColumn}"
msgstr ""
msgid "%{spanStart}in%{spanEnd} %{errorFn}"
msgstr ""
msgid "%{start} to %{end}" msgid "%{start} to %{end}"
msgstr "" msgstr ""
...@@ -4544,9 +4550,6 @@ msgstr "" ...@@ -4544,9 +4550,6 @@ msgstr ""
msgid "Code" msgid "Code"
msgstr "" msgstr ""
msgid "Code Analytics"
msgstr ""
msgid "Code Owners" msgid "Code Owners"
msgstr "" msgstr ""
...@@ -21522,9 +21525,6 @@ msgstr "" ...@@ -21522,9 +21525,6 @@ msgstr ""
msgid "assign yourself" msgid "assign yourself"
msgstr "" msgstr ""
msgid "at line %{errorLine}%{errorColumn}"
msgstr ""
msgid "attach a new file" msgid "attach a new file"
msgstr "" msgstr ""
...@@ -21997,9 +21997,6 @@ msgstr "" ...@@ -21997,9 +21997,6 @@ msgstr ""
msgid "importing" msgid "importing"
msgstr "" msgstr ""
msgid "in %{errorFn} "
msgstr ""
msgid "in group %{link_to_group}" msgid "in group %{link_to_group}"
msgstr "" msgstr ""
......
...@@ -46,8 +46,8 @@ describe('Stacktrace Entry', () => { ...@@ -46,8 +46,8 @@ describe('Stacktrace Entry', () => {
expect(wrapper.findAll('.line_content.old').length).toBe(1); expect(wrapper.findAll('.line_content.old').length).toBe(1);
}); });
describe('no code block', () => { describe('entry caption', () => {
const findFileHeaderContent = () => wrapper.find('.file-header-content').html(); const findFileHeaderContent = () => wrapper.find('.file-header-content').text();
it('should hide collapse icon and render error fn name and error line when there is no code block', () => { it('should hide collapse icon and render error fn name and error line when there is no code block', () => {
const extraInfo = { errorLine: 34, errorFn: 'errorFn', errorColumn: 77 }; const extraInfo = { errorLine: 34, errorFn: 'errorFn', errorColumn: 77 };
......
...@@ -341,6 +341,36 @@ describe Ci::Build do ...@@ -341,6 +341,36 @@ describe Ci::Build do
end end
end end
describe '#enqueue_preparing' do
let(:build) { create(:ci_build, :preparing) }
subject { build.enqueue_preparing }
before do
allow(build).to receive(:any_unmet_prerequisites?).and_return(has_unmet_prerequisites)
end
context 'build completed prerequisites' do
let(:has_unmet_prerequisites) { false }
it 'transitions to pending' do
subject
expect(build).to be_pending
end
end
context 'build did not complete prerequisites' do
let(:has_unmet_prerequisites) { true }
it 'remains in preparing' do
subject
expect(build).to be_preparing
end
end
end
describe '#actionize' do describe '#actionize' do
context 'when build is a created' do context 'when build is a created' do
before do before do
......
...@@ -160,6 +160,12 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do ...@@ -160,6 +160,12 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do
expect(application).to be_installed expect(application).to be_installed
expect(application.status_reason).to be_nil expect(application.status_reason).to be_nil
end end
it 'tracks application install' do
expect(Gitlab::Tracking).to receive(:event).with('cluster:applications', "cluster_application_helm_installed")
service.execute
end
end end
context 'when installation POD failed' do context 'when installation POD failed' do
......
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