Provisioning: Make image renderer note optional in PR comments (#113837)

* Provisioning: Remove image renderer note from PR comment template

Removes the 'NOTE: The image renderer is not configured' message from
the pull request comment template when image renderer is unavailable.
This addresses issue #656 in git-ui-sync-project.

- Updated commentTemplateMissingImageRenderer to be empty
- Updated testdata to reflect the change
- All unit tests pass

* Provisioning: Make image renderer note optional in PR comments

Make the image renderer note in pull request comments optional based on
the allowImageRendering configuration flag. When enabled, the note now
includes a link to the setup documentation.

- Add showImageRendererNote boolean field to commenter struct
- Update NewCommenter to accept showImageRendererNote parameter
- Update template to conditionally show note with documentation link
- Pass allowImageRendering from APIBuilder to commenter in register.go
- Update ProvidePullRequestWorker to use cfg.ProvisioningAllowImageRendering
- Add tests to verify note appears/disappears based on flag

Fixes https://github.com/grafana/git-ui-sync-project/issues/656

* Format code with go fmt

* Remove redundant text from image renderer note

Remove 'The image renderer is not configured.' from the note message.
The note now focuses on actionable guidance with the documentation link.

* Fix compilation error: use cfg.ProvisioningAllowImageRendering directly

Cannot access unexported field allowImageRendering from webhooks package.
Use cfg.ProvisioningAllowImageRendering directly since we have access to cfg.
This commit is contained in:
Roberto Jiménez Sánchez
2025-11-14 10:33:28 +01:00
committed by GitHub
parent 5b34d92dca
commit 1cc21a0705
5 changed files with 85 additions and 17 deletions
@@ -2,6 +2,4 @@ Hey there! 🎉
Grafana spotted some changes to your dashboard.
See the [original](http://grafana/d/uid) and [preview](http://grafana/admin/preview) of file.json.
NOTE: The image renderer is not configured
See the [original](http://grafana/d/uid) and [preview](http://grafana/admin/preview) of file.json.