-
Notifications
You must be signed in to change notification settings - Fork 301
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
Proposal to make output of git-commit-id-maven-plugin
reproducible
#825
Comments
Option 2 sounds viable to add as a stabilizer. |
Should I PR for that? I could remove the complete file. Similar to how stripping of signatures is implemented. |
Yeah I think until the implementation changes, we'd need to take the file out. I think there are different ways to include tag/branch info that's more prescriptive and avoids drift. I also don't think this would be the right place to embed the build host. But I think this is a good place to discuss those concerns while separately pursuing the stabilizer. Thanks for digging into this! |
Hello, From the plugin side I'm not responsible for the user's plugin configuration and I also don't want to dictate how user's can/should/can't use the plugin. As a side-note, from my perspective this plugin already has various option to account for better reproducibility:
With that being mentioned: |
I recently used this plugin to get the last Git commit timestamp https://github.com/ollama4j/ollama4j/pull/93/files as you can see, by default, plugin is good: just need to override timestamp format and timezone but no file is generated, nothing with reproducibility issues if your objective is to get more reproducible content when people activate file, you'll have to ask people why they generate a file, which is completely another discussion |
notice: perhaps just documenting this "enable reproducible builds with last Git commit timestamp" use case is what we just need, as it's reasonable (of course, if no config was necessary, that would be even better) |
I should give constructive suggestions :)
I suggest changing the default to
These two have an issue that they change for future rebuilds as number of tags and commit change. I suggest fixing their value for a specific commit.
These also change, but pinning them for each commit seems to be overkill so it is really up to the users of your plugin. If they use it, their software won't be reproducible out of the box.
All of this information can also be recorded in Sorry for not posting them before and if you don't see value in them, that's also okay. We are working on the 2nd solution above. :) |
Thanks for the follow up! Greatly appreciate :-) I see you point regarding the time format's, but that can already be controlled using dateFormatTimeZone. Let me maybe quote from https://reproducible-builds.org - "How does it work?"
All information that is generated from the plugin comes from git as "source". IMHO you could claim that the plugin generates reproducible results when build with the same git repository [on the same machine/environment].
As mentioned above the plugin will not even generate a git-properties file by default. So by default I would claim that the plugin can produce reproducible builds. Given a user had found the option to enable to generate a git-properties file would it be too much to ask user's to review what is even being generated and adjust the configuration as needed (e.g. to only generate the git-commit-hash-id)? With that being mentioned I don't think there is anything that the plugin will or can change. The git-properties file is the user's choice already, so why should the plugin be responsible for things the user may want/need? |
Describe the idea (required)
For the past few months, I have been playing around with the Reproducible Central dataset and I am trying to understand what causes differences. I have roughly found the following attributes (source: chains-project/reproducible-central#19) embedded by this plugin that may be unreproducible by a rebuilder.
git.commit.time
- there is a timezone difference.git.remote.origin.url
git.tags
- number of tags at a later time could be differentgit.build.host
- build host can vary if some third party builds the projectgit.build.time
git.build.user.email
git.build.user.name
git.branch
- could change if the refs are change andmain
keeps moving aheadgit.local.branch.ahead
git.local.branch.behind
git.total.commit.count
Tell us about the expected behaviour (required)
Even though all of these attributes are important and well justified by the use cases, it can hinder reproducibility check for a third party builder as some of the attributes are relevant to the environment.
I can propose three solutions for this:
git.total.commit.count
can be number of commits up untilHEAD
.git.json
andgit.properties
file. We could strip all the above properties (or maybe entire files) like we have done for attributes in MANIFEST. Eg,SCM-Revision
in MANIFEST. What do you think @msuozzo?-Dmaven.gitcommitid.skip=true
. @hboutemy we can add this to any buildspec like generation of SPDX is skipped right now.For past releases, 2 in best.
For future releases, 3 is most convenient. 1 is also good but it may not apply to all attributes.
Context (optional)
No response
The text was updated successfully, but these errors were encountered: