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

reviewdog_reporter: github_pr_review is not working #26

Open
matthewbartos opened this issue Jul 23, 2021 · 3 comments
Open

reviewdog_reporter: github_pr_review is not working #26

matthewbartos opened this issue Jul 23, 2021 · 3 comments

Comments

@matthewbartos
Copy link

Hello, with this config I'm unable to see review comments with detected issues:

      - name: detekt
        uses: alaegin/Detekt-Action@v1.15.0.1
        with:
          github_token: ${{ secrets.PAT || secrets.TOKEN }}
          reviewdog_reporter: github-pr-review
          detekt_config: detekt-config.yml # Change config path
          reviewdog_level: error

Build is failing (issues detected), checks are passing, no comments are posted. The github_token is valid.

@alaegin
Copy link
Owner

alaegin commented Jul 26, 2021

Hello!

Could you provide GitHub Action's log?

@mattbusuu
Copy link

@alaegin I have the same issue:

Config

- name: detekt reporter
uses: alaegin/Detekt-Action@v1.23.6
with:
github_token: ${{ secrets.github_token }}
detekt_config: myApp/config/detekt/detekt.yml
reviewdog_reporter: github-pr-review
reviewdog_filter: nofilter
fail_on_error: false
reviewdog_level: info
detekt_baseline: myApp/config/detekt/detekt_baseline.xml

Logs

##[debug]Evaluating condition for step: 'detekt reporter'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: detekt reporter
##[debug]Loading inputs
##[debug]Evaluating: secrets.github_token
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'github_token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run alaegin/Detekt-Action@v1.23.6
##[debug]Evaluating: inputs.github_token
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'github_token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating: inputs.reviewdog_level
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:

Raw Output:
/github/workspace/myAppAndroidApp/src/androidTest/java/com/myApp/android/ui/pages/WebRegisterPage.kt:123:21: warning: timeout can be a `const val`. (detekt.MayBeConst)
Warning: [detekt] reported by reviewdog 🐶
TIMEOUT can be a `const val`.

Raw Output:
/github/workspace/myAppAndroidApp/src/androidTest/java/com/myApp/android/ui/FunctionalmyAppTest.kt:10:5: warning: TIMEOUT can be a `const val`. (detekt.MayBeConst)
##[debug]Docker Action run completed with exit code 0
##[debug]Finishing: detekt reporter

github-pr-check seems to work fine, and is even generated even without setting reviewdog_reporter to github-pr-check which is a bit strange too.

Is there anything I have missed?

@mattbusuu
Copy link

mattbusuu commented Dec 16, 2024

After reading the reviewdog documentation:

This reporter requires a valid GitHub API token to generate a diff, but will not use the token to report errors.

I was testing the implementation on my main branch, where the only violations were on pre-existing code. I assumed with the filter set to "no-filter" opposed to "diff_context" or "added" this would work, but apparently not.

In Reviewdog, they seem to say this is expected:

[1] Report results that are outside the diff file with Check annotation as fallback if it's running in GitHub actions instead of Review API (comments). All results will be reported to console as well.

So this seems to be unsupported functionality. E.g. trying to generate comments against the existing baseline with no file diff.

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

No branches or pull requests

3 participants