-
Notifications
You must be signed in to change notification settings - Fork 24
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
Allow filter functions in #{if} #65
Comments
Just throwing in 2 cents on behalf of my R&D team - we've had this need countless times - of course we're able to create a child / sub token to work around this and then include that in the #{if} and achieve the same thing, but we've had a lot of these use cases and it does add a good amount of time and impact readability and maintainability when you're searching for the sub tokens and trying to bring the expression all together for review or edits - so it would be beyond excellent if we could use filter functions in #{if}, +100 upvotes :happy |
Many thanks @YihaoOct and @mjhilton !! |
No worries ☺ We still need to bump the version in Octopus Deploy to pick up this new functionality. We'll update this issue with details of which release(s) it will be available from once it's rolling out. |
No prob. I can wait :) Thy for info! |
This is excellent news! Thanks for implementing this. Do you happen to know when this updated version will be available via NuGet? |
Hey @mross002, We aim to integrate Octostache into Octopus Deploy server before releasing to NuGet, because we have a very comprehensive set of integration tests that indirectly exercise a lot of Octostache's functionality. This suite picked up a regression in version The pipeline was still running with the fixed version when you commented, but I've just checked and it's now been merged into the mainline of Octopus Deploy so... I'll go click the Deploy button to promote it to NuGet now :) |
It's deployed and live on NuGet.org now :) |
These changes will be available in Octopus Deploy after version |
@mjhilton - thanks so much!! Yes I saw that issue and PR to fix it, you all are very diligent with your auto tests, it's great to see and provides a lot of confidence in the package. I've upgraded to the latest NuGet package version, this really is a high impact feature that opens up many new use cases that previously weren't supported - you all are awesome, thanks again for all your efforts on this repo! |
Atm this is not supported by
#{if}
/#{unless}
. The current workaround is to extract "temporary variables", but this is a) cumbersome and b) doesn't work "inline" in transformation config files.Example use cases:
#{if My.Var | Trim != ""}oh it's empty or whitespace#{/if}
#{if My.Var | Contains meow}oh it seems to contain a cat#{/if}
#{if My.Url | UriPart Scheme == "https"}oh it's https#{/if}
As this conflicts with the (arbitrarily long) function argument list syntax, maybe it's better to use a "sub expression syntax", something like:
#{if #{SomeUrl | Trim} != ""}oh it's empty or whitespace#{/if}
The text was updated successfully, but these errors were encountered: