WIP: Support the date add filters in file substitution - #2129
Closed
NickJosevski wants to merge 1 commit into
Closed
WIP: Support the date add filters in file substitution#2129NickJosevski wants to merge 1 commit into
NickJosevski wants to merge 1 commit into
Conversation
Calamari does variable substitution in files at deploy time using its own pinned Octostache, so these filters won't work in substituted files until that pin moves past 3.9.2. These cases encode the expected post-bump behaviour and will fail until then: with 3.9.2 the filters are unknown, so the expressions echo unreplaced rather than resolving. Includes a case pinning that AddTimeSpan 48:00:00 shifts by 48 days where AddHours 48 shifts by 48 hours, since that difference is silent. Expected values verified against the Octostache implementation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 10, 2026
Contributor
Author
|
Closing — going with the |
This file contains hidden or 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
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.Suggestion cannot be applied right now. Please check back later.
Warning
WIP — do not merge, and CI is expected to be red. This encodes the desired end state; it cannot pass until the Octostache pin is bumped.
Variant of #2124 and #2128, for the full filter set in OctopusDeploy/Octostache#126.
Why
Calamari does variable substitution in files at deploy time using its own pinned Octostache. These filters won't work inside substituted config files until that pin moves — even after Octopus Server ships them. A filter that resolves in a project variable but echoes unreplaced in a
web.configis unpleasant to diagnose.What
Eleven cases added to
ShouldApplyFiltersDuringSubstitution, with a fixeddateVarso output stays deterministic:AddSeconds 302030-05-22T09:05:30.0000000AddMinutes 22030-05-22T09:07:00.0000000AddHours 22030-05-22T11:05:00.0000000AddHours -22030-05-22T07:05:00.0000000AddHours 482030-05-24T09:05:00.0000000AddDays 12030-05-23T09:05:00.0000000AddWeeks 12030-05-29T09:05:00.0000000AddMonths 12030-06-22T09:05:00.0000000AddTimeSpan "2.12:00:00"2030-05-24T21:05:00.0000000AddTimeSpan 48:00:002030-07-09T09:05:00.0000000AddHours 2 | Format "yyyy-MM-dd HH:mm:ss"2030-05-22 11:05:00Values were produced by running the expressions against the Octostache branch, not hand-written.
Note the last two
AddTimeSpanrows sit directly againstAddHours 48: the same "48" reaches 24 May viaAddHoursand 9 July viaAddTimeSpan 48:00:00, because the .NET TimeSpan format re-reads the leading field as days above 23. Pinned here so the difference is visible in the deployment path, not just in Octostache's own tests.To finish
Octostachefrom3.9.2inCalamari.Shared.csproj:38andCalamari.Common.csproj:30🤖 Generated with Claude Code