Commit Graph

308 Commits

Author SHA1 Message Date
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
Cody Cutrer 8b690ddc32 rubocop: a few fixes
* disable Layout/LineLength for now; it's not auto-correctable, and we have a
   LOT of violations
 * add a comment showing how to generate the final RuboCop enforced config
 * fix forcing of error level for gergich
 * fix boyscout mode always being on

Change-Id: Ie68b612f107e9e98b50a230a65ef2a616751362d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274008
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-21 17:27:41 +00:00
Cody Cutrer e9d63396ff rubocop: split configuration
* remove spurious .rubocop.yml override files
 * split the configuration into an enforced and optional
 * run both configurations in jenkins (may result in some duplicate
   comments at different levels)
 * auto-correct the enforced configuration in the pre-commit hook
 * fix comments for Gemfile.d and the root dir; enforced configuration
   is only applied to that directory for now

Change-Id: I8da21073d74e19138b1b580d66c7aae6465348d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273898
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 16:02:22 +00:00
Cody Cutrer 071278fd22 clean up lint_commit_message a bit
* allow it to be run as a commit-msg hook
 * fix rubocop problems (mostly)
 * output context prettier when run locally
 * migration message is an info, not a warn
 * don't stop giving messages just cause we gave
   the migration message

Change-Id: I80d4e0b6c55e7cf07e8a49838f9326e396c95dae
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272220
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-02 17:26:08 +00:00
Cody Cutrer de2603abec expand what files script/rlint will look at
* *.erb
 * *.rake
 * extensionless (i.e. scripts; rubocop itself will ensure they're ruby
   before actually inspecting them)

Change-Id: I86409e7b68b1ea5ff09c080a947dac6572bfae98
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272222
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-09-01 16:01:54 +00:00
Jon Scheiding 1f154881e8 Create /etc/resolver when setting up dinghy-proxy
Seems that directory doesn't always exist on MacOS

flag=none

test plan:
- Check whether /etc/resolver exists; if it does (and is empty), remove it
  - If it's not empty, back up its contents
- Run docker_dev_setup.sh
- Confirm that it succeeds with the Dinghy setup


Change-Id: I2958a798907c2e450645ee251348ef79e499f657
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269085
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
2021-09-01 13:03:01 +00:00
Cody Cutrer d75dd18a3a don't fail jenkins if there is a rubocop offense
gergich will process it and -1 it instead

Change-Id: I554ee1e63586bf27238b3cf0fc7fb70f1d2fe2c7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272252
Tested-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-25 22:21:20 +00:00
Cody Cutrer 79ef0ea4e4 include staged changes in script/rlint
especially because when run as a pre-commit hook, everything is staged

also add env var to bypass rubocop, and actually set a useful exit code

Change-Id: I4d7b0a5c5cdad0b0d9d988b9dd6d134d96576d8e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271956
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-08-24 18:14:17 +00:00
Cody Cutrer 31c7af578f remove SafeYAML
Psych has safe_load now, and it's fairly trivial to convert our existing
overrides to use that instead

Change-Id: I2648df8d4574e15fc9072a25882e318d902765c3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271939
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-08-24 16:58:54 +00:00
Cody Cutrer f95ed5f030 fix script/rlint to be spring aware
Change-Id: I2fe54ed2e2c9abc536500224fa1dda9b8348f1e3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271740
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-08-19 19:38:24 +00:00
Cody Cutrer 91158f7d75 add helper script for tracking down leaky specs
Change-Id: I88aeca4364c5345d3a2d567fc5bc4c31d58bb4d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270191
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-08-02 19:20:31 +00:00
James Butters 3b110d0aea Provide option to force rebuild containers
add rebuild option to docker_dev_update to force rebuild
of docker containers.

flag = none

Test Plan:
-Run docker_dev_update script with no options, no dockerfile changes
  -script does not rebuild containers nor prompts to stop running containers
-docker_dev_update --rebuild
  -prompt to stop running containers
  -containers are rebuilt
-docker-compose_update --update-code
  -prompted to stop containers
  -containers not rebuilt
-docker_compose_update --rebuild --update-code
  -prompted to stop containers
  -code rebased
  -containers rebuilt

Change-Id: I8deb365b8c1f53bfd3806bdb0bf87e2b4dff85ee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268129
Reviewed-by: Kyle Rosenbaum <krosenbaum@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>
2021-06-30 19:29:16 +00:00
James Butters 679e2dfe31 option to drop database or migrate existing
if database exists during docker setup, give option to drop
or migrate rather than just dropping.

flag = none

Test Plan:
-Run docker_dev_setup with no existing database
  -script will not prompt, creates and migrate new databases
-Run docker_dev_setup with existing database
  -prompted to drop or migrate
    -DROP the database; database dropped, created new and migrated
    -migrate existing; only migration is ran

Change-Id: Ifbc334b3e35d22e15880ff0b5ca12b3817027b6f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/268126
Reviewed-by: Kyle Rosenbaum <krosenbaum@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>
2021-06-30 16:30:40 +00:00
James Butters cc32af3ccd Revert "asset install in Dockerfile"
This reverts commit 655cecbd5d.

Reason for revert: broke dev environments

Change-Id: I97f47a8ef7ac369b3cb30e448a3cfa9997c03930
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267650
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-06-29 13:36:09 +00:00
James Butters 655cecbd5d asset install in Dockerfile
move asset compiling into the Dockerfile allowing for a simpler
docker dev setup.

flag = none
closes: DE-696,DE-365

Test Plan:
-mac normal setup
-mac mutagen setup
-linux normal setup
-linux mutagen setup

Change-Id: I7e178c1ca91ee1908c4af55e03ec0010f5abce8e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266332
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-06-24 19:25:48 +00:00
Andrea Cirulli 775fc1d63f add dinghy deprecation warning to docker dev setup script
Since Dinghy is currently deprecated show a deprecation warning
in case the local docker dev setup script is executed using
dinghy

refs DE-721

test-plan:
- build passes
- docker_dev_setup shows warning deprecation message if executed
with dinghy
- docker_dev_setup does not show deprecation message if executed
with mutagen

Change-Id: Ie84804f3e3012741c7be9c4622557e0c8d003d82
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/267421
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
2021-06-21 20:18:57 +00:00
Andrea Cirulli eb43dbea12 add untracked commands failure to telemetry
Add the ability to send the command and its output that failed
the setup/update script even if it is not tracked by the telemetry
script.

refs DE-531
flag = none

test=plan:
- docker dev setup/update work without telemetry
- docker dev setup/update work with telemetry enabled
- force the scripts to fail on an untracked command and check
that the failure is present in the telemetry splunk index

Change-Id: I7b0aabe915bab6a7ce6c3977667e0306fdcc4a2a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265725
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-06-08 21:11:31 +00:00
Jacob Burroughs e4b3ccc4b4 Start pointing people at libera
Change-Id: I98d9ebdb190c64eefdaf8f93abdb099c999b97a4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266176
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-06-02 16:00:08 +00:00
Andrea Cirulli 94fe2c07c7 fix setup/update script printing errors message 2 times
In case of failures the scripts will print the error message two times.
That is because the first time is printed due to an ERR trap while the
second one is triggered by EXIT trap.

refs DE-698
flag = none

test-plan:
- Build passes
- setup/update scripts works locally
- force the scripts to fail and check if only one error message is
printed

Change-Id: Iece00e5d9a8ccc35a859ee13c340b0fd40697ad8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265728
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-05-25 21:16:21 +00:00
Cody Cutrer 7fb1fd040d REQUIRE bundler 2.2.17
https: //nvd.nist.gov/vuln/detail/CVE-2020-36327
Change-Id: I0c43a92ed5c89a475794e1f73b00c528cf261750
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265630
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-05-24 22:49:05 +00:00
Aaron Ogata ad8a757b8d remove old rspec runner scripts from old Jenkins
refs DE-641

As part of the investigation into random selenium stage timeouts, remove old functionality that is no longer used for easier debugging / understanding of code flow.

Test Plan
1. Tests retry once when they fail for rspec / selenium

Change-Id: Id8d670fefcf8d3fd38fb1a5b8245a05b634288f7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/264782
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2021-05-12 14:13:00 +00:00
Andrea Cirulli 493549ddc8 add telemetry support for zsh
Zsh is the default shell on the new macOS and does not
implement function export features. In order to have both
bash and zsh to work we changed the snippet for opting-in
telemetry using a variable to store the function.

test-plan:
- local docker smoke passes
- setup/update scripts work in bash
- setup/update scripts work if executed on zsh
- test enable/disable telemetry from .bashrc and .zshrc

Change-Id: I4e034f486dde078bba517172114e9b3e01f1817f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/264024
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-05-03 16:37:09 +00:00
Andrea Cirulli e7e0a5d4c3 add arguments to script name for telemetry
With the mutagen support we introduced a --mutagen option to the
docker_dev_setup script. We should include the use of options
in our telemetry data so we can analyze data basing on how the
script was executed.

refs DE-658
flag=none

test-plan:
- local dev smoke passes
- docker_dev_setup works locally
- telemetry splunk data includes the arguments in the script_src
if used

Change-Id: I82958d2c022ec8b5b8c371b4cb1cbf16317cc81e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263849
Reviewed-by: James Butters <jbutters@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-04-28 17:23:17 +00:00
James Butters e38b3a49be add support for mutagen setup and update.
flag = none
closes: DE-529

Test Plan:
Test All On Linux and Mac
-docker_dev_setup without mutagen
  -test with dinghy not created, down, missing
-docker_dev_setup with mutagen
  -with docker desktop not running
  -with and without dory
-docker_dev_update with and without mutagen
  -with update-code option and without
-update_canvas for local is not broken
-following Next Steps, all works for mutagen

Change-Id: I7690dc2d919cf1b9d8af86200ec8439da9135d16
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262293
QA-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-04-27 19:46:36 +00:00
James Butters 2b55c483cc rebuild images with changes to Dockerfile
flag = none
closes: DE-627

Test Plan:
-jenkins build passes
-tested locally with a fake master
 sha that was used to rebase and detect
 changes to Dockerfile

Change-Id: Ia9a930b005f240d8382dff2c143848a84912303c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263700
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-04-27 15:04:35 +00:00
Andrea Cirulli dacb031a03 improve logging/output for rebase_canvas_and_plugins.sh
refs DE-626
flag = none

test-plan:
- local docker dev smoke passes
- rebase script works and it handles interruption and failures
- docker_dev_update script works and it handles interruption and failures
- test with and without plugins installed

Change-Id: I2360064f9cf623d16e9f2791d716ba1a213c01c4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263480
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-04-22 19:26:31 +00:00
James Butters c2bf287a2b set DOCKER env var to true, following our standard
flag = none
refs: DE-529

Test Plan:
-Jenkins docker smoke build passes
-running canvas_update local does not use docker commands
-running docker_dev_setup and docker_dev_update still works
 and use docker commands.

Change-Id: I44c0cd535f6857bebf6a3290efae6800c62c7c77
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263235
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>
2021-04-20 17:11:45 +00:00
Andrea Cirulli 321e89c88d improve logging/output for docker_dev_update.sh
Align the UX of docker_dev_update to the one we implemented
on the setup script. Use the spinner where the commands take
longer to be executed.

refs DE-625
flag = none

test-plan:
- Local docker dev smoke passes
- docker_dev_update works locally

Change-Id: I94b1eca298b3f398dfb88dff1ceedeb66d5a6c22
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263186
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-04-20 17:07:57 +00:00
James Butters e58e097d03 modify the directory hierarchy in preparation for mutagen
flag = none
refs: DE-529

Test Plan:
-docker_dev_setup still works on mac and linux
-docker_dev_update still works for mac and linux
-Jenkins docker smoke build passes

Change-Id: I707e272efdefa536c3362142c6233467f464bb54
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/263225
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>
2021-04-20 16:52:26 +00:00
Kyle Rosenbaum 5b996428a1 fix /usr/src/app permissions in local docker dev smoke test
refs DE-594

test plan:
- run local docker dev smoke test build in Jenkins
- verify permissions of application directory
- modify jenkins agent workspace to include
application directory.
- rerun local docker dev smoke test build
- verify permissions of application directory

Change-Id: I86bd669af30d7cc0286cccd5f6771f91a0f4afe9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261717
Reviewed-by: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-04-15 21:51:46 +00:00
Andrea Cirulli 7bb00247c7 create logging module for local docker dev scripts
In order to better organize the code, create a module for the logging
function to be used across all docker dev scripts

refs DE-570
flag = none

test-plan:
- local docker dev smoke passes
- scripts locally works as usual

Change-Id: I57b6084605b7a953aca064ee827ad0628021fe42
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262905
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-04-14 21:41:52 +00:00
Andrea Cirulli 9e02838107 remove unwanted output from setup script in jenkins
We the addition of the spinner jenkins is showing a lot of output
coming from the spinner library. We don't need the spinner in local
dev smoker test. We add the ability to disable the spinner if is
running in jenkins.

refs DE-623
flag=none

test-plan:
1- Local dev smoker test passes and does not show unwanted output
2- setup script works locally

Change-Id: I4e476137e72ba44db69284130a1a4a7e6531dca7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262831
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-04-13 19:41:10 +00:00
Andrea Cirulli a34b8ce9a9 add is_running_on_jenkins helper function
There are a lot of if -z $JENKINS to check if the script is running on
Jenkins. Since we don’t want that repetition in the code we should
create a function in common is_running_on_jenkins.

refs DE-622
flag = none

test-plan:
- local docker dev stage passes
- docker_dev_setup/update/rebase passes locally

Change-Id: I53191af729c8ce5b4b6d338c39bd20bc532d496f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262824
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-04-13 18:52:13 +00:00
James Butters 16cea75a47 move to docker-compose exec
to save time and clear up logs, start web contain and
dependant services then run docker-compose exec instead
of docker-compose run --rm for each command. No more
waiting for container to spin up and stop, also clears
the logs of all those extra messages.

closes: DE-593
flag = none

Test Plan:
-run docker_dev_setup.sh, should be no noticable difference
-run docker_dev_update.sh, should be no noticable difference
-Jenkins local-docker-dev build passes
-canvas_update for local non-docker still works

Change-Id: Id1e72f8af948905385aed6769a8d793d962e2e1f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262258
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-04-13 15:43:53 +00:00
James Butters 174e242745 update script to use new function name trap_result
flag = none

Change-Id: I876e9918888242ccea1158898379a9e4054f588f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262761
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>
2021-04-12 21:15:42 +00:00
Andrea Cirulli ec4b9c72c3 add outputlog to docker_dev_setup and prettify the output
Add a log that gather all the output of the commands, hide
output to the user and show a spinner if the commands takes
longer to run.

refs DE-482
flag = none

test-plan:
- local docker dev job passes
- docker_dev_setup works and the output is not shown to
the screen
- interrupt the execution of docker_dev_setup and check if
the user is notified with the interruption
- force docker_dev_setup to fail and check if the error
notification is present on the screen and the log shows
the actual error

Change-Id: I84870fee23d9d1280addfffbb234335577bb3b93
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261371
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Butters <jbutters@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-04-12 19:57:48 +00:00
Andrea Cirulli 868a98a807 rename intro_message and make it more general
The function intro_message is a general function and should
not print a particular message when invoked, also it has been rename
to better represent what the function is actually doing.

refs DE-470
flag = none

test-plan:
- docker_dev_update runs successfully
- canvs_update runs successfully

Change-Id: I6f49eb756ff4bb2549f900ada7bdf05bcbf1345b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262436
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: Andrea Cirulli <andrea.cirulli@instructure.com>
2021-04-07 20:57:40 +00:00
Ahmad Amireh 4243097b21 rename some things
fixes FOO-1265

[skip-eslint=true]
[pin-commit-analytics=7e49eefd7f59cbf43fd03bf8957bbbfa76f8d9d5]
[pin-commit-demo_site=adade2e38e46a358a4643cd3db2fe5ccffe39ec5]
[pin-commit-instructure_misc_plugin=47a3161102b0611af56d134fbd0c828ddc1b8abf]
[pin-commit-migration_tool=0dbac2f5b421d894395605ce4b583ef0f7d60b22]
[pin-commit-multiple_root_accounts=cc96d28c0d59bbe47acc64de4fdd8e1d2b029805]

Change-Id: I14c07f20bd260cf0de1f48ceb70b3c2313edf2d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258807
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-04-06 01:12:49 +00:00
James Butters 931eda14a7 fix bundler sync to work with local canvas
local canvas does not set env var BUNDLER_VERSION so the bundler
sync will fail always for local canvas. Modify the function call
to include the BUNDLER_VERSION for local canvas.

flag = none

Test Plan:
-run canvas_update with correct bundler version, script passes
-run canvas_update with incorrect bundler version, script will
 uninstall wrong version then install correct version.

Change-Id: I35cf6e86cad224e56e3de0f7e430acd81ac70cdf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262188
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-04-02 16:10:55 +00:00
James Butters e8bf351850 fix bundler if statement
flag = none

Change-Id: I694d382a03f4b186449a8f533405d94ccb97a9cf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262067
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-03-31 23:19:15 +00:00
James Butters 8464842a3f add bundler version check to docker_dev_update
we've seen some issues with bundler version getting out of sync
on containers leading to the bundle_install_with_check failing.
Add a bundler version check to the bundle_install_with_check to
install the correct version if needed.

flag = none
closes: DE-592

Test Plan:
-running docker_dev_update passes, no noticable changes
-update bundler gem to the latest inside web container
  -run docker_dev_update
  -message stating wrong version of bundler found
  -installs correct version and completes without error
-update bundler to latest inside web container, remove a gem
  -run docker_dev_update
  -message stating wrong version of bundler found
  -installs correct version and installs missing gem

Change-Id: I485c36924ba0e6e7f908abd165987d3f75900b63
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261969
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@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>
2021-03-31 19:29:42 +00:00
Cody Cutrer ed0c836985 remove script/rails
use bin/rails

Change-Id: Idebe66befc3a1e32833f13860587c9c4535998a1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259675
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-03-31 16:26:36 +00:00