allow users to customize the PR comment we put on github#115
allow users to customize the PR comment we put on github#115levibostian merged 11 commits intomainfrom
Conversation
…ng template engine
deno-library/template doesn't offer support for loops and I'll be needing that allowing users to provide a custom PR comment.
I chose vento because...
- very similar syntax to deno-library/template (using {{...}}) to be simple and easy to use.
- gives more powerful features like loops, conditionals.
- zero dependencies. small. simple.
…er file or string.
decafRunning deployments in test mode. Results will appear below. ...🟩 squash 🟩 merge method... 🌴 It will not trigger a deployment. No new version will be deployed. Learn moreLatest release: 0.8.0 Commit of latest release: bcfa675 Commits since last release: - allow users to customize the PR comment we put on github Related GitHub IssuesProblemTest mode PR comments are awesome, but it would be even more awesome if users could customize what the PR comment content is. SolutionUsers can provide their own string template. Then, we provide an object with a bunch of variables in it, and we can use that to render the comment. To users who do not use this feature, this feature will feel like a refactor to them where they will continue to see the default PR comment being used. Testing
Pushed some testing commits to this PR to make sure that it works as expected. Notes for reviewers...🟩 rebase 🟩 merge method... 🚢 The next version of the project will be: 0.9.0 Learn moreLatest release: 0.8.0 Commit of latest release: bcfa675 Commits since last release: - refactor: all uses of ventojs in the codebase re-use the util.renderStringTemplate function - improve error message when ventojs is given an invalid template The original error message I got when running the code in the CI was talking about regex, which is super confusing when I wasn't passing regex at all. So, I just think we need to have a better error message in general to help if users encounter a problem. When you pass in the template string as a param, there's a good chance that it uses different kinds of quotes inside of it, which then messes with the CLI Bash command that we're running, where we're trying to pass the string into decaf. So, as a way to properly escape that string you pass in, we write to a temporary file and then just pass that file to decaf. Because we're using string templates now, we don't want to use the appending feature of appending context to the existing PR comment. We want to completely replace it instead, just because then you don't have to add a bunch of logic to your string template. to help devs + agents learn ventojs quickly, putting documentation in the code via comments with basic usage. deno-library/template doesn't offer support for loops and I'll be needing that allowing users to provide a custom PR comment. I chose vento because...
|
Pull Request Test Coverage Report for Build 20304075141Details
💛 - Coveralls |
f7e325d to
8e5dbef
Compare
to help devs + agents learn ventojs quickly, putting documentation in the code via comments with basic usage.
Because we're using string templates now, we don't want to use the appending feature of appending context to the existing PR comment. We want to completely replace it instead, just because then you don't have to add a bunch of logic to your string template.
When you pass in the template string as a param, there's a good chance that it uses different kinds of quotes inside of it, which then messes with the CLI Bash command that we're running, where we're trying to pass the string into decaf. So, as a way to properly escape that string you pass in, we write to a temporary file and then just pass that file to decaf.
8e5dbef to
9e2207d
Compare
The original error message I got when running the code in the CI was talking about regex, which is super confusing when I wasn't passing regex at all. So, I just think we need to have a better error message in general to help if users encounter a problem.
…tringTemplate function
Related GitHub Issues
Problem
Test mode PR comments are awesome, but it would be even more awesome if users could customize what the PR comment content is.
Solution
Users can provide their own string template. Then, we provide an object with a bunch of variables in it, and we can use that to render the comment.
To users who do not use this feature, this feature will feel like a refactor to them where they will continue to see the default PR comment being used.
Testing
Pushed some testing commits to this PR to make sure that it works as expected.
Notes for reviewers