Advanced tools configurations for reviewbot

14 views
Skip to first unread message

Дмитрий Лисичкин

unread,
Aug 27, 2021, 5:02:40 AM8/27/21
to Review Board Development
Hello. I spend a little time for testing rubocop integration and see some
problems.

Not sure that is a bug/flaw or it not a problem at all from your point of view.

In general when you work with rubocop you create a configuration file that allow you to enable/disable and configure some checkers.
That configuration files can be really big and usually is placed in root of project repository.

Web interface of reviewboard allow me only disable some checks per integration.

In our case we have a workaround because rubocop allow to place configuration on system level. So I just put config on reviewbot server and it start to work.
But it can be unappropriate if we need different configurations per repositories.
Anyway it solve not all problems because reviewbot start checks per individual files prepared in root of temp directory.
The problem is about checkers that check that directory structure is correct.
Second problem is disabling/enabling checkers based on file path.
For example we can disable some checkers only for feature tests.
Example config partition:
```
RSpec/ExampleLength:
  Max: 15
  Exclude:
    - 'spec/features/**/*_spec.rb'
```
In general that problems can be resolved if reviewbot will check not indivdual files but directory that contains prepared content. Siplest way is just export repository and apply patches. Another way is about export individual files with correct directory structure and place rubocop configuration in that directory too (from repository root or from tool configuration).
Not sure about performance and is it a correct solution for reviewbot architecture.
Is it a reviewbot limitations or bug/flaw?
I think that in other linters there is a similar problems, so I think that it a general question.

Christian Hammond

unread,
Sep 20, 2021, 6:19:51 PM9/20/21
to reviewb...@googlegroups.com
Hey,

I meant to reply to your e-mails on this. Read through them and the feedback is excellent. I just haven't circled back to the Review Bot work until now.

So for some tools, we have a text field allowing a configuration field to be provided, which we'll then write out and pass to the appropriate tool. Would that be sufficient for the per-path configuration, do you think?

It also sounds like part of the issue is that the tool doesn't require a full-repository checkout. Tools can be written to either process individual files, or entire repositories, with the latter requiring additional setup in order to work. That limits the usefulness of the tool for more people. Right now, there's no way for a tool to be able to be configured to do both, or for a tool to work with a subset of a repository. That'd require additional thought...

Christian

--

---
You received this message because you are subscribed to the Google Groups "Review Board Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard-dev/48e35623-2417-465b-9ad2-da78ceb190b2n%40googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Дмитрий Лисичкин

unread,
Sep 24, 2021, 5:52:39 AM9/24/21
to Review Board Development
Hello, thanks to reply.
Not sure that I understand you correctly but I try answer for some questions.

> So for some tools, we have a text field allowing a configuration field to be provided, which we'll then write out and pass to the appropriate tool. Would that be sufficient for the per-path configuration, do you think?

No it's not. Our rubocop configuration file is almost 300 lines of code. There no way to get this configuration actual on our repositories and on reviewboard too.
Also CLI interface allow to use not all features that allowed in configuration file.
There example of rubocop configuration that disable some checks by a complex rules:
```
Metrics/BlockLength:
  Exclude:
    - '**/*.rake'
    - '**/*_spec.rb'
    - '**/spec/factories/*.rb'
    - '**/spec/support/*.rb'
    - !ruby/regexp /plugins\/some_prefix_.*\/lib\/.*_patch.rb/
```
In case of rubocop we can use some workaround, e.g. it allow to inherit configuration from web-resource:
```
# ~/.config/rubocop/config.yml
```
But It not allow to specify web-based config as command line argument. For stylelint I even don't find a similar feature.
So I don't thinked that CLI interface is enough for a powerful tools.
Maybe web-path for config in tool configuration page will be a appropriate solution but in most cases developers keep this configs in repository:
.overcommit.yml
.rubocop.yml
.stylelintrc
Dangerfile
.editorconfig
.eslintrc.yml
etc

I really love how works https://github.com/github/super-linter but it works only on github actions and have a little different concept then reviewbot.

вторник, 21 сентября 2021 г. в 01:19:51 UTC+3, Christian Hammond:

Дмитрий Лисичкин

unread,
Sep 24, 2021, 5:59:40 AM9/24/21
to Review Board Development
Also I want to say thanks for your work. Linters integrations is a best thing that can be in review process. It save a LOT of time and frustration.

пятница, 24 сентября 2021 г. в 12:52:39 UTC+3, Дмитрий Лисичкин:
Reply all
Reply to author
Forward
0 new messages