Commit Graph

349 Commits

Author SHA1 Message Date
Jacob Burroughs ae51c95095 Safer jobs moves
only clear the shard cache from multicache, and therefore
support distributed `delete_matched`

Change-Id: Iebda2e8b2df0a1aa85997c2ede47b113f0fadc15
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/300099
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-09-01 19:29:17 +00:00
Jeremy Stanley f1c8e4c11f warn before overwriting local canvas config in docker_dev_setup
test plan:
 - if you run script/docker_dev_setup.sh in a local repo
   that has been used natively, you should get a prompt warning
   you that your local configuration will be clobbered if you
   continue and suggesting you check out a clean copy of the repo
   to use in Docker

Change-Id: Ia9a22f5fcc0a07a1ef7df6e7773226a66dc4d7dc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/297353
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2022-08-01 20:01:01 +00:00
Aaron Shafovaloff 73a7fb0827 No more mutagen
macOS and docker desktop's support of virtiofs is a better path forward

Test plan:
  - Docker setup script works on MacOS

Closes FOO-2982

Change-Id: Ibb64390420bfa7ade82f00d962282db41917a89a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/294699
Reviewed-by: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-06-27 15:33:24 +00:00
James Butters c3f8c1bce2 set IS_MUTAGEN in linux/dev_setup.sh
when mutagen is found to be installed we need to set IS_MUTAGEN
to ensure all other steps are running the correct steps.

flag = none

Test Plan:
-Jenkins passes
-linux with mutagen, run docker_dev_setup.sh with no errors
  -the correct docker-compose.override.yml is copied
-mac, no changes. docker_dev_setup.sh should still work

Change-Id: Ia8111c005a344723d492a15a980770c4a63e2d12
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/290807
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
2022-05-06 14:18:08 +00:00
Mark McDermott 3a030cb5fc Don't use reserved address for `DNS_IP`
By having the `DNS_IP` point to a reserved
IP for the loopback, this causes all DNS lookups in
new containers to loopback to itself and unable to
find containers outside their network if the internal
DNS server(127.0.0.11) cannot find it as it doesn't
add the namespace of the dinghy-http-proxy container

flag = none

test plan:
1. Run `source script/common/utils/common.sh`
2. Run `setup_dinghy_proxy`
3. Ensure that
   `docker-compose container inspect http-proxy`
   has `DNS: 192.168.42.42`
4. Ensure that
    `/Library/LaunchDaemons/com.user.lo0-loopback.plist`
   has the correct alias IP.
5. Change the IP in the
   `/Library/LaunchDaemons/com.user.lo0-loopback.plist`
   and re-run `setup_dinghy_proxy`
6. Ensure that the script completes and
   fixes the IP in the file

closes: QUIZ-9476

Change-Id: I28a0668678da64e02bf2d05083d34992c3ab229a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/289650
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Mark McDermott <mmcdermott@instructure.com>
2022-04-20 01:37:28 +00:00
James Butters 9d324b8b5a support linux without mutagen docker setup
we should still support a docker dev setup on linux without mutagen.

flag = none

Change-Id: I73874c7f5650070a237e15f5928a0e2886a1b573
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288913
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Bobby Buten <bobby.buten@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2022-04-05 17:53:32 +00:00
James Butters 1432d3e72a Revert "Replace old config ymls with newer mutagen ymls"
This reverts commit d3fc54655d.

Reason for revert: broke M1, non-mutagen setup

Change-Id: Iddcfa0b086312b4ed22f400a61637ee248fd647d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288011
Tested-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-03-28 17:38:37 +00:00
James Butters d3fc54655d Replace old config ymls with newer mutagen ymls
flag = none

Test Plan:
-Jenkins passes
-running docker_dev_setup works from fresh machine
-running docker_dev_update works

Change-Id: I7852189b035683d7cb538b2a04319dd9659e2752
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287799
Reviewed-by: Bobby Buten <bobby.buten@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2022-03-25 15:38:49 +00:00
James Butters 08965f67ca remove dinghy from docker_dev scripts
dinghy is deprecated so we are removing it from our docker setup
scripts, now defaulting to mutagen with docker desktop for mac.

flag = none
closes: DE-1099

Test Plan:
-Jenkins passes
-run docker_dev_setup from clean machine
  -setup uses mutagen with docker desktop on mac
  -setup uses mutagen with docker on linux
  -dinghy_http_proxy can still be used
-if dinghy machine found running, fail script with message

Change-Id: I1916c16807e7893174f32074674125cec93bcb40
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287535
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2022-03-24 19:36:22 +00:00
James Butters 377a531e1f disable boyscout_mode for eslint
flag = none

Test Plan:
-Jenkins passes
-Jenkins passes with eslint warning, -1 on gerrit lint review
-Jenkins passes with eslint error, -2 on gerrit lint review

Change-Id: I1eb3fed097e62eba726d5df18a958dc49c2ccdb2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/287237
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-03-17 15:18:39 +00:00
Brian Watson 2f2a27d91b Upgrade to Selenium 4
Switches from standalone containers to explicit node+hub config

Selenium 4 has some differences in handling stale elements that we
should be aware of moving forward

closes OUT-4988
flag=none
[skip-stages=Flakey Spec Catcher]

Test-plan:
- make sure screenshots can happen for failures
- retrigger a few times and make sure things pass
- verify build summaries are intact
- verify FSC can still run seleniums
- verify local selenium running still works
  - firefox / chrome / edge where applicable
- verify docker selenium running still works
  - firefox / chrome / edge where applicable

Change-Id: I8f2fe5a34d712b5ccd7191bae7a9aeeb6f1f473d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/284811
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Brian Watson <bwatson@instructure.com>
2022-03-09 15:28:31 +00:00
James Butters eaca21a5f1 restore stdout and stderr in trap_result
Change-Id: I94b5b8fb6a0268c7329a852ec11a785b9502752f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/286521
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2022-03-08 13:51:53 +00:00
James Butters b567f1f098 run db:initial setup without -T
flag = none

Change-Id: I5e3fc94bad9c24fc873956adde10a870ca1cf8f8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285848
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2022-02-23 20:49:58 +00:00
James Butters 4e0a9e39de allow docker_dev_setup to use dory or dinghy_http_proxy
flag = none

Test Plan:
-Jenkins passes
-if dory is not installed and no dinghy-http-proxy container
  -will default to using dinghy-http-proxy setup
-if dory installed and dinghy-http-proxy container
  -prompt to use one or the other
-if dory installed and no dinghy-http-proxy container
  -dory will start

Change-Id: I79eceee014d3bea3a6957b9b9b6d751bd90b752a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283975
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2022-02-01 00:41:12 +00:00
James Butters d8d1078abf update docker_dev scripts to work with latest mutagen release
update docker_dev script to use mutagen 0.13.0, new dependency
mutagen-compose, update commands to use mutagen-compose.

closes: DE-1014
flag = none

Test Plan:
-Jenkins passes
-docker_dev_setup passes with all required dependcies
-with beta version of mutagen
  -docker_dev_setup fails, alerting to missing dependency
-with mutagen 0.13.0, without mutagen-compose
  -docker_dev_setup fails, alerting to missing dependency
-with docker desktop installed to Docker/Desktop.app
  -docker_dev_setup does not fail

Change-Id: I3e18403912ee2a362c306da2df88eb58faa39db1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/283663
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2022-01-27 19:57:22 +00:00
Ahmad Amireh 4d0de671d3 ensure workspace pkgs aren't fetched from registry
refs SEC-4437
flag = none

[pin-commit-respondus_lockdown_browser=8746ff2ccfd6e9ac1d7280687c88e9fa67c0f693]
[pin-commit-multiple_root_accounts=7b11533084764b3a34f390e9a75df26e9dd871f9]

rationale in the script file and more context in the accompanying ticket

~ test plan ~

edit package.json and modify one of the explicit workspace dependencies
such as @instructure/ready to have a specifier other than "*", run the
script and verify it exits with 1

    yarn --silent workspaces info --json | \
    node script/yarn-validate-workspace-deps.js 2>/dev/null

Change-Id: I6624ada67a21d433477a7ad4d36acf5801853b7a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282948
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
QA-Review: Ahmad Amireh <ahmad@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2022-01-18 19:15:21 +00:00
Bobby Buten 8be4bb35c3 purge pulsar from canvas
refs DE-966
flag=none

TEST PLAN:
  ensure build completes and all tests run successfully

Change-Id: I82ef402eb790fafce53393b17b4695c9151e1745
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281489
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
QA-Review: Bobby Buten <bobby.buten@instructure.com>
Product-Review: Bobby Buten <bobby.buten@instructure.com>
2022-01-03 20:37:22 +00:00
Keith T. Garner a399030940 make pulsar the default again
We're back to makign installing pulsar the default again. Later test
builds broke without it.

Change-Id: Icb994b5dc5a566537c4c9ad513ab0f0b2ca2893e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281209
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2021-12-14 19:18:40 +00:00
Keith T. Garner f01fdbb2cb fix sync between dockerfiles and pulsar optional
In earlier attempts to make pulsar optional for our docker builds, the
dockerfiles that need to be in sync got out of sync. This returns them
to being in sync, and makes the pulsar gems optional which is better for
open source users.

Change-Id: Id8a02878bb61cf589670526da0626a90da530a58
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281101
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2021-12-13 22:48:38 +00:00
Keith T. Garner 652292be62 change no pulsar to be the default
pulsar is on hold, so this patchset doesn't remove it from our docker
build, but makes it so you have to knowingly add it add it at docker
build time and at install_assets.sh time.

Change-Id: I1866191073b271b9309f96fb5363dc1f73e663a8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281091
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2021-12-13 20:58:31 +00:00
Keith T. Garner a4b51e639c add ability to ignore pulsar at build time
This patchset adds the ability to not install the pulsar library and
gems when building canvas in docker by adding an argument to the
Dockerfile and a command line argument to install_assets.sh.

Pulsar pre-built libraries are currently x86 only. ARM64 users will want
to do the following:
  - When building canvas docker images do: --build-arg WITH_PULSAR=0
  - When installing assets: script/install_assets.sh -p

Change-Id: I738c9172050c1eff4648531b62456199673ae691
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/281070
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
2021-12-13 20:14:14 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer 9b71ed2054 RuboCop: Style/BlockDelimiters, Style/Lambda
[skip-stages=Flakey]

auto-corrected

Change-Id: I642f868d75c079e698f1fe4161bbbe419dbe1827
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279374
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:30:47 +00:00
Cody Cutrer c302dd8bc1 RuboCop: Style/SymbolArray, Style/WordArray
[skip-stages=Flakey]

auto-corrected

Change-Id: Id187ed60c5590025e780d81b85b5212f51368f27
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279196
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 14:30:08 +00:00
Cody Cutrer 04e28fd25c RuboCop: Style/Next
[skip-stages=Flakey]

auto-corrected

Change-Id: Ia842e948dc2f6f0eb2d39a66e1c56cc4fe90bd5c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279168
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 14:29:04 +00:00
Cody Cutrer 0957de01c9 RuboCop: Style/StderrPuts
[skip-stages=Flakey]

auto-corrected

Change-Id: I98d48156cdff1f015d0c9dfdc53e3ece8bc6abe4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279172
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 02:50:08 +00:00
Cody Cutrer 687a81dc8e RuboCop: Style/GlobalStdStream
auto-corrected

Change-Id: Ia61715c7b8f51f1688880525f4a7d68ee91a1726
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279092
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-21 00:50:35 +00:00
Cody Cutrer 60be8542df RuboCop: Security
[skip-stages=Flakey]

manual

this isn't a complete fix, but addresses many offenses

note in particular for feature flags the enable_at key
has changed from doing eval to a Date.parse.

Change-Id: I1381a107c238dc7102a815cc0b38df390299e59f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279085
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-20 21:09:11 +00:00
Cody Cutrer 7b0031a2fe rubocop: install pre-commit hook in plugins
Change-Id: Ica5fdc2ea8306483e8597b9c4ea4f40f92b13c24
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279017
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-19 22:59:56 +00:00
Cody Cutrer bb548e0b2c RuboCop: Style/NilComparison, Style/NonNilCheck
auto-corrected

Change-Id: If8c067e5b9bd4d21131c6699900a7a14a988efeb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279000
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-19 22:38:10 +00:00
Cody Cutrer c4bc112611 RuboCop: Style/MethodCallWithoutArgsParentheses
[skip-stages=Flakey]

auto-corrected

Change-Id: Idcbd419ab2196101398715e6b8cdd8d70ae5c587
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278698
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:07:30 +00:00
Cody Cutrer 2152076574 RuboCop: Style/ZeroLengthPredicate
[skip-stages=Flakey]

auto-corrected, and also introduced empty? method on several
file-like classes so that the autocorrect is safe on them

Change-Id: I7c84a39fc3f11cad50bf4ccb3cd97883881c2129
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278756
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:07:03 +00:00
Cody Cutrer 4d43809cae RuboCop: Style/PercentLiteralDelimiters
[skip-stages=Flakey]

auto-corrected, with a post-review looking for multiline strings
to convert to heredocs

Change-Id: I7f7afb11edd63415cde10866822dd2ac5ba0d8be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278669
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 23:05:50 +00:00
Cody Cutrer fe75025e1d RuboCop: Style/RegexpLiteral
[skip-stages=Flakey]

auto-corrected

Change-Id: I98a7afefcbb3631ee046e45fcfc9f955ca7ddca8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278636
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-18 02:08:34 +00:00
Cody Cutrer d91263c442 RuboCop: Style/ExpandPathArguments
auto-corrected, but so many tweaks after to gemspecs it may as well
have been manual

Change-Id: I69aeb6e216894462d6d893ed4c123aa9898fc72f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278516
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-17 22:06:59 +00:00
Cody Cutrer 5067ecfb56 RuboCop: Style/ExplicitBlockArgument
[skip-stages=Flakey]

auto-corrected

Change-Id: I73d924591db9441458f2f128f6182d80da7e2cf1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278358
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-17 20:04:02 +00:00
Cody Cutrer fe3c624016 RuboCop: Performance/RedundantSplitRegexpArgument
[skip-stages=Flakey]

auto-corrected

Change-Id: Ic9b7b8d4c3b1d76c32d8e9645cf5208002737645
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278321
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-16 16:35:46 +00:00
Cody Cutrer 6f71031011 use bundler/inline to auto-install gems necessary for script/rlint
need to wrap the sub-process execution of bin/rubocop in a
Bundler.with_unbundled_env so that _it_ can also use bundler/inline
to install its dependencies

Change-Id: I08b86288152c156f3704d1e4f9c5bfb6a5cf7867
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277834
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-10 18:28:53 +00:00
Cody Cutrer 7fdf9d7588 RuboCop: Lint
[skip-stages=Flakey]

the balance. mostly. Lint/UriEscapeUnescape is put in the pending
block because it's so touchy, and I didn't want to deal with it
right now

all manual

Change-Id: Ibeb81e013f56f160d51f7d237a9bcfe98daa1e53
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277569
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-09 21:42:31 +00:00
Cody Cutrer 2d51e8e7fe brakeman: add a bunch of ignores
Change-Id: I937f65227c49c6605ddae350e150a965f2665123
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274431
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-29 03:39:54 +00:00
Cody Cutrer 61dc8fee12 eslint: don't count out-of-context errors as relevant
Change-Id: I81a90d3b75fc139765317a72e585519827b02f82
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274651
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-28 17:27:48 +00:00
Cody Cutrer 84edfdf44c rubocop: dont comment non-relevant warns
and add an override so you can set the severe level however you want

Change-Id: Ie932c96cde67db284e42d095509e654b057c1f00
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274569
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-28 03:26:40 +00:00
Cody Cutrer b68d11de70 rubocop: go back to a single .rubocop.yml
it was just too confusing on which one an editor is using, double comments
in jenkins, etc.

this is accomplished by several things:
 * required cops are just marked as severe, instead of using a separate
   config for them, and failing if anything shows up from that config
 * get rid of all the logic to only include certain directories for
   certain cops. turns out it's not _that_ ominous to correct errors
   across the entire repository before marking a cop as required.
 * but still auto-generate config to turn _off_ autocorrect for
   non-severe cops. this is important because auto-correct must run
   for entire files, and we don't want it auto-correcting optional
   things that you didn't touch.
 * update gergich to get more details from the parsed comments.
   this plus the prior point means we _don't_ have to have heavy mode when
   in autocorrecting, but we still display out-of-context lines that were
   autocorrected

this also makes it so we can use per-dir .rubocop.yml files again, so
take some of the exceptions out of the root and put them in their own
directory

Change-Id: Ie936d1a9920b68910acd250ba817c7b4a670b958
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274394
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-27 17:21:02 +00:00
Cody Cutrer 55c298c037 rubocop: script/rlint -a implies --heavy
since auto-correct always does the entire file, don't make it possible
to correct something _and_ filter out that it was corrected just cause
the current patchset didn't touch it

Change-Id: I7b37bfa89f85b66520db922b7214462f7445eafe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274314
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-24 02:30:34 +00:00
Cody Cutrer 969e38ada1 RuboCop: add option to get summary of offenses to script/lint
add an env var to enable safe-auto-correctable cops in the enforced
configuration, so that said summary can be useful

Change-Id: Id2819ac437bd8a1486add3ba29de51660619f668
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274264
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-23 21:10:31 +00:00
Cody Cutrer 6af8efa550 rubocop: tweak script/rlint
* if there are no errors, return early so that we don't print
   "Errors detected and possibly auto corrected" when there weren't any
 * remove setting up heavy_mode_proc that isn't used anymore

Change-Id: I5b11102647d6ef4799e9f9011b419a28ba52039c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274153
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 19:24:01 +00:00
Cody Cutrer ea68d75b24 RuboCop: Layout bin and script
Change-Id: I74e291e86b2f93701ede5650546502f559f5ea81
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274068
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 15:57:58 +00:00
Cody Cutrer bac7328a6e rubocop: run enforced config in heavy mode on jenkins
Change-Id: I42c9a8e6ab8cdd303c35e0d8d9756c783a653c69
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274038
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-21 20:41:02 +00:00
Cody Cutrer 4c74fd7df1 rubocop: use --force-exclusion for all commands
so that we don't accidentally try to lint things that aren't
ruby (like non-ruby scripts)

Change-Id: I871daeffa6a46861f827153bf81a7025bb11ddc3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274034
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-21 20:40:46 +00:00
Cody Cutrer 28315d4021 allow script/rlint to automatically work for plugins
when run as a pre-commit hook

Change-Id: I89460a569e845f59e5fd0e25db5b49e44bfea277
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273590
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-21 20:40:26 +00:00