-
Notifications
You must be signed in to change notification settings - Fork 13
feat(build): add flag to omit creation timestamp for reproducible builds #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,15 +257,18 @@ func BuildModelConfig(modelConfig *buildconfig.Model, layers []ocispec.Descripto | |
} | ||
} | ||
|
||
createdAt := time.Now() | ||
descriptor := modelspec.ModelDescriptor{ | ||
CreatedAt: &createdAt, | ||
Family: modelConfig.Family, | ||
Name: modelConfig.Name, | ||
SourceURL: modelConfig.SourceURL, | ||
Revision: modelConfig.SourceRevision, | ||
} | ||
|
||
if !modelConfig.NoCreationTime { | ||
createdAt := time.Now() | ||
descriptor.CreatedAt = &createdAt | ||
} | ||
Comment on lines
+267
to
+270
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This conditional logic is the core of the new feature. To ensure its correctness and prevent future regressions, it's important to add unit tests. Please consider updating |
||
|
||
diffIDs := make([]godigest.Digest, 0, len(layers)) | ||
for _, layer := range layers { | ||
diffIDs = append(diffIDs, layer.Digest) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,5 @@ type Model struct { | |
SourceURL string | ||
SourceRevision string | ||
Reasoning bool | ||
NoCreationTime bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text for this new flag is a bit verbose. For better CLI usability, consider making it more concise. A more idiomatic help message could be something like:
Omit creation timestamp for reproducible builds
.