Skip to content

Structured use of PkgInfo#1499

Merged
ysangkok merged 5 commits intohaskell:masterfrom
tweag:structured-pkginfo
Apr 28, 2026
Merged

Structured use of PkgInfo#1499
ysangkok merged 5 commits intohaskell:masterfrom
tweag:structured-pkginfo

Conversation

@isovector
Copy link
Copy Markdown
Contributor

This PR refactors all uses of PkgInfo so as to not use the internal acid-state selectors pkgMetadataRevisions and pkgTarballRevisions, preferring instead high-level semantic accessors.

The motivation here is be much more precise about exactly what data is required in the existing implementation. In a post acid-state world, we are not going to want to fetch the state of the world and filter afterwards.

Implementation note: I put this together by turning on -XNoFieldSelectors, such that every use of the selectors became an error. I then traced through each use and rewrite in terms of projections from Distribution.Server.Packages.Types.

@isovector isovector force-pushed the structured-pkginfo branch from d690021 to fe3c31e Compare April 28, 2026 21:30
, uploadtime)
| pkg <- map head pkgss
, let (_, (uploadtime, _user)) = Vec.head (pkgMetadataRevisions pkg)
, let (uploadtime, _user) = pkgLatestUploadInfo pkg
Copy link
Copy Markdown
Contributor Author

@isovector isovector Apr 28, 2026

Choose a reason for hiding this comment

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

Note that Vec.head was the first revision; this is now the latest revision. The use of head here seemed like a bug to me, but I can keep the old behavior if desired.

@isovector isovector force-pushed the structured-pkginfo branch from fe3c31e to f2633c3 Compare April 28, 2026 21:39
@isovector isovector force-pushed the structured-pkginfo branch from f2633c3 to 736bd90 Compare April 28, 2026 21:39
@ysangkok ysangkok merged commit 0fe76b0 into haskell:master Apr 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants