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

Add custom comment templating support #2647

Merged
merged 7 commits into from
Nov 11, 2022
Merged

Add custom comment templating support #2647

merged 7 commits into from
Nov 11, 2022

Conversation

pseudomorph
Copy link
Contributor

@pseudomorph pseudomorph commented Nov 7, 2022

This PR is a fork of the changes from #2481 , and addresses linting errors.

#2541 (comment)

Closes #1026

@jamengual
Copy link
Contributor

@pseudomorph Please add some docs on how to use this

@jamengual jamengual added the feature New functionality/enhancement label Nov 7, 2022
@pseudomorph
Copy link
Contributor Author

@jamengual - Thanks for your response. I'll try to work on this later today.

I forked from @ribejara-te 's PR since this is a feature I'd really like to see. I see the pre-release was already cut. Is there any chance of getting it added in to the upcoming release if I can address the documentation, or would it need to wait until a future release?

@nitrocode
Copy link
Member

@pseudomorph we do multiple pre-releases. We will review this before the next pre-release.

@nitrocode nitrocode marked this pull request as ready for review November 7, 2022 20:16
@nitrocode nitrocode requested a review from a team as a code owner November 7, 2022 20:16
@jamengual
Copy link
Contributor

@jamengual - Thanks for your response. I'll try to work on this later today.

I forked from @ribejara-te 's PR since this is a feature I'd really like to see. I see the pre-release was already cut. Is there any chance of getting it added in to the upcoming release if I can address the documentation, or would it need to wait until a future release?

we will do another prerelease in like 1-2 weeks so we can add this in.

@nitrocode
Copy link
Member

@pseudomorph could you add a test for a custom template as well?

@nitrocode nitrocode self-requested a review November 7, 2022 20:52
- Add test for custom template
@pseudomorph
Copy link
Contributor Author

I've added a flag/config parameter for setting where the custom template directory is. Added a single test to validate that a custom template gets rendered.

Will try to get to the documentation in the within the next day.

@nitrocode nitrocode self-requested a review November 9, 2022 22:42
@pseudomorph
Copy link
Contributor Author

I noticed that some of the templates can be made more DRY. This is more of an optimization, and might not be an issue for now. It might take another day or two to get to that if it's desired.

Also, website_link_check is failing, and I'm not sure why.

@ribejara-te
Copy link
Contributor

Yeah I mostly kept templates as-is, only DRYing what I saw was easy, hoping we would get to further optimize them down the line. Feel free to do so. 🙂

Btw thanks for pushing this down the finish line, really appreciated.

Markdown template overrides may be specified either in individual files, or all together in a single file. All template
override files _must_ have the `.tmpl` extension, otherwise they will not be parsed.

Markdown templates which may have overrides can be found [here](https://github.com/runatlantis/atlantis/tree/master/server/events/templates)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link fails for now but I think it will resolve once this gets merged. We can probably ignore this branch failure for now.

https://github.com/runatlantis/atlantis/tree/master/server/events/templates

@pseudomorph @ribejara-te

Copy link
Member

@nitrocode nitrocode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @jamengual @chenrui333 please give this a second review

@nitrocode nitrocode merged commit d620d5d into runatlantis:master Nov 11, 2022
@pseudomorph
Copy link
Contributor Author

Thank you!

@nitrocode
Copy link
Member

Thank you for the contribution!

@ribejara-te
Copy link
Contributor

Thank you all for your help!

@nitrocode nitrocode changed the title Add custom templating support Add custom comment templating support Nov 19, 2022
krrrr38 pushed a commit to krrrr38/atlantis that referenced this pull request Dec 16, 2022
* added custom templates support

* made default templates DRY

* Change init to anonymous function.

* Initialize anonymous function inside var

* - Add flag/cfg param for custom template dir
- Add test for custom template

* Add documentation.

* Address PR comments.

Co-authored-by: Ricard Bejarano <[email protected]>
@nitrocode nitrocode added this to the 0.21.0 milestone Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants