Page MenuHomePhabricator

rubocop should run after patch set submission to every repo that has Ruby code
Closed, ResolvedPublic

Description

Bug 63469 implemented basic Ruby syntax check for all repos that have Ruby code.

The next step is to run a linter.

Dan has suggested rubocop[1]. As far as I can see it is the most popular ruby linter[2].

1: https://rubygems.org/gems/rubocop
2: https://www.ruby-toolbox.com/categories/code_metrics


Version: wmf-deployment
Severity: normal
Whiteboard: zfilipin
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=63307
https://rt.wikimedia.org/Ticket/Display.html?id=8103
https://bugzilla.wikimedia.org/show_bug.cgi?id=70605

Details

Reference
bz69245

Event Timeline

bzimport raised the priority of this task from to Normal.
bzimport set Reference to bz69245.
hashar added a comment.Aug 8 2014, 1:54 PM

We need a way to install rubocop. We can probably have it run on labs instance and use gem to install it on job run.

We found out a way to share a gem repository on instances which thus act as a cache preventing to fetch the gem again and again. The snippet is:

  1. Shared cache of gems to avoid hitting rubygems all the time
  2. See https://github.com/bundler/bundler/issues/2856 export GEM_HOME="$WORKSPACE/../gems"

Then gem install.

Ideally, we should have rubocop packaged for Debian and have it installed via puppet. I think ops have some utilities to easily create packages from gems.

Change 152918 had a related patch set uploaded by Zfilipin:
WIP Added builder that runs rubocop, Ruby linter

https://gerrit.wikimedia.org/r/152918

Change 152926 had a related patch set uploaded by Zfilipin:
WIP Run rubocop, Ruby linter, for all repositories that have Ruby code

https://gerrit.wikimedia.org/r/152926

rubocop will have to be packaged for Debian so we can easily run it. Zeljkof filled https://rt.wikimedia.org/Ticket/Display.html?id=8103

Looks like we will have to install rubocop as a gem somewhere in labs. Waiting for Antoine to get back.

Change 152926 abandoned by Hashar:
Run rubocop, Ruby linter, for all repositories that have Ruby code

Reason:
The continuous integration configuration files are now held in integration/config.git with Zuul layout files being under /zuul/layout.yaml

If there still is an interest in this patch, please port it to the new repository integration/config.git

https://gerrit.wikimedia.org/r/152926

Change 166563 had a related patch set uploaded by Zfilipin:
Added job template and builder that runs rubocop, Ruby linter

https://gerrit.wikimedia.org/r/166563

Change 152918 abandoned by Zfilipin:
Added job template and builder that runs rubocop, Ruby linter

Reason:
Moved to https://gerrit.wikimedia.org/r/#/c/166563/

https://gerrit.wikimedia.org/r/152918

Change 166563 merged by jenkins-bot:
rubocop and lint for all repos having Ruby code

https://gerrit.wikimedia.org/r/166563

Change 166805 had a related patch set uploaded by Hashar:
zuul: move rubocop jobs to experimental

https://gerrit.wikimedia.org/r/166805

Change 166805 merged by Hashar:
zuul: move rubocop jobs to experimental

https://gerrit.wikimedia.org/r/166805

Change 167549 had a related patch set uploaded by Zfilipin:
WIP Move Gemfile and Gemfile.lock to the repository root

https://gerrit.wikimedia.org/r/167549

Change 167566 had a related patch set uploaded by Zfilipin:
WIP run "bundle install" before cd-ing into browser folder

https://gerrit.wikimedia.org/r/167566

Change 167578 had a related patch set uploaded by Zfilipin:
Set up RuboCop

https://gerrit.wikimedia.org/r/167578

Change 167581 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167581

Change 167584 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167584

Change 167589 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167589

Change 167774 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167774

Change 167566 merged by jenkins-bot:
Run "bundle install" before cd-ing into browser folder

https://gerrit.wikimedia.org/r/167566

Change 167777 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167777

Change 167788 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167788

Change 167792 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167792

Change 167794 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167794

Change 167578 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167578

Change 167797 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167797

Change 167800 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167800

Change 167801 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167801

Change 167802 had a related patch set uploaded by Hashar:
Enable rubocop on mediawiki/{selenium,ruby/api}

https://gerrit.wikimedia.org/r/167802

Change 167803 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167803

Change 167804 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167804

Change 167805 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167805

Change 167802 merged by jenkins-bot:
Enable rubocop on mediawiki/{selenium,ruby/api}

https://gerrit.wikimedia.org/r/167802

Change 167811 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167811

Change 167813 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167813

Change 167823 had a related patch set uploaded by Zfilipin:
[BrowserTest] Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167823

Change 167824 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167824

Change 167825 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167825

Change 167826 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167826

Change 167823 merged by jenkins-bot:
[BrowserTest] Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167823

Change 167826 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167826

Change 167825 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167825

Change 167811 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167811

Change 167805 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167805

Change 167804 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167804

Change 167801 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167801

Change 167800 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167800

Change 167797 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167797

Change 167792 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167792

Change 167777 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167777

Change 167774 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167774

Change 167584 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167584

Change 167581 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167581

Change 167824 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167824

Change 167813 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167813

Change 167803 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167803

Change 167788 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167788

Change 167549 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167549

Change 168056 had a related patch set uploaded by Zfilipin:
Run RuboCop and Ruby jobs for CentralAuth

https://gerrit.wikimedia.org/r/168056

Change 168056 merged by jenkins-bot:
Run RuboCop and Ruby jobs for CentralAuth

https://gerrit.wikimedia.org/r/168056

Change 168061 had a related patch set uploaded by Zfilipin:
Enable RuboCop jobs for all repositories where it was experimental

https://gerrit.wikimedia.org/r/168061

Change 167589 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167589

Change 168264 had a related patch set uploaded by Zfilipin:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/168264

Change 168267 had a related patch set uploaded by Zfilipin:
WIP Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/168267

Change 168270 had a related patch set uploaded by Zfilipin:
WIP Run RuboCop and Ruby syntax check for mediawiki-vagrant

https://gerrit.wikimedia.org/r/168270

Change 168267 merged by jenkins-bot:
tests: Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/168267

Change 168061 merged by Dduvall:
Enable RuboCop jobs for all repositories where it was experimental

https://gerrit.wikimedia.org/r/168061

Change 167794 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/167794

Change 168264 merged by jenkins-bot:
Prepare repository for running RuboCop after every push to Gerrit

https://gerrit.wikimedia.org/r/168264

Rubocop is now running. Still not voting. Searching for new repositories with ruby code is reported as a separate bug.

https://phabricator.wikimedia.org/T1332