Skip to content

Enabled GitHub Actions to run the latest RuboCop 0.76.0 - #37582

Merged
kaspth merged 1 commit into
rails:masterfrom
yahonda:yahonda-patch-1
Oct 31, 2019
Merged

kaspth merged 1 commit into
rails:masterfrom
yahonda:yahonda-patch-1

Conversation

@yahonda

@yahonda yahonda commented Oct 29, 2019 •

Copy link
Copy Markdown
Member

Summary

This pull request enables GitHub Actions to run the latest RuboCop 0.76.0.

It has been proposed at Rails core mailing list https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/rubyonrails-core/o3wWBsTSbxU/s9X6pJHDBwAJ

Updated the default Ruby workflow:

  • Trigger this action for pull request and push
  • Install requried OS packages for Active Record connection adapters
  • Removing gem install bundler because Ruby 2.6 already installs it
  • Run RuboCop in parallel by bundle exec rubocop --parallel
  • Rename ruby.yml to rubocop.yml to represent the workflow

Bump RuboCop to 0.76.0 and rename Style/UnneededPercentQ to Style/RedundantPercentQ

$ bundle exec rubocop
Error: The `Style/UnneededPercentQ` cop has been renamed to `Style/RedundantPercentQ`.
(obsolete configuration found in .rubocop.yml

Removed .codeclimate.yml

koic added a commit to koic/rubocop-rails_config that referenced this pull request Oct 29, 2019
Fixes toshimaru#56.

This PR supports RuboCop 0.76 and renames `Style/UnneededPercentQ` cop
to `Style/RedundantPercentQ` cop.

rails/rails#37582 has not yet been merged.
However, this change is absolutely necessary. So, I'd like to
merge and release first for the convenience of rubocop-rails_config users.

@kaspth kaspth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My only real concern with this is that, iirc, GitHub actions have no caching yet and we run these builds fairly often. That all seems quite needless to me, but I don't know what to do about it yet.

Comment thread .codeclimate.yml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't really look like we use Code Climate at all since removing rubocop, should we just delete this file? cc @rafaelfranca

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree to disable Code Climate but did not remove .codeclimate.yml file in this pull request because as far as I know removing .codeclimate.yml does not disable Code Climate, it would restore the default maintainability checks disabled by #31292.

Refer rsim/oracle-enhanced#1938, removing .codeclimate.yml causes "codeclimate — 83 issues to fix".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah. We need to disable code cliemate in the web site. Let me see if I can do.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I deleted to hook. We can remove this file now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for taking care of disabling Code Climate at the web console. I have removed .codeclimate.yml file.

Comment thread .github/workflows/rubocop.yml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this line?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed this line.

@yahonda

yahonda commented Oct 30, 2019

Copy link
Copy Markdown
Member Author

I understand there are some concern about missing caching support.

For the elapsed time, Building and running RuboCop takes 7 min, Running unit tests takes about 16 min. Both jobs are running in parallel then it should not be a big problem, I think.

RuboCop Successful in 7m
buildkite/rails — Build #64622 passed (16 minutes, 18 seconds)

For the caching itself, there are some discussion going on at GitHub Community Forum, which says GitHub is working on caching package support.
https://github.community/t5/GitHub-Actions/Caching-files-between-GitHub-Action-executions/m-p/30974/highlight/true#M630

Updated the default Ruby workflow:

* Trigger this action for pull request and push
* Install requried OS packages for Active Record connection adapters
* Removing `gem install bundler` because Ruby 2.6 already installs it
* Run RuboCop in parallel by `bundle exec rubocop --parallel`
* Rename `ruby.yml` to `rubocop.yml` to represent the workflow

Bump RuboCop to 0.76.0 and rename `Style/UnneededPercentQ` to `Style/RedundantPercentQ`

```ruby
$ bundle exec rubocop
Error: The `Style/UnneededPercentQ` cop has been renamed to `Style/RedundantPercentQ`.
(obsolete configuration found in .rubocop.yml
```

Removed `.codeclimate.yml`
@yahonda

yahonda commented Oct 30, 2019

Copy link
Copy Markdown
Member Author

Squashed all commits into one.

@kaspth
kaspth merged commit 8b905a8 into rails:master Oct 31, 2019
@kaspth

kaspth commented Oct 31, 2019

Copy link
Copy Markdown
Contributor

Nice, thank you @yahonda 🙌

yahonda added a commit to yahonda/rails that referenced this pull request Oct 31, 2019
Follows up rails#37582

GitHub Actions cache requires `path:` parameter to configure
which directory to be cached. It looks there is no easy way to retrieve path information
using bundler command then workaround implemented to use `vendor/bundle`.

Thanks to actions/cache#4
koic added a commit to koic/oracle-enhanced that referenced this pull request Nov 1, 2019
@yahonda
yahonda deleted the yahonda-patch-1 branch June 23, 2020 15:23
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

Successfully merging this pull request may close these issues.

3 participants