Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/daily-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
run: echo "date=$(date -d '+7 days' +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Update compatibility date
run: |
Expand Down
14 changes: 12 additions & 2 deletions src/workerd/io/compatibility-date.c++
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,22 @@ static void compileCompatibilityFlags(kj::StringPtr compatDate,
"date supported by this server binary is \"",
SUPPORTED_COMPATIBILITY_DATE, "\"."));
}

// workerd is built with SUPPORTED_COMPATIBILITY_DATE set a little bit into the futurue, so
// that the build can support setting the compat date to today until the next release is
// ready. But we don't want people to actually set their compat date in the future, so let's
// check against the clock time as well.
if (CompatDate::today() < parsedCompatDate) {
errorReporter.addError(kj::str("Can't set compatibility date in the future: \"",
parsedCompatDate, "\". Today's date (UTC) is \"", CompatDate::today(), "\"."));
}

break;

case CompatibilityDateValidation::CURRENT_DATE_FOR_CLOUDFLARE:
if (CompatDate::today() < parsedCompatDate) {
errorReporter.addError(
kj::str("Can't set compatibility date in the future: ", parsedCompatDate));
errorReporter.addError(kj::str("Can't set compatibility date in the future: \"",
parsedCompatDate, "\". Today's date (UTC) is \"", CompatDate::today(), "\"."));
}
break;

Expand Down
Loading