-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allowing JobUrl to the PlanSuccess model for github comment templating #5392
base: main
Are you sure you want to change the base?
Conversation
I do not think policy checks have a URL status at all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the PR title and description to detail what this PR is actually doing, i.e. adding the job URL to the plan success model which can then be used by a custom plan success template. Also please detail the changes you have made to LockURLGenerator
and why.
It also needs markdown_renderer_test
updating with tests for this change.
Co-authored-by: Simon Heather <[email protected]> Signed-off-by: Corey Aloia <[email protected]>
Signed-off-by: Corey Aloia <[email protected]>
Hi @X-Guardian I believe I have made the requested changes. Could you have another look when you get time? Thanks! |
What
This PR adds support for including the job URL in the GitHub comment template by adding the property
JobURL
to thePlanSuccess
model.This PR also renames the
LockURLGenerator
toURLGenerator
as it will be used for generating more than just the lock url. Currently the code already uses the router to fulfill this interface, so I have added the functionGenerateProjectJobURL
which it gets from the router.Why
In certain cases, it's necessary to hide Terraform plan output in GitHub comments—such as in public repositories where the output may contain sensitive information. However, users may still need access to the plan details via a secure URL, such as one behind a firewall or ingress.
By including the job URL in the GitHub comment template (in addition to the existing GitHub check link), we provide users with clear guidance on why the output is hidden and where they can access it instead.
Tests
Tested locally by overriding the comment template and verifying the job URL was correctly included.
References
Notes
pegomock
unless I downgraded Go to 1.23.0 ingo.mod
.PolicyCheckResults
, but I’m unsure whether those results are accessible via a URL. Would appreciate any feedback on this!