feat: better display config templating issues by olblak · Pull Request #10132 · updatecli/updatecli · GitHub
Skip to content

feat: better display config templating issues - #10132

Merged
olblak merged 4 commits into
updatecli:mainfrom
olblak:refactor/configtemplate/issue/reporting
Aug 28, 2026
Merged

olblak merged 4 commits into
updatecli:mainfrom
olblak:refactor/configtemplate/issue/reporting

Conversation

@olblak

@olblak olblak commented Aug 26, 2026

Copy link
Copy Markdown
Member

This pullrequest improve the error message when a go template wrong

Before
+ PREPARE +
+++++++++++

Loading Pipeline "/tmp/test/updatecli.d/default.yaml"
ERROR: Error while templating "/tmp/test/updatecli.d/default.yaml":
---
pipelineid: xxx

sources:
  test-1:
    kind: shell
    spec:
      command: 'echo "1.2.3"'

  test-2:
    kind: shell
    spec:
      command: 'echo {{{ source "test-1" }}'
name: xxx

---
	template: cfg:12: unexpected "{" in command
ERROR: failed loading pipeline(s)
	* /tmp/test/updatecli.d/default.yaml:
		* Partial files:
			* /tmp/test/updatecli.d/_pipeline.yaml
		* Error:
			template: cfg:12: unexpected "{" in command

0 pipeline(s) successfully loaded

After
Loading Pipeline "/tmp/test/updatecli.d/default.yaml"
ERROR: failed loading pipeline(s)
	* /tmp/test/updatecli.d/default.yaml:
		* Partial files:
			* /tmp/test/updatecli.d/_pipeline.yaml
		* Error:
			/tmp/test/updatecli.d/_pipeline.yaml:12: unexpected "{" in command
			
			   9 |   test-2:
			  10 |     kind: shell
			  11 |     spec:
			> 12 |       command: 'echo {{{ source "test-1" }}'

0 pipeline(s) successfully loaded

SCM repository retrieved: 0

Test

To test this pull request, you can run the following commands:

cd <to_package_directory>
go test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.
  • I have tested this pull request manually with a custom Updatecli build and it works as expected.

Tradeoff

Potential improvement

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added the enhancement New feature or request label Aug 26, 2026
@mergify

mergify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves configuration diagnostics by mapping template failures to their originating manifest fragment and providing clearer dependency errors.

Changes:

  • Adds file-aware template error excerpts.
  • Improves unresolved dependency diagnostics.
  • Supports resource-rooted pipeline template dependencies.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/core/config/main.go Tracks manifest fragments during loading.
pkg/core/config/template.go Locates and formats template errors.
pkg/core/config/template_test.go Updates template error assertions.
pkg/core/config/templateerror.go Implements fragment mapping and excerpts.
pkg/core/config/templateerror_test.go Tests error locations and excerpts.
pkg/core/engine/configuration_test.go Tests partial-file diagnostics.
pkg/core/engine/testdata/partialBrokenTemplate/updatecli.d/_source.yaml Adds broken partial fixture.
pkg/core/engine/testdata/partialBrokenTemplate/updatecli.d/updatecli.yaml Adds fixture manifest.
pkg/core/pipeline/main.go Preserves wrapped DAG errors.
pkg/core/pipeline/sort.go Adds detailed dependency errors.
pkg/core/pipeline/sort_test.go Tests dependency diagnostics and ordering.
pkg/core/pipeline/utils.go Extracts structured template dependencies.
pkg/core/pipeline/utils_test.go Tests pipeline-query extraction.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/core/pipeline/utils.go
Comment thread pkg/core/pipeline/utils.go
Signed-off-by: Olblak <me@olblak.com>
@olblak
olblak enabled auto-merge (squash) August 28, 2026 12:30
@olblak
olblak merged commit 553c3c1 into updatecli:main Aug 28, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants