Skip to content

Feat/future deploy warning#232

Open
SamBarker wants to merge 6 commits intokroxylicious:mainfrom
SamBarker:feat/future-deploy-warning
Open

Feat/future deploy warning#232
SamBarker wants to merge 6 commits intokroxylicious:mainfrom
SamBarker:feat/future-deploy-warning

Conversation

@SamBarker
Copy link
Member

@SamBarker SamBarker commented Mar 4, 2026

Jekyll posts have a date. Jekyll has a configurable behaviour about whether to include future dated posts, which defaults to false. This means future-dated posts are excluded during static generation. Our site builds are only driven by merging PRs to this repository. So if we accidentally future-date a Release Blog, then it can happen that on merge it is not made visible and will not be until another PR is merged after the post date. This is not what we are intending when we hit the Merge button.

This PR adds a couple of checks.

  1. To catch PRs where the front matter is older than the filename. likely to be a mistake.
  2. To add a warning on merge when future dated posts are merged as they require manual publishing. Example https://github.com/SamBarker/kroxylicious.github.io/actions/runs/22653880628

@robobario
Copy link
Member

oof. so if we deploy in advance they don't get built into the static output?

@SamBarker SamBarker marked this pull request as ready for review March 4, 2026 03:36
@SamBarker SamBarker requested a review from a team as a code owner March 4, 2026 03:36
@k-wall
Copy link
Member

k-wall commented Mar 8, 2026

I haven't groked the issue completely, but does timezone need to be factored in?

@robobario
Copy link
Member

I wonder if it could also be an option switching the flag that disables this behaviour, and live with blogs being published before their nominal post time.

@SamBarker SamBarker force-pushed the feat/future-deploy-warning branch from 5b1ad40 to 5768878 Compare March 8, 2026 20:41
@SamBarker
Copy link
Member Author

I haven't groked the issue completely, but does timezone need to be factored in?

TZ is already accounted for, in that its included in the post timestamp, however the file I copied to write the post used UTC, and while I updated the date I didn't change the time so the post merged but didn't go live. It would have done if I had set the TZ to +1300.

But you did make me realise we weren't considering the timezone when checking dates.

I wonder if it could also be an option switching the flag that disables this behaviour, and live with blogs being published before their nominal post time.

I think its a useful property to be able to merge in advance of publication. It just needs an extra action run post fact.

When a push to main includes future-dated posts, the deploy workflow
now adds a warning to the GitHub Actions job summary listing the
affected posts and their publish dates, with a reminder to re-run
the workflow manually on the publish date.

Both the filename date and front matter date are checked, using
whichever is later.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
Adds a PR check that fails if any post in _posts/ has a filename date
that doesn't match the date in its front matter, catching accidental
mismatches early.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
Rather than requiring an exact match, only fail if the front matter
date is older than the filename date, which is the case that would
cause Jekyll to publish later than expected.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
Previously the check only extracted YYYY-MM-DD from the front matter
date, silently discarding any time and timezone offset. This caused
false positives for NZ-timezone posts (e.g. "2026-03-05 00:00:00 +1300"
is 2026-03-04 in UTC, but the check treated it as March 5) and false
negatives for posts with negative UTC offsets.

Now the full front matter date value is passed to GNU date with -u -d
to get the correct UTC date, matching Jekyll's own behaviour.

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
@SamBarker SamBarker force-pushed the feat/future-deploy-warning branch from a585e85 to 3c154ec Compare March 8, 2026 22:21
@SamBarker
Copy link
Member Author

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.

3 participants