Skip to content

Conversation

chlins
Copy link
Member

@chlins chlins commented Sep 15, 2025

This pull request introduces a new --no-creation-time flag to the build process, allowing users to optionally omit the createdAt timestamp from the model configuration. This is particularly useful for achieving reproducible builds, as the timestamp would otherwise change with each build. The change is implemented by adding the flag to the CLI, propagating it through the configuration structs, and conditionally setting the creation time during model config generation.

New Build Flag for Reproducibility:

  • Added a --no-creation-time boolean flag to the CLI in cmd/build.go, allowing users to skip setting the createdAt field in the model config for repeated builds.

Configuration and Propagation:

  • Extended the Build struct in pkg/config/build.go and the Model struct in pkg/backend/build/config/model.go to include a NoCreationTime field, ensuring the flag is tracked through the build process. [1] [2]
  • Updated the NewBuild constructor to initialize NoCreationTime to false by default.
  • Passed the NoCreationTime value through the backend build logic to the model config builder in pkg/backend/build.go.

Conditional Creation Time Handling:

  • Modified the model config builder in pkg/backend/build/builder.go to only set the createdAt field if NoCreationTime is not enabled, ensuring reproducibility when the flag is used.

@chlins chlins added the enhancement New feature or request label Sep 15, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @chlins, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a mechanism to achieve more reproducible builds by allowing users to omit the createdAt timestamp from model configurations. This prevents variations in build artifacts solely due to the time of creation, ensuring consistent outputs across repeated build processes.

Highlights

  • New CLI Flag for Build Reproducibility: A --no-creation-time boolean flag has been added to the build command-line interface, allowing users to prevent the createdAt timestamp from being included in the model configuration.
  • Configuration Struct Updates: The Build struct in pkg/config/build.go and the Model struct in pkg/backend/build/config/model.go have been updated to include a NoCreationTime field, ensuring the flag's state is propagated through the build process.
  • Conditional Timestamp Generation: The model configuration builder in pkg/backend/build/builder.go now conditionally sets the createdAt field based on the NoCreationTime flag, ensuring that the timestamp is omitted when the flag is enabled.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a --no-creation-time flag to support reproducible builds by omitting the createdAt timestamp. The implementation is straightforward and correctly propagates the flag from the CLI to the model building logic. My review focuses on improving documentation, user-facing text, and ensuring test coverage for the new functionality. I've suggested adding doc comments for the new configuration fields, refining the CLI help message for clarity, and adding unit tests to validate the conditional timestamp logic.

// TODO: set the raw flag to true by default in future.
flags.BoolVar(&buildConfig.Raw, "raw", false, "turning on this flag will build model artifact layers in raw format")
flags.BoolVar(&buildConfig.Reasoning, "reasoning", false, "turning on this flag will mark this model as reasoning model in the config")
flags.BoolVar(&buildConfig.NoCreationTime, "no-creation-time", false, "turning on this flag will not set createdAt in the config, which will be helpful for repeated builds")

Choose a reason for hiding this comment

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

medium

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.

Suggested change
flags.BoolVar(&buildConfig.NoCreationTime, "no-creation-time", false, "turning on this flag will not set createdAt in the config, which will be helpful for repeated builds")
flags.BoolVar(&buildConfig.NoCreationTime, "no-creation-time", false, "Omit creation timestamp for reproducible builds")

Comment on lines +267 to +270
if !modelConfig.NoCreationTime {
createdAt := time.Now()
descriptor.CreatedAt = &createdAt
}

Choose a reason for hiding this comment

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

medium

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 TestBuildModelConfig in pkg/backend/build/builder_test.go to cover both scenarios: when NoCreationTime is true (asserting CreatedAt is nil) and when it's false (asserting CreatedAt is set).

SourceURL string
SourceRevision string
Reasoning bool
NoCreationTime bool

Choose a reason for hiding this comment

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

medium

To improve code clarity and maintainability, it's good practice to add doc comments for exported fields. Please add a comment for NoCreationTime explaining its purpose.

	// NoCreationTime omits the creation timestamp for reproducible builds.
	NoCreationTime bool

@chlins
Copy link
Member Author

chlins commented Sep 15, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants