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
Respect SOURCE_DATE_EPOCH environment variable (if set) over Time.now #7187
Open
lamby
wants to merge
3
commits into
jekyll:master
Choose a base branch
from
lamby:site-time-use-source-date-epoch
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Whilst working on the Reproducible Builds effort [0], we noticed that jekyll builds sites that are not reproducible. This is because site.time uses the current time of day and thus anything then shipping a Jekyll site (eg. as documentation) will therefore not be reproducible. This commit prefers the value in the SOURCE_DATE_EPOCH environment variable [1] if it is set and config.time is also not set. [0] https://reproducible-builds.org/ [1] https://reproducible-builds.org/specs/source-date-epoch/
|
@lamby Can you fix the RuboCop offense as well as add a simple test? Thanks so much! |
|
@DirtyF For a given def reset
self.time = now
self.layouts = {}
self.pages = []
[...]
end
# preferably a private method
def now
# your implementation
end |
32cda73
to
981dd27
Compare
Krinkle
added a commit
to Krinkle/jekyll-feed
that referenced
this pull request
Mar 27, 2022
Two main uses cases: 1. Reduce deployment churn in repositories that hold a docsite in addition to source code. These currently regenerate and find something new commit on every change, even when nothing in the site has been changed. The only file changing each time is feed.xml. For example: https://github.com/qunitjs/qunit/commits/gh-pages 2. Improve reproducibility of the build, as highlighted via jekyll/jekyll#7187, by offering a choice that simply eliminates use of current time entirely, not even having to mock it.
Krinkle
added a commit
to Krinkle/jekyll-feed
that referenced
this pull request
Sep 19, 2022
Primary uses cases: 1. Reduce deployment churn in repositories that hold a docsite in addition to source code. These repositories currently regenerate and find "changed" files to deploy on every commit, even when nothing in the Jekyll site was changed. The only artefact changing each time is `feed.xml`. For example: https://github.com/qunitjs/qunit/commits/gh-pages 2. Improve reproducibility of the build, as highlighted via jekyll/jekyll#7187. By offering a choice that simply eliminates use of current time entirely, we do not even have to worry about mocking it.
Krinkle
added a commit
to Krinkle/jekyll-feed
that referenced
this pull request
Sep 19, 2022
Primary uses cases: 1. Reduce deployment churn in repositories that hold a docsite in addition to source code. These repositories currently regenerate and find "changed" files to deploy on every commit, even when nothing in the Jekyll site was changed. The only artefact changing each time is `feed.xml`. For example: https://github.com/qunitjs/qunit/commits/gh-pages 2. Improve reproducibility of the build, as highlighted via jekyll/jekyll#7187. By offering a choice that simply eliminates use of current time entirely, we do not even have to worry about mocking it.
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.
Whilst working on the Reproducible Builds effort [0], we noticed
that jekyll builds sites that are not reproducible.
This is because site.time uses the current time of day and thus
anything then shipping a Jekyll site (eg. as documentation) will
therefore not be reproducible.
This commit prefers the value in the SOURCE_DATE_EPOCH environment
variable [1] if it is set and config.time is also not set.
[0] https://reproducible-builds.org/
[1] https://reproducible-builds.org/specs/source-date-epoch/