-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add more detailed output with --verbose
flag
#25
Conversation
@G-Rath here's a draft PR for you to check out. It doesn't include the GitHub Action setup quite yet, but wanted to see how you like the new |
Looking good! I'm not sure how suitable it is for Github Actions, because you can't add to messages (so at best it'd just show the whole block without explaining what it's actually doing) but that might be fine and the best we can get anyway 🤔 |
@G-Rath I was reading over the documentation for Problem Matchers and originally thought we’d be able to just write some regex that captures all the changes to annotate them, but it seems like the limitations (annotation count limits) actually hinder this quite a bit especially for bigger codebases. 😢 As an alternative though, you can definitely set Chusaku to run in a GitHub Actions workflow and fail when there are pending annotations using the |
@nshki I don't think those limitations actually factor into this all that much, since they're not per PR - so e.g. fixing some of what caused the current annotations (for any tool) will result in more showing up when you push up the fixes for those. ( Additionally, long term I'd expect most changes to be only affecting a small number of routes (tbh I'd only expect 1-3) for existing projects that are having features and bug fixes applied; so this would mean you'd only have a small number of annotations that actually need changing. Finally, those limits are GHA specific and could be changed in future - overall, I think tools/clis can focus on outputting information in a way that can be parsed by machines without worrying about specific UIs. |
@G-Rath Great points! I was only considering the extreme case which would only really happen when Chusaku is introduced to a large codebase without actually running it in the same PR. I think this verbose output is sufficient enough to get parsed for a GHA setup. I'll spend a little time testing Problem Matchers with a separate Rails project and will tweak the output if needed. |
I've been testing the following GHA workflow in a private Rails repo:
{
"problemMatcher": [
{
"owner": "chusaku",
"pattern": [
{
"regexp": "^\\[(.+)\\/(.+):(\\d+)\\]\\n[\\S|\\s]+?\\n---NEW\\n([\\S|\\s]*?(?=(\\n\\[.+:\\d+\\])|\\n\\n))",
"fromPath": 1,
"file": 2,
"line": 3,
"message": 4
}
]
}
]
}
name: Chusaku
on: [pull_request]
jobs:
chusaku:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.4
bundler-cache: true
- name: Run Chusaku
run: |
echo "::add-matcher::.github/chusaku-annotations-matcher.json"
bundle exec chusaku --dry-run --verbose I haven't been able to get proper annotations yet, so still debugging, but I've tested the regex via Rubular and have gotten the correct match groups there. |
While I haven't cracked the GitHub Actions annotations portion, I'm going to go ahead and merge this PR since I think this will give people more parse-able output for any automation they'd like to run in conjunction with Chusaku. |
Discussion
#24.
Overview
This PR adds a
--verbose
flag to Chusaku and outputs changes in detail when used with that flag.Example output: