From 80e8534164ef373cb772229dae1bdc27ce93a766 Mon Sep 17 00:00:00 2001 From: Pavel Picka Date: Wed, 13 May 2020 20:11:15 +0200 Subject: [PATCH] Feature coverage list Simple markdown table of pulp_rpm feature coverage. Travis hook to check if this file is updated. With [nocoverage] in commit message this check can be skipped. closes: #6706 https://pulp.plan.io/issues/6706 --- .travis/pre_before_install.sh | 48 +++++++++++++++++++++++++++++++++++ CHANGES/6706.misc | 1 + coverage.md | 43 +++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100755 .travis/pre_before_install.sh create mode 100644 CHANGES/6706.misc create mode 100644 coverage.md diff --git a/.travis/pre_before_install.sh b/.travis/pre_before_install.sh new file mode 100755 index 000000000..1d53ee8ce --- /dev/null +++ b/.travis/pre_before_install.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Simple check if 'coverage.md' was updated with PR. + +set -euv + +# skip this check for everything but PRs +if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then + return 0 +fi + +# skip if '[nocoverage]' found +if [ "$TRAVIS_COMMIT_RANGE" != "" ]; then + RANGE=$TRAVIS_COMMIT_RANGE +elif [ "$TRAVIS_COMMIT" != "" ]; then + RANGE=$TRAVIS_COMMIT +fi + +# Travis sends the ranges with 3 dots. Git only wants two. +if [[ "$RANGE" == *...* ]]; then + RANGE=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.\.\./../'` +else + RANGE="$RANGE~..$RANGE" +fi + +if [[ $(git log --format=medium --no-merges "$RANGE" | grep "\[nocoverage\]") ]] +then + echo "[nocoverage] is present - skipping this check" + return 0 +fi + +coverage_file_name="coverage.md" +coverage_original_file_name="coverage_original.md" +master_version="https://raw.githubusercontent.com/pulp/pulp_rpm/master/${coverage_file_name}" + +# get original file from master +curl --silent $master_version -o $coverage_original_file_name + +# check if coverage.md was updated and clean +if diff -qs $coverage_file_name $coverage_original_file_name +then + echo "ERROR: coverage.md file is not updated." + echo "Please update 'coverage.md' file or use '[nocoverage]' in your commit message." + rm $coverage_original_file_name + exit 1 +else + rm $coverage_original_file_name + return 0 +fi diff --git a/CHANGES/6706.misc b/CHANGES/6706.misc new file mode 100644 index 000000000..936c75a28 --- /dev/null +++ b/CHANGES/6706.misc @@ -0,0 +1 @@ +Added coverage table and CI hook to update it with every commit. \ No newline at end of file diff --git a/coverage.md b/coverage.md new file mode 100644 index 000000000..b970eb364 --- /dev/null +++ b/coverage.md @@ -0,0 +1,43 @@ +Manual Coverage +=============== + +| Feature | Coverage | Notes | +|--|--|--| +| **Sync** | | | +| As a user, I can sync all yum content types ( NO drpm) with immediate policy | PART | | +| As a user, I can sync all yum content types ( NO drpm) with on-demand policy | PART | only types contained in rpm-unsigned + kickstart fixture | +| As a user, I can sync all yum content types ( NO drpm) with cache-only policy | PART | only types contained in rpm-unsigned | +| As a user, I can sync all yum content types ( NO drpm) with optimization | PART | only types contained in rpm-unsigned | +| As a user, I can sync all yum content types ( NO drpm) in a mirror mode | NO | | +| As a user, I can sync all yum content types ( NO drpm) in additive mode (default) | NO | | +| As a user, I can sync and skip specific type (srpm) | NO | | +| As a user, I can sync opensuse repository | NO | | +| As a user, I can sync from a mirror list | NO | not merged yet | +| **Duplicates** | | | +| As a user, I have only one advisory with the same id in a repo version | PART | https://pulp.plan.io/issues/6604 | +| As a user, I have only one module with the same NSVCA in a repo version | NO | | +| As a user, I have only one [S]RPM with the same NEVRA in a repo version | YES | | +| As a user, I have only one distribution tree, custom metadata of a certain type in a repo version | NO | | +| As a user, I have only one module-defaults, package groups, category or environment with the same name in a repo version. | NO | | +| **Publish** | | | +| As a user, I can publish repodata with specific checksum type | PART | "on_demand is not covered, https://pulp.plan.io/issues/6503" | +| As a user, I have the published root directory containing the ‘Package’ directory and packages in alphabetical order inside it. | NO | including that there is NO files which are not expected to be there | +| As a user, I can sign repository metadata using a signing service and publish such repo | PART | | +| As a user, I can have a config.repo file generated for any distribution at runtime | YES | | +| **Upload** | | | +| As a user, I can upload rpm packages, advisories and modulemd[-defaults] content types and optionally add them to repository | NO | | +| As a user, I can upload rpm packages, advisories and modulemd[-defaults] type of content in chunks | PART | | +| **Copy** | | | +| As a user, I can copy any content by adding it to a repository with modify/ endpoint (but nothing is copied automatically, and invalid repositories will fail to validate for some definition of “invalid”) | NO | | +| As a user, I can copy any content by href using Copy API | PART | | +| As a user, I can copy RPM package and its dependencies (if depsolving=True) | NO | | +| As a user, I can copy Advisory and packages it refers to (and their dependencies if depsolving=True) by copying the Advisory | PART | | +| As a user, I can copy Modulemd and its artifacts by copying the Modulemd | NO | | +| As a user, I can copy Modulemd with its artifacts and its module dependencies and artifacts’ dependencies (if depsolving=True). | NO | | +| As a user, if the default Modulemd is copied, its module-default is copied as well (and vice-versa) | NO | | +| As a user, I can copy content with dep solving on and specify multiple repositories to copy from/to | NO | | +| As a user, all content that I directly specify to be copied should always be copied (obviously, but we need to test it, there have been dependency solving bugs where it didn’t happen for various reasons) | NO | | +| **Remove** | | | +| As a user, when a module is removed, its packages are removed as well ( not referenced by other modules) | NO | | +| **Consumer cases** | | | +| As a user, I can use dnf to install all the content served by Pulp | PART | only covers rpm installation |