You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
If you have large atlantis plans or applies and your are trying to reduce the amount of content posted in the merge request custom templates don't override **Warning**: Output length greater than max comment size. Continued in next comment. logic.
A 800K characters plan commented on the merge request when it should have stated:
-- :warning: The plan is to large to render in GitLab comments; run terraform plan locally..
Reproduction Steps
Use version v0.21.0-pre.20221120 of atlantis image.
Update deployment to use --markdown-template-overrides-dir=home/atlantis/.markdown_templates/ on container args
Create configmap that contains multiProjectPlan template.
Modify multiProjectPlan template in the following way:
{{ define "multiProjectPlan" -}}
{{ template "multiProjectHeader" . }}
{{ $disableApplyAll := .DisableApplyAll }}{{ range $i, $result := .Results }}### {{add $i 1}}. {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`
#########################################
####This is the customization added######
#########################################
{{ if (le (len $result.Rendered) 500000) }}{{$result.Rendered}}{{ else }}:warning: The plan is to large to render in GitLab comments; run `terraform plan` locally.{{ end }}
#############################################
####This is the end customization added######
#############################################
{{ if ne $disableApplyAll true }}---
{{end}}{{end}}{{ if ne .DisableApplyAll true }}{{ if and (gt (len .Results) 0) (not .PlansDeleted) }}* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
* `atlantis apply`
* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
* `atlantis unlock`{{end}}{{end}}{{ template "log" . }}
{{ end }}
Logs
N/A
Environment details
Upgraded atlantis version to prerelease v0.21.0-pre.20221120
Modified template resides on the pod in the home/atlantis/.markdown_templates/ dir
Additional Context
I believe this go function overrides desired behavior:
I have been able to get this template customization to work when not exceeding gitlab comment size. (i.e {{ if (ge (len $result.Rendered) 500000) }}{{$result.Rendered}}{{ else }}:warning: The plan is to large to render in GitLab comments; run terraform plan locally.{{ end }})
The text was updated successfully, but these errors were encountered:
nitrocode
changed the title
Atlantis Markdown Template Overrides
Markdown Template overrides should allow overriding Output length greater than max comment
Dec 2, 2022
If a flag was created to override the maxCommentLength then if it wasn't set, it should default to the current set for each respective VCS.
nitrocode
changed the title
Markdown Template overrides should allow overriding Output length greater than max comment
feat: configure maxCommentLength
Dec 28, 2022
Community Note
Overview of the Issue
**Warning**: Output length greater than max comment size. Continued in next comment.
logic.--
:warning: The plan is to large to render in GitLab comments; run
terraform planlocally.
.Reproduction Steps
--markdown-template-overrides-dir=home/atlantis/.markdown_templates/
on containerargs
multiProjectPlan
template.multiProjectPlan
template in the following way:Logs
N/A
Environment details
home/atlantis/.markdown_templates/
dirAdditional Context
I believe this go function overrides desired behavior:
I have been able to get this template customization to work when not exceeding gitlab comment size. (i.e
{{ if (ge (len $result.Rendered) 500000) }}{{$result.Rendered}}{{ else }}:warning: The plan is to large to render in GitLab comments; run
terraform planlocally.{{ end }}
)The text was updated successfully, but these errors were encountered: