Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-06-25 03:08:33 +00:00
parent af770ba828
commit c1063d87e0
6 changed files with 39 additions and 18 deletions

View file

@ -609,17 +609,16 @@ rspec:undercoverage:
stage: post-test
needs: ["rspec:coverage"]
script:
- if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" ]; then
echo "Checking out \$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ($CI_MERGE_REQUEST_SOURCE_BRANCH_SHA) instead of \$CI_COMMIT_SHA (merge result commit $CI_COMMIT_SHA) so we can use $CI_MERGE_REQUEST_DIFF_BASE_SHA for undercoverage in this merged result pipeline";
git checkout -f ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA};
bundle_install_script;
- if [ -n "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" ]; then
echo "HEAD is $(git rev-parse HEAD). \$CI_MERGE_REQUEST_TARGET_BRANCH_SHA is ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA}";
else
echo "Using \$CI_COMMIT_SHA ($CI_COMMIT_SHA) for this non-merge result pipeline.";
echo "HEAD is $(git rev-parse HEAD). \$CI_MERGE_REQUEST_DIFF_BASE_SHA is ${CI_MERGE_REQUEST_DIFF_BASE_SHA}";
fi;
- UNDERCOVERAGE_COMPARE="${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$(git merge-base origin/master HEAD)}"
- echo "Undercoverage comparing with ${UNDERCOVERAGE_COMPARE}"
- UNDERCOVERAGE_COMPARE="${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA}"
- git diff ${UNDERCOVERAGE_COMPARE} --stat
- echo "Undercoverage comparing with ${UNDERCOVERAGE_COMPARE}."
- if [ -f scripts/undercoverage ]; then
run_timed_command "scripts/undercoverage ${UNDERCOVERAGE_COMPARE}";
run_timed_command "bundle exec scripts/undercoverage ${UNDERCOVERAGE_COMPARE}";
fi;
rspec:feature-flags:

View file

@ -1,4 +1,4 @@
- name: "`artifacts:report:cobertura` keyword"
- name: "`artifacts:reports:cobertura` keyword"
announcement_milestone: "14.7"
announcement_date: "2022-01-22"
removal_milestone: "15.0"
@ -6,7 +6,7 @@
breaking_change: false
body: |
Currently, test coverage visualizations in GitLab only support Cobertura reports. Starting 15.0, the
`artifacts:report:cobertura` keyword will be replaced by
`artifacts:reports:cobertura` keyword will be replaced by
[`artifacts:reports:coverage_report`](https://gitlab.com/gitlab-org/gitlab/-/issues/344533). Cobertura will be the
only supported report file in 15.0, but this is the first step towards GitLab supporting other report types.

View file

@ -1,11 +1,11 @@
- name: "`artifacts:report:cobertura` keyword"
- name: "`artifacts:reports:cobertura` keyword"
announcement_milestone: "14.7"
announcement_date: "2022-02-22"
removal_milestone: "15.0"
removal_date: "2022-05-22"
breaking_change: false
body: |
As of GitLab 15.0, the [`artifacts:report:cobertura`](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscobertura-removed)
As of GitLab 15.0, the [`artifacts:reports:cobertura`](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscobertura-removed)
keyword has been [replaced](https://gitlab.com/gitlab-org/gitlab/-/issues/344533) by
[`artifacts:reports:coverage_report`](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscoverage_report).
Cobertura is the only supported report file, but this is the first step towards GitLab supporting other report types.

View file

@ -1453,12 +1453,12 @@ Tracing in GitLab is an integration with Jaeger, an open-source end-to-end distr
<div class="deprecation removal-150">
### `artifacts:report:cobertura` keyword
### `artifacts:reports:cobertura` keyword
Planned removal: GitLab <span class="removal-milestone">15.0</span> (2022-05-22)
Currently, test coverage visualizations in GitLab only support Cobertura reports. Starting 15.0, the
`artifacts:report:cobertura` keyword will be replaced by
`artifacts:reports:cobertura` keyword will be replaced by
[`artifacts:reports:coverage_report`](https://gitlab.com/gitlab-org/gitlab/-/issues/344533). Cobertura will be the
only supported report file in 15.0, but this is the first step towards GitLab supporting other report types.

View file

@ -557,9 +557,9 @@ Review the details carefully before upgrading.
The `Managed-Cluster-Applications.gitlab-ci.yml` CI/CD template is being removed. If you need an alternative, try the [Cluster Management project template](https://gitlab.com/gitlab-org/gitlab/-/issues/333610) instead. If your are not ready to move, you can copy the [last released version](https://gitlab.com/gitlab-org/gitlab-foss/-/blob/v14.10.1/lib/gitlab/ci/templates/Managed-Cluster-Applications.gitlab-ci.yml) of the template into your project.
### `artifacts:report:cobertura` keyword
### `artifacts:reports:cobertura` keyword
As of GitLab 15.0, the [`artifacts:report:cobertura`](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscobertura-removed)
As of GitLab 15.0, the [`artifacts:reports:cobertura`](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscobertura-removed)
keyword has been [replaced](https://gitlab.com/gitlab-org/gitlab/-/issues/344533) by
[`artifacts:reports:coverage_report`](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscoverage_report).
Cobertura is the only supported report file, but this is the first step towards GitLab supporting other report types.

View file

@ -1,3 +1,25 @@
#!/usr/bin/env bash
#!/usr/bin/env ruby
bundle exec undercover -c "${1:-$(git merge-base origin/master HEAD)}"
# frozen_string_literal: true
require 'undercover'
module Undercover
class Changeset
# Rugged merge_base complains when graft/shallow
# (https://github.com/libgit2/rugged/issues/846)
#
# So we assume we provide the merge-base ourself. Modified from
# https://github.com/grodowski/undercover/blob/32e62f66682ee566032b5970437ed2934ef29701/lib/undercover/changeset.rb#L74-L78
def compare_base_obj
return unless compare_base
repo.lookup(compare_base.to_s)
end
end
end
compare_base = ARGV[0]
compare_base ||= IO.popen(%w(git merge-base origin/master HEAD)) { |p| p.read.chomp }
Undercover::CLI.run(%W(-c #{compare_base}))