Add uuid, now(format), trimPrefix, trimSuffix to pipeline template engine#182
Merged
Add uuid, now(format), trimPrefix, trimSuffix to pipeline template engine#182
Conversation
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add built-in template functions for value transformations
Add uuid, now(format), trimPrefix, trimSuffix to pipeline template engine
Feb 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds common transformation helpers to the pipeline TemplateEngine so pipeline configs can generate UUIDs, format timestamps, and normalize strings directly in templates.
Changes:
- Add
uuid(and keepuuidv4alias) to generate UUID v4 strings in templates. - Update
nowto support formatting with a provided Go time layout string or named layout constant. - Add
trimPrefix/trimSuffixtemplate functions and accompanying unit tests for the new/updated functions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| module/pipeline_template.go | Extends the template function map with uuid, enhanced now, and string trimming helpers. |
| module/pipeline_template_test.go | Adds unit tests covering UUID generation, now formatting, trim helpers, and existing default behavior. |
Contributor
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
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.
uuidas an alias foruuidv4in templateFuncMapnowto accept an optional Go time layout/constant string (variadic; defaults to RFC3339 when called with no args)trimPrefixfunctiontrimSuffixfunction{{ now }}no-arg form)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.