Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
809afc54
Commit
809afc54
authored
May 18, 2018
by
Olivier Gonzalez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename code quality job and artifact. Refs #5779
parent
06adb05e
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
28 additions
and
34 deletions
+28
-34
.gitlab-ci.yml
.gitlab-ci.yml
+2
-2
doc/ci/examples/code_climate.md
doc/ci/examples/code_climate.md
+6
-6
doc/topics/autodevops/index.md
doc/topics/autodevops/index.md
+2
-2
doc/topics/autodevops/quick_start_guide.md
doc/topics/autodevops/quick_start_guide.md
+2
-2
doc/user/project/merge_requests/code_quality_diff.md
doc/user/project/merge_requests/code_quality_diff.md
+4
-10
ee/app/models/ee/ci/build.rb
ee/app/models/ee/ci/build.rb
+2
-2
ee/spec/models/ci/build_spec.rb
ee/spec/models/ci/build_spec.rb
+4
-4
ee/spec/models/ci/pipeline_spec.rb
ee/spec/models/ci/pipeline_spec.rb
+1
-1
spec/javascripts/pipelines/mock_data.js
spec/javascripts/pipelines/mock_data.js
+1
-1
vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
+4
-4
No files found.
.gitlab-ci.yml
View file @
809afc54
...
...
@@ -856,7 +856,7 @@ karma:
-
chrome_debug.log
-
coverage-javascript/
codequality
:
code
_
quality
:
<<
:
*dedicated-no-docs-no-db-pull-cache-job
image
:
docker:stable
allow_failure
:
true
...
...
@@ -876,7 +876,7 @@ codequality:
-
export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
-
docker run --env SOURCE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts
:
paths
:
[
codeclimate
.json
]
paths
:
[
gl-code-quality-report
.json
]
expire_in
:
1 week
sast
:
...
...
doc/ci/examples/code_climate.md
View file @
809afc54
...
...
@@ -5,10 +5,10 @@ GitLab CI and Docker.
First, you need GitLab Runner with
[
docker-in-docker executor
][
dind
]
.
Once you set up the Runner, add a new job to
`.gitlab-ci.yml`
, called
`codequality`
:
Once you set up the Runner, add a new job to
`.gitlab-ci.yml`
, called
`code
_
quality`
:
```
yaml
codequality
:
code
_
quality
:
image
:
docker:stable
variables
:
DOCKER_DRIVER
:
overlay2
...
...
@@ -23,18 +23,18 @@ codequality:
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts
:
paths
:
[
codeclimate
.json
]
paths
:
[
gl-code-quality-report
.json
]
```
The above example will create a
`codequality`
job in your CI/CD pipeline which
The above example will create a
`code
_
quality`
job in your CI/CD pipeline which
will scan your source code for code quality issues. The report will be saved
as an artifact that you can later download and analyze.
TIP:
**Tip:**
Starting with
[
GitLab Starter
][
ee
]
9.3, this information will
be automatically extracted and shown right in the merge request widget. To do
so, the CI/CD job must be named
`codequality`
and the artifact path must be
`
codeclimate
.json`
.
so, the CI/CD job must be named
`code
_
quality`
and the artifact path must be
`
gl-code-quality-report
.json`
.
[
Learn more on code quality diffs in merge requests
](
https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html
)
.
[
cli
]:
https://github.com/codeclimate/codeclimate
...
...
doc/topics/autodevops/index.md
View file @
809afc54
...
...
@@ -220,8 +220,8 @@ tests, it's up to you to add them.
### Auto Code Quality
Auto Code Quality uses the
open source
[
`codeclimate` image
](
https://hub.docker.com/r/codeclimate/codeclimate/
)
to run
Auto Code Quality uses the
[
Code Quality image
](
https://gitlab.com/gitlab-org/security-products/codequality
)
to run
static analysis and other code checks on the current code. The report is
created, and is uploaded as an artifact which you can later download and check
out.
...
...
doc/topics/autodevops/quick_start_guide.md
View file @
809afc54
...
...
@@ -126,10 +126,10 @@ Next, a pipeline needs to be triggered. Since the test project doesn't have a
manually visit
`https://gitlab.com/<username>/minimal-ruby-app/pipelines/new`
,
where
`<username>`
is your username.
This will create a new pipeline with several jobs:
`build`
,
`test`
,
`codequality`
,
This will create a new pipeline with several jobs:
`build`
,
`test`
,
`code
_
quality`
,
and
`production`
. The
`build`
job will create a Docker image with your new
change and push it to the Container Registry. The
`test`
job will test your
changes, whereas the
`codequality`
job will run static analysis on your changes.
changes, whereas the
`code
_
quality`
job will run static analysis on your changes.
Finally, the
`production`
job will deploy your changes to a production application.
Once the deploy job succeeds you should be able to see your application by
...
...
doc/user/project/merge_requests/code_quality_diff.md
View file @
809afc54
...
...
@@ -27,25 +27,19 @@ For instance, consider the following workflow:
## How it works
>**Note:**
In
[
GitLab Starter
][
ee
]
10.0, another job name will
also be supported:
`codequality`
. This new job name will eventually replace
`codeclimate`
which is scheduled to be removed in GitLab 11.0. You are advised
to update your current
`.gitlab-ci.yml`
configuration to reflect that change.
In order for the report to show in the merge request, you need to specify a
`codequality`
job (exact name) that will analyze the code and upload the resulting
`
codeclimate
.json`
as an artifact. GitLab will then check this file and show
`code
_
quality`
job (exact name) that will analyze the code and upload the resulting
`
gl-code-quality-report
.json`
as an artifact. GitLab will then check this file and show
the information inside the merge request.
>**Note:**
If the Code Climate report doesn't have anything to compare to, no information
will be displayed in the merge request area. That is the case when you add the
`codequality`
job in your
`.gitlab-ci.yml`
for the very first time.
`code
_
quality`
job in your
`.gitlab-ci.yml`
for the very first time.
Consecutive merge requests will have something to compare to and the code quality
report will be shown properly.
For more information on how the
`codequality`
job should look like, check the
For more information on how the
`code
_
quality`
job should look like, check the
example on
[
analyzing a project's code quality with Code Climate CLI
][
cc-docs
]
.
[
ee-1984
]:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1984
...
...
ee/app/models/ee/ci/build.rb
View file @
809afc54
...
...
@@ -7,7 +7,7 @@ module EE
module
Build
extend
ActiveSupport
::
Concern
CODEQUALITY_FILE
=
'
codeclimate
.json'
.
freeze
CODEQUALITY_FILE
=
'
gl-code-quality-report
.json'
.
freeze
DEPENDENCY_SCANNING_FILE
=
'gl-dependency-scanning-report.json'
.
freeze
LICENSE_MANAGEMENT_FILE
=
'gl-license-report.json'
.
freeze
SAST_FILE
=
'gl-sast-report.json'
.
freeze
...
...
@@ -18,7 +18,7 @@ module EE
DAST_FILE
=
'gl-dast-report.json'
.
freeze
included
do
scope
:codequality
,
->
{
where
(
name:
%w[code
quality codeclimate
]
)
}
scope
:codequality
,
->
{
where
(
name:
%w[code
_quality codequality
]
)
}
scope
:performance
,
->
{
where
(
name:
%w[performance deploy]
)
}
scope
:sast
,
->
{
where
(
name:
'sast'
)
}
scope
:dependency_scanning
,
->
{
where
(
name:
'dependency_scanning'
)
}
...
...
ee/spec/models/ci/build_spec.rb
View file @
809afc54
...
...
@@ -16,14 +16,14 @@ describe Ci::Build do
describe
'.codequality'
do
subject
{
described_class
.
codequality
}
context
'when a job name is codequality'
do
let!
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'codequality'
)
}
context
'when a job name is code
_
quality'
do
let!
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'code
_
quality'
)
}
it
{
is_expected
.
to
include
(
job
)
}
end
context
'when a job name is code
climate
'
do
let!
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'code
climate
'
)
}
context
'when a job name is code
quality
'
do
let!
(
:job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'code
quality
'
)
}
it
{
is_expected
.
to
include
(
job
)
}
end
...
...
ee/spec/models/ci/pipeline_spec.rb
View file @
809afc54
...
...
@@ -54,7 +54,7 @@ describe Ci::Pipeline do
it
{
expect
(
pipeline
.
send
(
method
)).
to
eq
(
build
)
}
end
context
'no codequality job'
do
context
'no code
_
quality job'
do
before
do
create
(
:ci_build
,
pipeline:
pipeline
)
end
...
...
spec/javascripts/pipelines/mock_data.js
View file @
809afc54
...
...
@@ -217,7 +217,7 @@ export const pipelineWithStages = {
browse_path
:
'
/gitlab-org/gitlab-ee/-/jobs/62411442/artifacts/browse
'
,
},
{
name
:
'
codequality
'
,
name
:
'
code
_
quality
'
,
expired
:
false
,
expire_at
:
'
2018-04-18T14:16:24.484Z
'
,
path
:
'
/gitlab-org/gitlab-ee/-/jobs/62411441/artifacts/download
'
,
...
...
vendor/gitlab-ci-yml/Auto-DevOps.gitlab-ci.yml
View file @
809afc54
...
...
@@ -77,7 +77,7 @@ test:
only
:
-
branches
codequality
:
code
_
quality
:
image
:
docker:stable
variables
:
DOCKER_DRIVER
:
overlay2
...
...
@@ -86,9 +86,9 @@ codequality:
-
docker:stable-dind
script
:
-
setup_docker
-
code
climate
-
code
_quality
artifacts
:
paths
:
[
codeclimate
.json
]
paths
:
[
gl-code-quality-report
.json
]
performance
:
stage
:
performance
...
...
@@ -409,7 +409,7 @@ rollout 100%:
./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-container-scanning-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true
}
function code
climate
() {
function code
_quality
() {
docker run --env SOURCE_CODE="$PWD" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment