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

Add latest changes from gitlab-org/gitlab@master

parent 8191b157
No related branches found
No related tags found
No related merge requests found
Showing
with 288 additions and 56 deletions
Loading
Loading
@@ -4987,6 +4987,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "descendantWeightSum",
"description": "Total weight of open and closed issues in the epic and its descendants. Available only when feature flag `unfiltered_epic_aggregates` is enabled.",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "EpicDescendantWeights",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "description",
"description": "Description of the epic",
Loading
Loading
@@ -9737,6 +9751,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "healthStatus",
"description": "Current health status. Available only when feature flag `save_issuable_health_status` is enabled.",
"args": [
],
"type": {
"kind": "ENUM",
"name": "HealthStatus",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": "Global ID of the epic-issue relation",
Loading
Loading
@@ -11117,6 +11145,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "healthStatus",
"description": "Current health status. Available only when feature flag `save_issuable_health_status` is enabled.",
"args": [
],
"type": {
"kind": "ENUM",
"name": "HealthStatus",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "iid",
"description": "Internal ID of the issue",
Loading
Loading
@@ -13098,6 +13140,47 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "EpicDescendantWeights",
"description": "Total weight of open and closed descendant issues",
"fields": [
{
"name": "closedIssues",
"description": "Total weight of completed (closed) issues in this epic, including epic descendants",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "openedIssues",
"description": "Total weight of opened issues in this epic, including epic descendants",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "EpicHealthStatus",
Loading
Loading
Loading
Loading
@@ -61,14 +61,20 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/ap
Status can be one of:
 
- `none`
- `queued`
- `started`
- `after_export_action`
- `finished`
- `regeneration_in_progress`
 
The `after_export_action` state represents that the export process has been completed successfully and
the platform is performing some actions on the resulted file. For example, sending
an email notifying the user to download the file, uploading the exported file
to a web server, etc.
`queued` state represents the request for export is received, and is currently in the queue to be processed.
The `started` state represents that the export process has started and is currently in progress.
It includes the process of exporting, actions performed on the resultant file such as sending
an email notifying the user to download the file, uploading the exported file to a web server, etc.
`finished` state is after the export process has completed and the user has been notified.
`regeneration_in_progress` is when an export file is available to download, and a request to generate a new export is in process.
 
`_links` are only present when export has finished.
 
Loading
Loading
Loading
Loading
@@ -19,7 +19,26 @@ to GitLab!
If you have questions that are not answered here, the [GitLab community forum](https://forum.gitlab.com/)
can be a great resource.
 
## Important differences
## Managing the organizational transition
An important part of transitioning from Jenkins to GitLab is the cultural and organizational
changes that comes with the move, and successfully managing them. There are a few
things we have found that helps this:
- Setting and communicating a clear vision of what your migration goals are helps
your users understand why the effort is worth it. The value will be clear when
the work is done, but people need to be aware while it's in progress too.
- Sponsorship and alignment from the relevant leadership team helps with the point above.
- Spending time educating your users on what's different, sharing this document with them,
and so on will help ensure you are successful.
- Finding ways to sequence or delay parts of the migration can help a lot, but you
don't want to leave things in a non-migrated (or partially-migrated) state for too
long. To gain all the benefits of GitLab, moving your existing Jenkins setup over
as-is, including any current problems, will not be enough. You need to take advantage
of the improvements that GitLab offers, and this requires (eventually) updating
your implementation as part of the transition.
## Important product differences
 
There are some high level differences between the products worth mentioning:
 
Loading
Loading
Loading
Loading
@@ -56,7 +56,7 @@ All labels, their meaning and priority are defined on the
[labels page](https://gitlab.com/gitlab-org/gitlab/-/labels).
 
If you come across an issue that has none of these, and you're allowed to set
labels, you can _always_ add the team and type, and often also the subject.
labels, you can _always_ add the type, stage, group, and often the category/feature labels.
 
### Type labels
 
Loading
Loading
@@ -75,7 +75,7 @@ A number of type labels have a priority assigned to them, which automatically
makes them float to the top, depending on their importance.
 
Type labels are always lowercase, and can have any color, besides blue (which is
already reserved for subject labels).
already reserved for category labels).
 
The descriptions on the [labels page](https://gitlab.com/groups/gitlab-org/-/labels)
explain what falls under each type label.
Loading
Loading
Loading
Loading
@@ -476,7 +476,7 @@ as the list item. This can be done with:
Items nested in lists should always align with the first character of the list item.
In unordered lists (using `-`), this means two spaces for each level of indentation:
 
~~~md
````markdown
- Unordered list item 1
 
A line nested using 2 spaces to align with the `U` above.
Loading
Loading
@@ -495,11 +495,11 @@ In unordered lists (using `-`), this means two spaces for each level of indentat
- Unordered list item 4
 
![an image that will nest inside list item 4](image.png)
~~~
````
 
For ordered lists, use three spaces for each level of indentation:
 
~~~md
````markdown
1. Ordered list item 1
 
A line nested using 3 spaces to align with the `O` above.
Loading
Loading
@@ -518,7 +518,7 @@ For ordered lists, use three spaces for each level of indentation:
1. Ordered list item 4
 
![an image that will nest inside list item 4](image.png)
~~~
````
 
You can nest full lists inside other lists using the same rules as above. If you wish
to mix types, that is also possible, as long as you don't mix items at the same level:
Loading
Loading
@@ -1364,7 +1364,7 @@ on this document. Further explanation is given below.
 
The following can be used as a template to get started:
 
~~~md
````markdown
## Descriptive title
 
One or two sentence description of what endpoint does.
Loading
Loading
@@ -1392,7 +1392,7 @@ Example response:
}
]
```
~~~
````
 
### Fake tokens
 
Loading
Loading
doc/user/application_security/img/outdated_report_branch_v12_9.png

14.8 KiB

doc/user/application_security/img/outdated_report_pipeline_v12_9.png

16.3 KiB

Loading
Loading
@@ -198,6 +198,35 @@ An approval is optional when a license report:
- Contains no software license violations.
- Contains only new licenses that are `approved` or unknown.
 
## Outdated security reports
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/4913) in GitLab 12.7.
When a security report generated for a merge request becomes outdated, the merge request shows a warning
message in the security widget and prompts you to take an appropriate action.
This can happen in two scenarios:
1. Your [source branch is behind the target branch](#source-branch-is-behind-the-target-branch).
1. The [target branch security report is out of date](#target-branch-security-report-is-out-of-date).
### Source branch is behind the target branch
This means the most recent common ancestor commit between the target branch and the source branch is
not the most recent commit on the target branch. This is by far the most common situation.
In this case you must rebase or merge to incorporate the changes from the target branch.
![Incorporate target branch changes](img/outdated_report_branch_v12_9.png)
### Target branch security report is out of date
This can happen for many reasons, including failed jobs or new advisories. When the merge request shows that a
security report is out of date, you must run a new pipeline on the target branch.
You can do it quickly by following the hyperlink given to run a new pipeline.
![Run a new pipeline](img/outdated_report_pipeline_v12_9.png)
## Troubleshooting
 
### Getting error message `sast job: stage parameter should be [some stage name here]`
Loading
Loading
Loading
Loading
@@ -282,11 +282,11 @@ source - a listing that is embellished with (colorized) syntax highlighting
----
```
 
~~~asciidoc
````asciidoc
\```language
fenced code - a shorthand syntax for the source block
\```
~~~
````
 
```asciidoc
[,attribution,citetitle]
Loading
Loading
Loading
Loading
@@ -165,7 +165,7 @@ Visit the [official page](https://mermaidjs.github.io/) for more details. If you
 
In order to generate a diagram or flowchart, you should write your text inside the `mermaid` block:
 
~~~
````markdown
```mermaid
graph TD;
A-->B;
Loading
Loading
@@ -173,7 +173,7 @@ graph TD;
B-->D;
C-->D;
```
~~~
````
 
```mermaid
graph TD;
Loading
Loading
@@ -185,7 +185,7 @@ graph TD;
 
Subgraphs can also be included:
 
~~~
````markdown
```mermaid
graph TB
 
Loading
Loading
@@ -202,7 +202,7 @@ graph TB
SubGraph1 --> FinalThing[Final Thing]
end
```
~~~
````
 
```mermaid
graph TB
Loading
Loading
@@ -280,27 +280,27 @@ The following delimiters are supported:
 
- YAML (`---`):
 
~~~yaml
```yaml
---
title: About Front Matter
example:
language: yaml
---
~~~
```
 
- TOML (`+++`):
 
~~~toml
```toml
+++
title = "About Front Matter"
[example]
language = "toml"
+++
~~~
```
 
- JSON (`;;;`):
 
~~~json
```json
;;;
{
"title": "About Front Matter"
Loading
Loading
@@ -309,7 +309,7 @@ The following delimiters are supported:
}
}
;;;
~~~
```
 
Other languages are supported by adding a specifier to any of the existing
delimiters. For example:
Loading
Loading
@@ -364,7 +364,7 @@ Math written between dollar signs `$` will be rendered inline with the text. Mat
inside a [code block](#code-spans-and-blocks) with the language declared as `math`, will be rendered
on a separate line:
 
~~~
````markdown
This math is inline $`a^2+b^2=c^2`$.
 
This is on a separate line
Loading
Loading
@@ -372,7 +372,7 @@ This is on a separate line
```math
a^2+b^2=c^2
```
~~~
````
 
This math is inline $`a^2+b^2=c^2`$.
 
Loading
Loading
@@ -613,12 +613,12 @@ Inline `code` has `back-ticks around` it.
 
---
 
Similarly, a whole block of code can be fenced with triple backticks ```` ``` ````,
Similarly, a whole block of code can be fenced with triple backticks (```` ``` ````),
triple tildes (`~~~`), or indented 4 or more spaces to achieve a similar effect for
a larger body of code.
 
~~~
```
````markdown
```python
def function():
#indenting works just fine in the fenced code block
s = "Python code"
Loading
Loading
@@ -628,7 +628,7 @@ def function():
Using 4 spaces
is like using
3-backtick fences.
~~~
````
 
```plaintext
~~~
Loading
Loading
@@ -651,9 +651,9 @@ is like using
3-backtick fences.
```
 
~~~plaintext
```plaintext
Tildes are OK too.
~~~
```
 
#### Colored code and syntax highlighting
 
Loading
Loading
@@ -665,10 +665,10 @@ highlighting in code blocks. For a list of supported languages visit the
Syntax highlighting is only supported in code blocks, it is not possible to highlight
code when it is inline.
 
Blocks of code are fenced by lines with three back-ticks ```` ``` ```` or three tildes `~~~`, and have
Blocks of code are fenced by lines with three back-ticks (```` ``` ````) or three tildes (`~~~`), and have
the language identified at the end of the first fence:
 
~~~markdown
````markdown
```javascript
var s = "JavaScript syntax highlighting";
alert(s);
Loading
Loading
@@ -692,7 +692,7 @@ No language indicated, so no syntax highlighting.
s = "There is no highlighting for this."
But let's throw in a <b>tag</b>.
```
~~~
````
 
The four examples above render as:
 
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@ code_quality:
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/security-products/codequality:0.85.6"
CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/security-products/codequality:0.85.9"
script:
- |
if ! docker info &>/dev/null; then
Loading
Loading
Loading
Loading
@@ -105,6 +105,17 @@ module Gitlab
.+?
\n```$
)
|
(?<inline_code>
# Inline code on separate rows:
# `
# Anything, including `/cmd arg` which are ignored by this filter
# `
^.*`\n*
.+?
\n*`$
)
|
(?<html>
# HTML block:
Loading
Loading
Loading
Loading
@@ -8,13 +8,14 @@ namespace :gitlab do
OUTPUT_DIR = Rails.root.join("doc/api/graphql/reference")
TEMPLATES_DIR = 'lib/gitlab/graphql/docs/templates/'
 
# Consider all feature flags disabled
# to avoid pipeline failures in case developer
# dumps schema with flags enabled locally before pushing
task disable_feature_flags: :environment do
# Make all feature flags enabled so that all feature flag
# controlled fields are considered visible and are output.
# Also avoids pipeline failures in case developer
# dumps schema with flags disabled locally before pushing
task enable_feature_flags: :environment do
class Feature
def self.enabled?(*args)
false
true
end
end
end
Loading
Loading
@@ -25,7 +26,7 @@ namespace :gitlab do
# - gitlab:graphql:schema:json
GraphQL::RakeTask.new(
schema_name: 'GitlabSchema',
dependencies: [:environment, :disable_feature_flags],
dependencies: [:environment, :enable_feature_flags],
directory: OUTPUT_DIR,
idl_outfile: "gitlab_schema.graphql",
json_outfile: "gitlab_schema.json"
Loading
Loading
@@ -33,7 +34,7 @@ namespace :gitlab do
 
namespace :graphql do
desc 'GitLab | GraphQL | Generate GraphQL docs'
task compile_docs: :environment do
task compile_docs: [:environment, :enable_feature_flags] do
renderer = Gitlab::Graphql::Docs::Renderer.new(GitlabSchema.graphql_definition, render_options)
 
renderer.write
Loading
Loading
@@ -42,7 +43,7 @@ namespace :gitlab do
end
 
desc 'GitLab | GraphQL | Check if GraphQL docs are up to date'
task check_docs: :environment do
task check_docs: [:environment, :enable_feature_flags] do
renderer = Gitlab::Graphql::Docs::Renderer.new(GitlabSchema.graphql_definition, render_options)
 
doc = File.read(Rails.root.join(OUTPUT_DIR, 'index.md'))
Loading
Loading
@@ -56,7 +57,7 @@ namespace :gitlab do
end
 
desc 'GitLab | GraphQL | Check if GraphQL schemas are up to date'
task check_schema: :environment do
task check_schema: [:environment, :enable_feature_flags] do
idl_doc = File.read(Rails.root.join(OUTPUT_DIR, 'gitlab_schema.graphql'))
json_doc = File.read(Rails.root.join(OUTPUT_DIR, 'gitlab_schema.json'))
 
Loading
Loading
Loading
Loading
@@ -7015,7 +7015,7 @@ msgstr ""
msgid "Display source"
msgstr ""
 
msgid "Displays dependencies and known vulnerabilities, based on the %{linkStart}latest pipeline%{linkEnd} scan"
msgid "Displays dependencies and known vulnerabilities, based on the %{linkStart}latest successful%{linkEnd} scan"
msgstr ""
 
msgid "Do not display offers from third parties within GitLab"
Loading
Loading
@@ -11724,7 +11724,7 @@ msgstr ""
msgid "Licenses|Detected in Project"
msgstr ""
 
msgid "Licenses|Displays licenses detected in the project, based on the %{linkStart}latest pipeline%{linkEnd} scan"
msgid "Licenses|Displays licenses detected in the project, based on the %{linkStart}latest successful%{linkEnd} scan"
msgstr ""
 
msgid "Licenses|Error fetching the license list. Please check your network connection and try again."
Loading
Loading
Loading
Loading
@@ -50,7 +50,7 @@
"apollo-link-batch-http": "^1.2.11",
"apollo-upload-client": "^10.0.0",
"autosize": "^4.0.2",
"aws-sdk": "^2.526.0",
"aws-sdk": "^2.637.0",
"axios": "^0.19.0",
"babel-loader": "^8.0.6",
"babel-plugin-lodash": "^3.3.4",
Loading
Loading
Loading
Loading
@@ -1140,7 +1140,7 @@ describe ProjectsController do
end
 
it 'prevents requesting project export' do
get action, params: { namespace_id: project.namespace, id: project }
post action, params: { namespace_id: project.namespace, id: project }
 
expect(flash[:alert]).to eq('This endpoint has been requested too many times. Try again later.')
expect(response).to have_gitlab_http_status(:found)
Loading
Loading
@@ -1152,7 +1152,7 @@ describe ProjectsController do
 
context 'when project export is enabled' do
it 'returns 302' do
get action, params: { namespace_id: project.namespace, id: project }
post action, params: { namespace_id: project.namespace, id: project }
 
expect(response).to have_gitlab_http_status(:found)
end
Loading
Loading
@@ -1164,7 +1164,7 @@ describe ProjectsController do
end
 
it 'returns 404' do
get action, params: { namespace_id: project.namespace, id: project }
post action, params: { namespace_id: project.namespace, id: project }
 
expect(response).to have_gitlab_http_status(:not_found)
end
Loading
Loading
# frozen_string_literal: true
FactoryBot.define do
factory :project_export_job do
project
jid { SecureRandom.hex(8) }
end
end
Loading
Loading
@@ -94,8 +94,31 @@ describe 'Mermaid rendering', :js do
page.find('summary').click
svg = page.find('svg.mermaid')
 
expect(svg[:width].to_i).to be_within(5).of(120)
expect(svg[:height].to_i).to be_within(5).of(220)
expect(svg[:style]).to match(/max-width/)
expect(svg[:width].to_i).to eq(100)
expect(svg[:height].to_i).to eq(0)
end
end
it 'correctly sizes mermaid diagram block', :js do
description = <<~MERMAID
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
MERMAID
project = create(:project, :public)
issue = create(:issue, project: project, description: description)
visit project_issue_path(project, issue)
svg = page.find('svg.mermaid')
expect(svg[:style]).to match(/max-width/)
expect(svg[:width].to_i).to eq(100)
expect(svg[:height].to_i).to eq(0)
end
end
# frozen_string_literal: true
require 'spec_helper'
describe Projects::ExportJobFinder do
let(:project) { create(:project) }
let(:project_export_job1) { create(:project_export_job, project: project) }
let(:project_export_job2) { create(:project_export_job, project: project) }
describe '#execute' do
subject { described_class.new(project, params).execute }
context 'when queried for a project' do
let(:params) { {} }
it 'scopes to the project' do
expect(subject).to contain_exactly(
project_export_job1, project_export_job2
)
end
end
context 'when queried by job id' do
let(:params) { { jid: project_export_job1.jid } }
it 'filters records' do
expect(subject).to contain_exactly(project_export_job1)
end
end
context 'when queried by status' do
let(:params) { { status: :started } }
before do
project_export_job2.start!
end
it 'filters records' do
expect(subject).to contain_exactly(project_export_job2)
end
end
context 'when queried by invalid status' do
let(:params) { { status: '1234ad' } }
it 'raises exception' do
expect { subject }.to raise_error(described_class::InvalidExportJobStatusError, 'Invalid export job status')
end
end
end
end
Loading
Loading
@@ -13,9 +13,10 @@
"type": "string",
"enum": [
"none",
"queued",
"started",
"finished",
"after_export_action"
"regeneration_in_progress"
]
}
}
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