Skip to content

Replace the findPkgRoot heuristics with a resolved PackageContext #97

Description

@BKPepe

Follow-up from the review of #88, #89 and #96.

findPkgRoot() has grown into a pile of structural heuristics that each new repository layout extends: known category directories, skip directories, LuCI payload directories, the root-level package fallback, Makefile probing, and per-family exemption lists that individual validators keep their own copies of (['u-boot.mk', 'trusted-firmware-a.mk', 'luci.mk'] now appears in the release audit, and the metadata check has a second list of its own).

Proposal: resolve a changed file to a single PackageContext once and let every validator read its capabilities from there.

changed file
   ↓ walk parents upward
   ↓ probe Makefile
   ↓ classify package family
   ↓
{
  root: 'babeld',
  family: 'regular' | 'luci' | 'uboot' | 'trusted-firmware' | 'host-tool',
  makefile: '...',
  usesPkgRelease: true,
  requiresMaintainer: true,
  requiresLicenseFiles: true
}

That would give the release audit, the hash audit, the metadata check and the UCI check one source of truth instead of one exemption list each, and adding a repository layout or a package family would be a single change rather than a change per validator.

Not urgent — the current fixes are correct as they stand. This is about keeping them maintainable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions