Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Oct 29, 2025

This rigs the pkgtest helpers to be able to describe what catalogers are seen and what elements are output during the test. Observations are written out to the test-fixtures/test-observations.json file relative to the test in question.

Here's example output:

{
  "package": "debian",
  "updated_at": "2025-10-29T17:56:49.081895Z",
  "catalogers": {
    "deb-archive-cataloger": {
      "metadata_types": [
        "pkg.DpkgArchiveEntry"
      ],
      "package_types": [
        "deb"
      ],
      "observations": {
        "license": true,
        "relationships": {
          "found": false,
          "count": 0
        },
        "file_listing": {
          "found": false,
          "count": 0
        },
        "file_digests": {
          "found": true,
          "count": 1
        },
        "integrity_hash": {
          "found": false,
          "count": 0
        }
      }
    },
    "dpkg-db-cataloger": {
      "metadata_types": [
        "pkg.DpkgDBEntry"
      ],
      "package_types": [
        "deb"
      ],
      "observations": {
        "license": true,
        "relationships": {
          "found": false,
          "count": 0
        },
        "file_listing": {
          "found": true,
          "count": 18
        },
        "file_digests": {
          "found": true,
          "count": 3
        },
        "integrity_hash": {
          "found": false,
          "count": 0
        }
      }
    }
  },
  "parsers": {
    "parseDpkgDB": {
      "metadata_types": [
        "pkg.DpkgDBEntry"
      ],
      "package_types": [
        "deb"
      ],
      "observations": {
        "license": false,
        "relationships": {
          "found": false,
          "count": 0
        },
        "file_listing": {
          "found": false,
          "count": 0
        },
        "file_digests": {
          "found": false,
          "count": 0
        },
        "integrity_hash": {
          "found": false,
          "count": 0
        }
      }
    }
  }
}

This is work that was carved out of #4317

@wagoodman wagoodman marked this pull request as ready for review October 29, 2025 18:36
@wagoodman wagoodman marked this pull request as draft October 29, 2025 18:40
@wagoodman wagoodman marked this pull request as ready for review October 29, 2025 18:56
@wagoodman wagoodman requested a review from a team October 29, 2025 19:28
// file digests observation
if hasFileDigests(p.Metadata) {
obs.FileDigests.Found = true
obs.FileDigests.Count++
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we counting files with digests? At first I thought the digests were going to be for detecting whether capabilities changed, but now it looks like they're just being counted?

Copy link
Contributor Author

@wagoodman wagoodman Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this part is kinda silly, as long as we have something that can detect "present or not" that would be good enough. I'll leave this for now since it's not operationally affecting anything and will make subsequent PRs a little easier too (I'll probably remove it in a future PR).

@wagoodman wagoodman merged commit 538430d into main Oct 30, 2025
12 checks passed
@wagoodman wagoodman deleted the caps-pkgs branch October 30, 2025 17:19
@spiffcs spiffcs added the enhancement New feature or request label Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants