argo-workflows icon indicating copy to clipboard operation
argo-workflows copied to clipboard

Improve templating diagnostics

Open alexec opened this issue 3 years ago • 5 comments

Summary

Users often struggle to diagnoes templating problems. Helping them is time consuming. Everybody looses.

Instead, we log more diagnostics whenever resolution fails:

https://github.com/argoproj/argo-workflows/blob/9c901456a44501f11afc2bb1e856f0d0828fd13f/util/template/simple_template.go#L26

Several times here:

https://github.com/argoproj/argo-workflows/blob/9c901456a44501f11afc2bb1e856f0d0828fd13f/util/template/expression_template.go#L34

Use Cases

When would you use this?


Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

alexec avatar Apr 04 '22 14:04 alexec

@lambertsbennett will be working on this.

terrytangyuan avatar Apr 28 '22 15:04 terrytangyuan

This is not being worked on.

terrytangyuan avatar Jun 16 '22 14:06 terrytangyuan

Anyone can please guide me here, what exactly needs to be done on this?

surbhiahuja avatar Sep 05 '22 13:09 surbhiahuja

Add some logging debug statements to that file so when the controller is started with debug logging, then the reason is shown. For example:

Change:

	if err != nil && allowUnresolved {
		return w.Write([]byte(fmt.Sprintf("{{%s%s}}", kindExpression, expression)))
	}

To:

	if err != nil && allowUnresolved {
                log.WithError(err).Debug("unresolved is allowed ")
		return w.Write([]byte(fmt.Sprintf("{{%s%s}}", kindExpression, expression)))


	}

alexec avatar Sep 05 '22 19:09 alexec

@alexec , I have created PR: https://github.com/argoproj/argo-workflows/pull/9533. Please take a look and suggest changes if required.

surbhiahuja avatar Sep 06 '22 19:09 surbhiahuja

is this issue still exist or it is solved?

Sajiyah-Salat avatar Jan 21 '23 02:01 Sajiyah-Salat