Skip to content

feat: add support for commitDate and commitSha in packages#545

Open
lafrenierejm wants to merge 2 commits intoMic92:mainfrom
lafrenierejm:commit-sha-and-date
Open

feat: add support for commitDate and commitSha in packages#545
lafrenierejm wants to merge 2 commits intoMic92:mainfrom
lafrenierejm:commit-sha-and-date

Conversation

@lafrenierejm
Copy link

Enables nix-update to track and update commitDate and commitSha fields in package definitions. All version providers (GitHub, GitLab, Gitea, Bitbucket, SourceHut) parse commit dates from their APIs.

This is particularly useful for Go CLI modules, where it is common to embed the commit date and SHA in the binary via ldflags "-X main.commit" and "-X main.date", respectively.

When updating packages, commit dates are normalized to UTC and formatted with the "Z" suffix for consistency across providers.

Enables nix-update to track and update commitDate and commitSha fields
in package definitions. All version providers (GitHub, GitLab, Gitea,
Bitbucket, SourceHut) parse commit dates from their APIs.

This is particularly useful for Go CLI modules, where it is common to
embed the commit date and SHA in the binary via ldflags "-X
main.commit" and "-X main.date", respectively.

When updating packages, commit dates are normalized to UTC and
formatted with the "Z" suffix for consistency across providers.
Extracts the line replacement logic in replace_version() into a
separate apply_line_replacements() helper function to reduce
complexity (PLR0913).

Introduces ReplacementContext dataclass to group related parameters
and avoid boolean positional arguments (FBT001).

Also renames version_string_in_version_declaration to the shorter
version_string_in_declaration.
@lafrenierejm
Copy link
Author

The test 4 failure is baffling. The failure is the "Gradle build daemon disappeared unexpectedly". I'm not sure how the changes in this PR could have caused Gradle to crash…

The test 7 failure seems like a pre-existing issue likely caused by policy changes made server-side at gitlab.gnome.org.

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.

1 participant