Skip to content

Add uuid, now(format), trimPrefix, trimSuffix to pipeline template engine#182

Merged
intel352 merged 4 commits intomainfrom
copilot/add-template-functions
Feb 27, 2026
Merged

Add uuid, now(format), trimPrefix, trimSuffix to pipeline template engine#182
intel352 merged 4 commits intomainfrom
copilot/add-template-functions

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

  • Explore codebase and understand template engine
  • Add uuid as an alias for uuidv4 in templateFuncMap
  • Modify now to accept an optional Go time layout/constant string (variadic; defaults to RFC3339 when called with no args)
  • Add trimPrefix function
  • Add trimSuffix function
  • Add tests for all new/updated functions (including {{ now }} no-arg form)
  • Run linter and tests (all pass)

💡 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.

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
@intel352 intel352 marked this pull request as ready for review February 27, 2026 02:41
Copilot AI review requested due to automatic review settings February 27, 2026 02:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 keep uuidv4 alias) to generate UUID v4 strings in templates.
  • Update now to support formatting with a provided Go time layout string or named layout constant.
  • Add trimPrefix / trimSuffix template 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.

@intel352
Copy link
Contributor

@copilot apply changes based on the comments in this thread

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
@intel352 intel352 merged commit d271e44 into main Feb 27, 2026
14 checks passed
@intel352 intel352 deleted the copilot/add-template-functions branch February 27, 2026 03:17
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