Add source provenance documentation to debian/README.Debian#726
Draft
Add source provenance documentation to debian/README.Debian#726
Conversation
Co-authored-by: cpuguy83 <799078+cpuguy83@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [REQ] [deb] Document source provenance in debian/README.Debian
Add source provenance documentation to debian/README.Debian
Aug 7, 2025
cpuguy83
reviewed
Aug 7, 2025
packaging/linux/deb/debroot.go
Outdated
| // GenerateReadmeDebian creates the content for debian/README.Debian that documents | ||
| // source provenance, allowing consumers to understand where sources came from. | ||
| // This is exported for testing purposes. | ||
| func GenerateReadmeDebian(spec *dalec.Spec) []byte { |
Co-authored-by: cpuguy83 <799078+cpuguy83@users.noreply.github.com>
cpuguy83
requested changes
Sep 5, 2025
packaging/linux/deb/debroot.go
Outdated
| fmt.Fprintf(buf, "-----------------\n\n") | ||
| fmt.Fprintf(buf, "This package was built from the following sources:\n\n") | ||
|
|
||
| if len(spec.Sources) == 0 { |
Collaborator
There was a problem hiding this comment.
@copilot this should return before we've written anything and just return a nil slice.
Contributor
Author
There was a problem hiding this comment.
Fixed in fed46d7. The function now returns nil immediately when there are no sources, avoiding creation of README.Debian file entirely. Updated calling code to handle nil return value and modified tests accordingly.
Co-authored-by: cpuguy83 <799078+cpuguy83@users.noreply.github.com>
Collaborator
|
@copilot rebase |
cpuguy83
requested changes
Nov 19, 2025
| "strings" | ||
| "testing" | ||
|
|
||
| "github.com/Azure/dalec" |
Collaborator
There was a problem hiding this comment.
@copilot The import path is now github.com/project-dalec/dalec
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.
This PR implements source provenance documentation for Debian packages by automatically generating
debian/README.Debianfiles that document where each source came from, similar to how RPM specs already include this information as comments.Problem
RPM packages built with dalec include detailed source provenance documentation in the spec file comments, allowing consumers to understand and reproduce builds. However, Debian packages lacked this same functionality, making it difficult for users to understand the origins of package sources.
Solution
Added automatic generation of
debian/README.Debianfiles during the Debian package build process. The implementation:Source.Doc()method that's already implemented for all source typesdebian/README.Debianlocation as recommended by Debian packaging guidelinesExample Output
For a package with multiple source types, the generated
debian/README.Debianlooks like:Implementation Details
generateReadmeDebian()function inpackaging/linux/deb/debroot.goDebroot()functionnilwhen no sources are present to avoid creating empty documentation filesFixes #556.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.