Skip to content
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

Thank you for forking TF-via-PR! #1

Closed
wants to merge 1 commit into from
Closed

Conversation

rdhar
Copy link

@rdhar rdhar commented Jan 14, 2025

Hey @ctian1, thanks for the fork, and great to see a flurry of activity around PR-commenting logic!

Is there any particular feature or enhancement you're looking for? Happy to help support 👍

@ctian1
Copy link
Owner

ctian1 commented Jan 14, 2025

Hi, awesome project btw! There was an issue with 'on-change' not working because my terraform install had the github actions "wrapper" enabled. Also, there's a case where with on-change, a comment can be left because there's changes, but then once the changes are removed, the comment is not removed. That's why I added that code

@rdhar
Copy link
Author

rdhar commented Jan 14, 2025

Thanks for the kinds words!


There was an issue with 'on-change' not working because my terraform install had the github actions "wrapper" enabled.

Ooh, I wasn't aware the terraform_wrapper input had any effect. Would you mind clarifying what exactly wasn't working, so we can document it?


Also, there's a case where with on-change, a comment can be left because there's changes, but then once the changes are removed, the comment is not removed. That's why I added that code

Ooh, that's a great edge-case which I hadn't considered! Did you manage to make this work as expected on your fork?

@rdhar
Copy link
Author

rdhar commented Jan 15, 2025

By the way, you're likely one of the first adopters of the on-change, so very keen to hear your thoughts/feedback of the action as a whole!

@ctian1
Copy link
Owner

ctian1 commented Jan 27, 2025

Ooh, I wasn't aware the terraform_wrapper input had any effect. Would you mind clarifying what exactly wasn't working, so we can document it?

I believe the exitcode is always 0 with the wrapper so the exitcode/comment logic wouldn't work.

Ooh, that's a great edge-case which I hadn't considered! Did you manage to make this work as expected on your fork?

I think so, I haven't actually ran into it lately.

By the way, you're likely one of the first adopters of the on-change, so very keen to hear your thoughts/feedback of the action as a whole!

Works great! Another thing I realized is very large plans may run into github comment length limit.

@rdhar
Copy link
Author

rdhar commented Jan 27, 2025

I believe the exitcode is always 0 with the wrapper so the exitcode/comment logic wouldn't work.

Ooh, that's a great call-out — I'll have to document it in the README.


I realized is very large plans may run into github comment length limit.

Thankfully, that shouldn't be an issue since the Action truncates to fit well within GitHub's comment's limit (2e16 = 65,536) automatically!

@ctian1
Copy link
Owner

ctian1 commented Jan 27, 2025

Yeah it still posts a comment, but the plan itself is then not fully visible

@rdhar
Copy link
Author

rdhar commented Jan 28, 2025

Yeah it still posts a comment, but the plan itself is then not fully visible

That's right, the plan isn't fully visible in the PR comment due to GitHub's character limit restrictions. However, if you click the "view log" link in the footer, it should redirect you to the exact workflow > job > step, where the plan is available in its entirety.

Here's an example of a PR comment with a truncated plan. Lemme know how that works out for you!

{1E3422CA-9ED3-4BCA-8ED5-19AC59F0C32B}

@ctian1
Copy link
Owner

ctian1 commented Jan 28, 2025

Oh I see, that should be fine then.

@rdhar rdhar closed this by deleting the head repository Feb 4, 2025
@rdhar
Copy link
Author

rdhar commented Feb 4, 2025

Happy to share this has been shipped with v13.1.0, where your contribution has been credited!

Please consider ⭐ this project, if you or your team find it useful.

GitHub repository stargazers


@ctian1 Not only has terraform_wrapper: false been documented in the Readme, but the deletion of any prior PR comment should also take place when there is no change if comment-pr: on-change. Lemme know how it works for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants