Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yardstick label remove $ID doesn't remove any label but exits zero and logs success #105

Closed
willmurphyscode opened this issue Jul 26, 2023 · 0 comments · Fixed by #107
Closed
Labels
bug Something isn't working

Comments

@willmurphyscode
Copy link
Contributor

What happened:

Running yardstick label remove 73bd6255-d663-4a07-8eca-a7555902898f from test/quality directory in Grype doesn't remove the label with that ID, but does log [INFO] removed 1 labels and exit zero

❯ yardstick label remove 73bd6255-d663-4a07-8eca-a7555902898f                                                                                                                               
/Users/willmurphy/work/grype1373/test/quality/venv/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
2023-07-26 10:06:59,182 [INFO] removed 1 labels
❯ echo $? 
0
❯ jq . ./vulnerability-match-labels/labels/registry.access.redhat.com+ubi8@sha256:68fecea0d255ee253acbf0c860eaebb7017ef5ef007c25bee9eeffd29ce85b29/73bd6255-d663-4a07-8eca-a7555902898f.json
{
  "ID": "73bd6255-d663-4a07-8eca-a7555902898f",
  "effective_cve": "CVE-2020-26137",
  "image": {
    "exact": "registry.access.redhat.com/ubi8@sha256:68fecea0d255ee253acbf0c860eaebb7017ef5ef007c25bee9eeffd29ce85b29"
  },
  "label": "TP",
  "package": {
    "name": "urllib3",
    "version": "1.24.2"
  },
  "timestamp": "2022-09-15T19:43:11-04:00",
  "user": "wagoodman",
  "vulnerability_id": "GHSA-wqvq-5m8c-6g24"
}

What you expected to happen:

I expected the label to be removed or, if something is wrong, the log of an error and a non-zero exit code.

How to reproduce it (as minimally and precisely as possible):

git clone [email protected]:anchore/grype --recurse-submodules /tmp/repro-yardstick-issue
cd /tmp/repro-yardstick-issue
cd ./test/quality
. venv/bin/activate
yardstick label remove 73bd6255-d663-4a07-8eca-a7555902898f
cd ./vulnerability-match-labels
git status

If the removal succeeded, the last git status should have printed the diff indicating that the label was removed, specifically the file at labels/registry.access.redhat.com+ubi8@sha256:68fecea0d255ee253acbf0c860eaebb7017ef5ef007c25bee9eeffd29ce85b29/73bd6255-d663-4a07-8eca-a7555902898f.json should have been deleted.

Anything else we need to know?:

Environment:

  • Output of yardstick version:
❯ yardstick version
/Users/willmurphy/work/grype1373/test/quality/venv/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
yardstick 0.7.0 (/Users/willmurphy/work/grype1373/test/quality/venv/lib/python3.9/site-packages)
  • OS (e.g: cat /etc/os-release or similar):
❯ uname -m -s -r -v
Darwin 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant