Repository navigation
refactor: take the apk, deb, pacman and rpm formats from github.com/M0Rf30/pkgformat - #464
Merged
Merged
Conversation
Switch github.com/sassoftware/go-rpmutils to the github.com/M0Rf30/go-rpmutils fork. Upstream SignRpmStream wrote v4 signatures (RSA header + PGP header+payload, tags illegal in a v6 signature header) into format-6 packages built by rpm 6; the fork signs them like rpmsign 6 with an OPENPGP header signature and keeps the RESERVED tag and signature-header size. It also verifies v6 packages (payload digests without PAYLOADDIGESTALGO, OPENPGP signatures) and reads stripped cpio payloads correctly. Tests cover a format-6 fixture built by rpm 6.0.1 and cross-check with rpm -K when rpm 6 is installed.
…format Delete pkg/rpm, pkg/rpmsign and the generic internal/format/rpm code. The extra JSON of rpm_packages now lives in internal/rpmextra; fixtures moved to testdata/rpm; test rpms are built with pkgformat/rpm/pack. Update the docs.
Drop the local replace. Render deb control fields for the manifest through deb.ControlFile.String: the library returns logical values, and printing them raw split continuation lines into bogus fields (Depends lost zlib1g). Point the rpm fixture paths at testdata/rpm.
The deadcode gate exempts test-support packages named *test; the helper is only imported from tests.
Coverage
Go by area
Web by area (lines)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the in-tree format code with github.com/M0Rf30/pkgformat v0.1.0, an Apache-2.0 library that yap uses too. openartifact keeps the HTTP handlers, storage, database and key management.
Includes the RPM v6 signing work from #463, which this PR supersedes.
Replaced
pkg/xzlimit,pkg/gpgpkgformat/xzlimit,pkgformat/gpg; the repo-levelResolvermoves tointernal/gpgresolverpkg/apk(+apktest)pkgformat/apk, signing explicitlySigRSASHA256; test builder ininternal/apktestutilpkg/pacmanpkgformat/pacmanpkg/deb, genericinternal/format/debpkgformat/deb;internal/format/deb/entry.goconverts stored control fieldspkg/rpm,pkg/rpmsign, genericinternal/format/rpmpkgformat/rpm(ReadPackage,Sign) andrpm/repodata; therpm_packages.extraJSON lives ininternal/rpmextraDependency
go-rpmutilsis removed. Net: 269 files, about −19k lines.Output compared before and after, on the existing fixtures
Packagesand stored rows are identical.Packages.gzdiffers only in gzip bytes (header mtime 0); the decompressed content is identical. The Release file list is sorted by path, andParseReleasenow rejects non-hex digests and contradicting sizes.filelists,otherandrepomdare identical.primary.xmlnow lists primary<file>entries the way createrepo_c does. Rows stored before this change have no mode or flags, so their files render as plain files (no backfill).epoch="0"is omitted, andmodules.yaml.gzuses the default gzip level.rpm_packages.extrarows use lower-case JSON keys; existing rows still decode.Checks
make lint: 0 issues.reuse lint: compliant.go vet -tags=integration ./...: pass.go test -short -p 1 ./...: pass.-tags=integration, throwaway postgres) for database, worker, api, tests and tests/integration: worker and api pass. Seven unrelated failures need infrastructure that wasn't available: six S3 tests (no S3 endpoint) andTestVulnScanOverviewUsesIndexes(postgres shared memory).