Commit Graph

399 Commits

Author SHA1 Message Date
Jon Willesen 32a74f2278 upgrade instUI to 5.38.0
refs ADMIN-2277

test plan:
- Do some spot checking all around, esp. on newer stuff written with
  InstUI
- Do some specific spot checking on:
  - Assignments edit page. Esp. with moderated grading
  - Gradebook late policies
- Check the original bug (ADMIN-2211)

Change-Id: Iaaaeb9d86dc2d59cb2c9ccca2a8764a5adb0896b
Reviewed-on: https://gerrit.instructure.com/176912
Tested-by: Jenkins
Reviewed-by: Anju Reddy <areddy@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2019-01-07 21:24:50 +00:00
Mysti Sadler e2a6aae42a Check last status on Chrome crashes
refs QA-567

Change-Id: Icebef61f594703629b64c8f7625c3f225d8a38f7
Reviewed-on: https://gerrit.instructure.com/173362
Tested-by: Jenkins
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
QA-Review: Mysti Sadler <mysti@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2018-12-10 19:48:07 +00:00
Clay Diffrient 93a6d18046 Add precommit hook for auto fixing files
This only affects javascript files and only affects things
from the prettier whitelist

This will run slowly if you don't have node_modules installed
locally (e.g., in Docker), but it will gladly attempt to
run things in Docker for you.

This adds a new githook_installer image that will install
the githook whenever a docker-compose up happens in the
repo.  It will also install the hook whenever a `yarn`
occurs locally (as a postinstall hook).

This commit should also not fail things.  For example
having unused variables is an ESLint error, but it isn't
autofixable.  It will log the error, but will otherwise
continue.  However, it will make this pretty with prettier
as well as fix any other autofixable ESLint errors.

closes CORE-2118

Test Plan:
  - Run `yarn`
  - Add some semicolons to something from the whitelist
  - git add that file
  - git commit and it will strip semicolons
  - In a dockerized Canvas:
     - docker-compose up
     - Add semicolons to a file
     - git add that file
     - git commit, it will take forever (~60s)
     - It should have stripped out semicolons

Change-Id: Id9198aa008808e898f29acb9ed64dd14ff843222
Reviewed-on: https://gerrit.instructure.com/171510
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-11-27 21:07:31 +00:00
Mysti Sadler fca0d0c3bd Attempt one retry one unknown worker crash
refs QA-567

Change-Id: Icb8ce583315f2a612b5421c9ed92d73db311a579
Reviewed-on: https://gerrit.instructure.com/172645
Tested-by: Jenkins
QA-Review: Mysti Sadler <mysti@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
Reviewed-by: Robert Lamb <rlamb@instructure.com>
2018-11-20 18:29:34 +00:00
Mysti Sadler 75ac7c0b26 Add more error status logging for unknown failures
refs QA-567

Change-Id: I6f2e9abce68fa749ac5e578344278f5aaac0c291
Reviewed-on: https://gerrit.instructure.com/172206
Tested-by: Jenkins
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
QA-Review: Mysti Sadler <mysti@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2018-11-13 22:32:50 +00:00
Mysti Sadler a6ad7d2efb Add error status logging for unknown failures
refs QA-567

Change-Id: Ib8c5daa6c2eb2145ba1cc08fd11aaf006d690f5c
Reviewed-on: https://gerrit.instructure.com/171759
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
Product-Review: Robert Lamb <rlamb@instructure.com>
Tested-by: Jenkins
2018-11-12 19:25:10 +00:00
Clay Diffrient 02fde29575 Fix up xsslint to work
This also moves us temporarily to a git branch version of xsslint until the
official package gets a new release with the appropriate fixes in place.

closes CORE-2125

Test Plan:
  - Automated tests pass
  - xsslint output shows that it linted many files

Change-Id: Id87e872dd2b7a08f11c0ddfaebdfc3f44e86c724
Reviewed-on: https://gerrit.instructure.com/171702
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-11-12 16:42:28 +00:00
Ryan Shaw d86d69015c Opt our js build tooling dirs into prettier
I guess since our team owns these we can opt them in now


Test plan:
* nothing should change

Change-Id: Ic7207e1033869ef60644c41bd5c80a3e8532a6dd
Reviewed-on: https://gerrit.instructure.com/171471
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2018-11-07 22:46:16 +00:00
Derek Bender 07baf6b655 spec: log postgres connection problems in test
closes: QA-630

Change-Id: Iabe15645e9ecfba5b7e17efa8649f4f7a90bd9ba
Reviewed-on: https://gerrit.instructure.com/169986
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Robert Lamb <rlamb@instructure.com>
Product-Review: Robert Lamb <rlamb@instructure.com>
2018-11-07 22:36:50 +00:00
Clay Diffrient 67c0cb161b Use set -e to force failure of generate_js_coverage
Test Plan:
  - Introduce a failing JS test
  - Run `COVERAGE=1 RUN_TESTS_FIRST=true yarn run test:coverage`
  - It should fail

Change-Id: I27c6c876c68ce76be2da85e0e573e2051ade1951
Reviewed-on: https://gerrit.instructure.com/169389
Tested-by: Jenkins
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2018-10-24 21:10:53 +00:00
Clay Diffrient 100f4da654 Make sure failure is reported when tests fail
Test Plan:
  - Introduce a failing JS test
  - Run `COVERAGE=1 RUN_TESTS_FIRST=true yarn run test:coverage`
  - It should fail

Change-Id: I26de85fac89a0091c7348abc45df3032b09f85ed
Reviewed-on: https://gerrit.instructure.com/169133
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-10-23 14:06:35 +00:00
Michael Hargiss 058d9a59a6 create log files for scripts
This addresses "No such file or directory" for first-time users
of script/canvas_update and script/prepare/prepare .

Test Plan:
  - qa-cr

Change-Id: I65373682830c7cfb169b6d0b5436dc24542cd446
Reviewed-on: https://gerrit.instructure.com/167770
Tested-by: Jenkins
Reviewed-by: Brian Watson <bwatson@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Michael Hargiss <mhargiss@instructure.com>
2018-10-11 16:23:54 +00:00
Michael Hargiss 3cfbdf31ac add selenium doc and prepare script
We have no documentation in Confluence or this repo for running
Selenium tests natively. This commit adds a doc for that.

We're also migrating the "prepare" script from the qa_tools repo
to this one.

Test Plan:
  - follow the instructions in doc/testing_with_selenium.md to
  verify it's accurate
  - run script/canvas_update to verify it still works
  - follow the setup instructions in script/prepare/README.md and
  verify it works

Change-Id: I11d63e60dc1faa8be1dfacfc9bebfcbea55c31f1
Reviewed-on: https://gerrit.instructure.com/167300
Tested-by: Jenkins
Reviewed-by: David Tan <dtan@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Michael Hargiss <mhargiss@instructure.com>
2018-10-10 18:22:06 +00:00
Ryan Shaw 85d9e19eb8 add packages/*/node_modules to nuke_node script
Change-Id: I218c77b289ae8f179db74edfabd2d7bb5c5e3ba7
Reviewed-on: https://gerrit.instructure.com/164045
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-09-12 04:12:29 +00:00
Ryan Shaw d49c379e85 put version number in instUI auto-upgrade commit message
test plan:
when you run `yarn run upgrade-instructure-ui`,
it should put the version number it upgraded to in the commit message.

Change-Id: I8b463a12994b31d9c2ae80458b51c24d183de9ee
Reviewed-on: https://gerrit.instructure.com/161314
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-08-21 22:48:46 +00:00
Ryan Shaw e8a88cceea A script to just update instUI
Closes: CORE-1709

This is what our Jenkins job to pull in every instui RC commit will use

Test plan:
* run `yarn upgrade-instructure-ui`
* it should make a commit that has new entries in yarn.lock for all the
  instUI packages that uses the latest rc version on the npm registry
* it should not affect anything else besides yarn.lock

Change-Id: I78cce6e801015819c4e4b27e26ede352deceebb9
Reviewed-on: https://gerrit.instructure.com/160435
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-08-15 20:21:10 +00:00
Frank Murphy 4159e09bc0 Match services docker workflow.
Fixes OUT-2367

There are now two scripts:
- docker_dev_setup.sh: will create / recreate the service
  and all databases locally
- docker_dev_update.sh: can be used to migrate the local
  master branch. Will also pull plugin changes and run the
  relevant migrations.

Both scripts now directly use parts of canvas_update under the hood,
which will hopefully make future workflow changes less painful.

Test Plan:
- With docker:
  - optional: create a new canvas checkout
    (you can use a different directory name to avoid destroying your
     current database)
  - git fetch
  - check out this gerrit, and use `git checkout -b 2367` to
    create a branch for it
  - git checkout origin/master~200
  - git checkout 2367 -- script
  - ./script/docker_dev_setup.sh (follow all prompts)
  - docker-compose up -d
  - login, accept the terms of use
  - docker-compose down
  - git checkout master
  - ./script/docker_dev_update.sh -n code
  - docker-compose up -d
  - login, verify you are not asked for terms of use and the school name
    is the same as before.
  - docker-compose down
  - ./script/docker_dev_setup.sh again (nuke the old database,
    change the root account name)
  - docker-compose up -d
  - login, accept the terms of use, verify the new account name

Change-Id: Ie40600d7ea1e90633d9139b4cc1cf853695ac8f8
Reviewed-on: https://gerrit.instructure.com/151547
Tested-by: Jenkins
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Dariusz Dzien <ddzien@instructure.com>
Product-Review: Neil Gupta <ngupta@instructure.com>
2018-08-14 17:08:58 +00:00
Steve Kacsmark 9b07536047 Don't overwrite local docker installs on linux
If a user has installed docker via other means, checking for docker.io
will cause apt-get to install over it and break the existing docker
installation. Since docker-compose will install docker.io recursively,
this is safer for users that have things configured already.

Change-Id: I6c45c70fbcdcdb8597310372fa331d764b1dd859
Reviewed-on: https://gerrit.instructure.com/158944
Reviewed-by: Omar Khan <okhan@instructure.com>
Product-Review: Steve Kacsmark <skacsmark@instructure.com>
QA-Review: Steve Kacsmark <skacsmark@instructure.com>
Tested-by: Jenkins
2018-07-31 13:30:28 +00:00
Clay Diffrient 2dc1d7fa86 Add a way to generate better js coverage
This should pick up coverage from both karma and jest
in Canvas proper.  It should also pick up coverage from anything under
packages/*

closes CORE-1265

Test Plan:
  - Run `COVERAGE=true yarn test`
     - Coverage reports (coverage-final.json) should generate in all
       packages such as (canvas-planner) as well as in coverage-karma
       and coverage-jest
  - Run `yarn run test:coverage`
     - coverage-js folder should be generated.  Opening index.html
       should show the full coverage report
  - Remove coverage-{js, karma, jest} and
    packages/canvas-planner/coverage as well as .nyc_output to get back
    to a clean state
  - Run `RUN_TESTS_FIRST=true yarn run test:coverage`
     - All tests should run and generate the appropriate report just
       like the last time in coverage-js

Change-Id: I50744b8977e0683e079af5bdd2865dbcd6ad9066
Reviewed-on: https://gerrit.instructure.com/146098
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
2018-07-17 14:19:03 +00:00
Dariusz Dzien cb38a9e3a8 Use --no-deps in docker_dev_setup and install gems in parallel
Test plan:
 - `./script/docker_dev_setup.sh` still works

Change-Id: Id2021e3870cbd3d8645ecadff3034f3f2b0cfe08
Reviewed-on: https://gerrit.instructure.com/155306
Tested-by: Jenkins
Reviewed-by: Michael Hargiss <mhargiss@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Dariusz Dzien <ddzien@instructure.com>
2018-06-29 16:37:00 +00:00
Han Ngo f9a75654a1 Warm fix broken API Token Scopes file
Fixes PLAT-3550

Test Plan:
- Verify there is no 'API Token Scopes' under OAuth2
- Verify there is only one link 'API Token Scopes' under Resources
- Verify there is no code left related to generating the 'API Token
Scopes' table under OAuth2

Change-Id: Ib00a4aeec102eafc22169ac5322b581fef797a0b
Reviewed-on: https://gerrit.instructure.com/155247
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2018-06-27 17:38:28 +00:00
Omar Khan 6fb94bdd22 Build assets before running migrations
The migrations now fail with `BrandableCSS::DefaultMD5NotUpToDateError`
if you try to run them before building assets. This commit updates the
docker_dev_setup.sh script to build assets first to avoid this error.

Also updates the script to use the correct docker package: `docker` in
the Ubuntu package repos is actually some kind of system tray thing. We
want the `docker.io` package:
https://packages.ubuntu.com/xenial/docker.io

Refs gh-1300

Change-Id: Iba9a6f9bffe1a9e60bd715f1214caaab0394d37e
Reviewed-on: https://gerrit.instructure.com/150865
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Omar Khan <okhan@instructure.com>
QA-Review: Omar Khan <okhan@instructure.com>
2018-06-26 20:52:49 +00:00
Ryan Shaw 74d17ccf3e rm script/remove-packages-from-yarn-integriry
closes: CORE-1497 (along with the other that has already been merged)

I missed this with the rest of my yarn workspaces commit. Don’t need it
anymore

Change-Id: I1608b8056699a563a81b3b97e7c54ae7ebbc7c09
Reviewed-on: https://gerrit.instructure.com/152453
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-06-06 20:08:02 +00:00
Ryan Shaw e415eaa961 Use yarn workspaces
Run `script/nuke_node.sh` to clean everything up
Run `yarn install` it should install everything for everything
Run `yarn build` and `yarn test` they should work exactly as before

Change-Id: I11a27ff2d705c6cbb3b3f9029dd8b32138706146
Reviewed-on: https://gerrit.instructure.com/151356
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-06-04 20:02:02 +00:00
Derek Bender 0d77c3278f add --pure-lockfile to local-yarn script
test plan:
- docker build succeeds
- specs pass

Change-Id: Ie60f52a9e8f473454544a0aa67e1cce0197a2776
Reviewed-on: https://gerrit.instructure.com/151938
Reviewed-by: Bryan Petty <bpetty@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2018-05-30 21:52:49 +00:00
wdransfield 8b0740be29 Add API Token Scope Docs
Closes PLAT-3394

Test Plan:
- Run the `doc:api` rake task
- Navigate to /doc/api/index.html and verify there
  are two new links in the OAuth2 section ("Developer
  Keys" and "API Token Scopes")
- Verify both links work
- Verify the token scopes documentation has a table
  for each scope group and includes all Canvas
  scopes
- Verify "Resources" documentation pages now display
  the scope along with each API endpoint

Change-Id: I2fea0ff531744dbaf63d24619b3c0e9655a25a7a
Reviewed-on: https://gerrit.instructure.com/151010
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2018-05-29 18:21:57 +00:00
Brent Burgoyne e1ab28f0ef don't delete linked packages with yarn install
Change-Id: I95e2fd1695c111fe153c9cdb91637a095333293a
Reviewed-on: https://gerrit.instructure.com/149676
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
Tested-by: Jenkins
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-05-09 19:22:17 +00:00
Ryan Shaw 680693256e Fix script/uncache-packages to work on macs
Test plan:
Run ‘yarn’
You should see output like:
Clearning cache for packages/canvas-rce
And not
usage: dirname path

Change-Id: Ida820eebf6811959e831b525ee8c0293df0c910b
Reviewed-on: https://gerrit.instructure.com/148780
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-05-01 18:59:10 +00:00
Brent Burgoyne f91658d4bf move canvas-rce to canvas-lms/packages/canvas-rce
closes CORE-994
refs RECNVS-398
refs CORE-1224
closes CORE-1237

test plan:
- yarn install
- smoke test rce
- tests pass

Change-Id: Ieaff024fa89879fac3e7edf99381f46de921cce2
Reviewed-on: https://gerrit.instructure.com/145671
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-05-01 13:46:18 +00:00
Mysti Sadler 77171b991e Use "build" script for packages pre-install
refs ADMIN-761

When we added canvas-planner to the packages
directory, we set up a prebuild script to
build everything we needed for Canvas that
would run during yarn install.  This causes
canvas-planner to have to do a lot that it
doesn't need to do when we just want the npm
packages to be installed (for the sync-
translations build or for other purposes)
so we're setting a specific build step
instead

Test Plan
- Specs pass

Change-Id: I72a0dc52cd9be1255985d69921d9910ba12e9ffe
Reviewed-on: https://gerrit.instructure.com/147565
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
QA-Review: Mysti Sadler <mysti@instructure.com>
2018-04-20 18:02:34 +00:00
Stewie (Nicholas Stewart) 5fa6bb57b9 Add copyright message to remaining .rb files
Update: Copyright years now reflect the year that the file was first
committed.

Refs: PLAT-3200

Test Plan: jenkins is still happy and specs pass!!

Change-Id: Ic26463defe41fc52cf4da8020976394c641f51d5
Reviewed-on: https://gerrit.instructure.com/143545
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Stewie aka Nicholas Stewart <nstewart@instructure.com>
2018-03-19 13:38:50 +00:00
Ed Schiebel 553105aa48 Get eslint working again
Wwhen files change in canvas and under packages/canvas-planner, eslint
bombs out.
When files hange in package/canvas-planner alone, they aren't linted
using planner's rules

fixes ADMIN-830

test plan:
  this isn't going to be easy.  While including the changes here:
  - commit a change to a canvas-lms .js file with an eslint error
  > expect gergich to log it in the jenkins output in gerrit
  - commit a change to a canvas-lms/packages/canvas-planner .js file with
    an eslint error
  > expect gergich to log both the above file eslint errors
  - revert the change to the canva-lms file so only planner has a lint
    errror
  > expect gergich to log it

Change-Id: I337ee0ff3025875a8faf427e2fb749d76ae09bed
Reviewed-on: https://gerrit.instructure.com/142470
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2018-03-09 14:03:38 +00:00
Leo Abner 1239a57fcb Fix initial setup migration issue
Test Plan:
 - N/A

Change-Id: If1503d1f640b9506762095185232d4e1c1732efc
Reviewed-on: https://gerrit.instructure.com/141715
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Leo Abner <rabner@instructure.com>
QA-Review: Leo Abner <rabner@instructure.com>
2018-02-23 06:21:16 +00:00
Ed Schiebel ec05f824fc Put finishing touches on planner under canvas
- update README with new instructions
- update how canvas runs sub-package tests
- remove planner's test server

closes ADMIN-742

test plan:
  - when jenkins runs, check to see that planner's tests run too

Change-Id: I2493b65f580c76b28f225f1330e99e1ceb1378b4
Reviewed-on: https://gerrit.instructure.com/139882
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Jon Willesen <jonw+gerrit@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2018-02-21 17:49:03 +00:00
Ed Schiebel 40b876493e Move planner under canvas-lms
closes: CORE-949

this also upgrades us to use what was on canvas-planner master
as of 1pm on 2/1/2018 (specifically 9569cc1)

test plan:
* canvas planner should work
* all automated builds should pass

Change-Id: Iecce81d640c8aacb79189e2b26946613a03d25f2
Reviewed-on: https://gerrit.instructure.com/135947
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2018-02-02 23:58:48 +00:00
Ryan Shaw abf158f09b remove line only needed by yarn 0.x
Change-Id: I51510fd066c981bac32ce6cb153647119fe3a39b
Reviewed-on: https://gerrit.instructure.com/136368
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-12-21 23:00:25 +00:00
Ryan Shaw c11e737980 force using yarn 1.3.2
closes: CORE-674

test plan:
* while running yarn 0.27, try to run `yarn`
* it should give you an error about how you need to upgrade yarn
* brew install yarn (or upgrade to yarn 1.3.2 however else you do that)
* run `yarn` 
* it should work and should not make any changes to your yarn.lock or 
  node_modules

Change-Id: I916febab60755c93d3f2591c9067c1c8d8903674
Reviewed-on: https://gerrit.instructure.com/133501
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-11-22 16:38:47 +00:00
Spencer Olson 0b7d4135a0 tweak docker_dev_setup script
Adds the dinghy tap before trying to install it.

Test Plan:
1. On a machine running OSX without dinghy installed, run the
   docker_dev_setup script. Verify dinghy is set up without issue.

Change-Id: I0479323aefd21554fb3bc2a8f00ced727b497496
Reviewed-on: https://gerrit.instructure.com/132850
Reviewed-by: Omar Khan <okhan@instructure.com>
Tested-by: Jenkins
QA-Review: Omar Khan <okhan@instructure.com>
Product-Review: Omar Khan <okhan@instructure.com>
2017-11-15 22:19:08 +00:00
Omar Khan b70b6b2936 Add docker_dev_setup.sh script
This script sets up a full docker development environment from scratch,
on mac and debian-based linux.

Test plan:

- On mac, run script/docker_dev_setup.sh
- Answer the prompts
- Check that the script completes successfully
- Run docker-compose up
- Open http://canvas.docker
- Repeat on ubuntu xenial

Change-Id: Ic1eb0bad791fcbfe3953691623f2fbfb40b9298b
Reviewed-on: https://gerrit.instructure.com/130857
Tested-by: Jenkins
Reviewed-by: Bryan Petty <bpetty@instructure.com>
Product-Review: Bryan Petty <bpetty@instructure.com>
QA-Review: Bryan Petty <bpetty@instructure.com>
2017-11-01 23:02:50 +00:00
Cody Cutrer 60ad30006b trigger consul event of HA Cache invalidation
refs CNVS-39528

Change-Id: Ib6025b893e31922724ef84de781ed98238d5d1b3
Reviewed-on: https://gerrit.instructure.com/127239
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-09-26 15:59:04 +00:00
Cody Cutrer 622ed3314a require yarn, not npm
Change-Id: I2dbb037d4cbb0de7952dde19196c6937d18924e9
Reviewed-on: https://gerrit.instructure.com/122554
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-08-14 15:27:14 +00:00
Jon Jensen 9a3ad8aa94 spec: don't let parallel workers stomp each others' cassandras
at some point we started loading/caching the cassandra config before
forking, which made every worker share the same keyspaces, causing
various specs to fail during the initial run

test plan:
* the build should be more stable

Change-Id: I804178152c165d72f3665ce1103c8af4736a9aa6
Reviewed-on: https://gerrit.instructure.com/122252
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-08-11 17:46:19 +00:00
Benjamin Porter ab1d21949e Copy yarn.lock in docker_pull_image.sh
Change-Id: I4d122b0384331663dddb9f58dacae12f2568619a
Reviewed-on: https://gerrit.instructure.com/119102
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
QA-Review: Brad Horrocks <bhorrocks@instructure.com>
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Tested-by: Jenkins
2017-07-14 20:19:15 +00:00
Benjamin Porter 50703292f5 Add some new installation steps to docker_pull_image.sh
Change-Id: I83e2791d6b6ac2f3f00cf6fdad428b365c2e0d01
Reviewed-on: https://gerrit.instructure.com/119072
Tested-by: Jenkins
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
QA-Review: Brad Horrocks <bhorrocks@instructure.com>
2017-07-14 19:45:50 +00:00
Benjamin Porter c7ec796804 Add volumes to nuke to docker_pull_image.sh
There were a couple more volumes that needed nuking.

Change-Id: I7450dd977955eaf65add72926585b1a98bcf1fa2
Reviewed-on: https://gerrit.instructure.com/119060
Tested-by: Jenkins
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
QA-Review: Brad Horrocks <bhorrocks@instructure.com>
2017-07-14 19:45:23 +00:00
Brad Horrocks 1fd429df4b Add script to assist those not wanting to build canvas :D
Change-Id: I597a91f4bf092729ee4d292b65fc5e65c6511247
Reviewed-on: https://gerrit.instructure.com/107876
Reviewed-by: Josh Orr <jgorr@instructure.com>
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2017-07-14 16:46:31 +00:00
Cody Cutrer f50f695176 upgrade to aws-sdk v3
Change-Id: I52ed6d98b70cac11f3004789fb750ace79c5a0d8
Reviewed-on: https://gerrit.instructure.com/110693
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-05-26 15:30:08 +00:00
Ryan Shaw fb41a8a46a rm …/vendor/{timezone,ie11-polyfill,fontface}
closes: CNVS-36805

I’m working towards turning on babel for public/javascripts
And so instead of having to worry about selectively adding excludes
For things in public/javascripts/vendor that we haven’t modified,
I’m just moving things out of there.

This commit just relies on gulp rev to put these files in
public/dist/* instead of having the intermediate artifacts
hanging around in public/javascripts/vendor/* that then
get copied/revved to public/dist by gulp rev.

This also minifies any gulp-revved js in production

Test plan:
* Nothing should change
* run compile_assets
* the javascript for your timezone data should load
  just fine like it did before
* the lato fontface observer should still be working
* go to the site in IE, there should not be any
  Js errors (like “Promise is not defined”)

Change-Id: I10b2e3f102276ab0ef5f58cbc0d981f5aa800522
Reviewed-on: https://gerrit.instructure.com/111251
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-05-19 18:21:14 +00:00
Ryan Shaw 444f6925c2 Make nuke_node handle gems/plugins/*/node_modules
refs: CNVS-36896

…since we just added the ability for plugins
to have their own package.json/node_modules

Change-Id: I963822a0c849c3bdf67faec9e77df16397a88d34
Reviewed-on: https://gerrit.instructure.com/112309
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-05-19 16:16:48 +00:00
Ryan Shaw 4c18ba1b20 make it so plugins can have their own package.json
closes CNVS-36896

test plan: 
check this out
check out g/108509 in gems/plugins/analytics
run `yarn`
you should see it install graphael for analytics

Change-Id: Iee6a2d8bb2ee46d1cddc596b972d447f9bb3b1d6
Reviewed-on: https://gerrit.instructure.com/111765
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-05-16 15:01:59 +00:00
Landon Wilkins 9f47ed9a91 copyright linter auto correct, refs SD-2295
test plan:
* create a new file "test.rb"
* add "AUTO_CORRECT_LINTERS=1" to your .env
* install the pre-commit hook:
  echo "bin/lint" >> .git/hooks/pre-commit
  chmod +x .git/hooks/pre-commit
* git add .
* git commit -m "this should fail"
* verify the commit fails
* add the auto-corrected test.rb
* try to commit again
* verify it commits successfully

Change-Id: I3d52d6b192ca3bd83266a3e58d594acc3c516782
Reviewed-on: https://gerrit.instructure.com/111088
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-05-11 20:06:08 +00:00
Landon Wilkins c83a8e8aa0 custom comment generation for script/tatl_tael, refs SD-2295
test plan:
* tatl_tael still works (see test commits)

Change-Id: I1854693bd665f4018d1f0475dc922ac360b8d8d8
Reviewed-on: https://gerrit.instructure.com/109783
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-05-04 20:13:55 +00:00
Jon Jensen 88df378ecb spec: check git_dir first
`wip?` depends on git working, so the current behavior goes 💥 for non-
plugin GERRIT_PROJECTs

Change-Id: I43fc95125add6afeb35c931305a60ffb2e754509
Reviewed-on: https://gerrit.instructure.com/109929
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-04-27 04:44:33 +00:00
Landon Wilkins 87ba5f0e90 cleanup tatl_tael, refs SD-2295
better foundation for more complex linters

test plan:
- tatl_tael still works (see test commits)

Change-Id: Iff463b69e7acf873418842883dbcab38c83b798b
Reviewed-on: https://gerrit.instructure.com/109373
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-26 15:27:44 +00:00
Clay Diffrient 679f1cb699 Add length exemption for revert commit messages
This will make it so revert commits can make it through
without needing truncation done on the original commit message

Test Plan:
  - Amend this commit and make the commit message really long
  - Run script/lint_commit_message
  - It will output an error message about length
  - Amend the commit again and put "Revert" at the beginning
    of the subject line.
  - Run the linter again
  - It will not print out the error now

Change-Id: Id2b57e202a0bbd46dbc8de29d9bcc984c9c5fe99
Reviewed-on: https://gerrit.instructure.com/109316
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-21 04:03:36 +00:00
Jon Jensen cf2f1d7510 spec: fix some oversights in re-run changes, refs SD-2387
ensure we pick up the other location style when queueing up reruns
and when deciding not to re-run changed files

test plan:
1. see examples that were rerun in selenium build on PS 2
2. see modified examples that were not rerun in rspec build on PS 2

Change-Id: I31e8f4b8cc0ef8a0cc6cb2d5e8b66d69d1e931c0
Reviewed-on: https://gerrit.instructure.com/109288
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-04-20 22:58:34 +00:00
Jon Jensen 072c71a90b spec: tweak rerun formatting slightly, refs SD-2357
include the line number of the not-rerunnable spec for easier tracking in
janky

test plan:
see intentional failures and rerun behavior in patchset 2

Change-Id: I3c381f94c71dc082a83f0f025794dc135b0336b4
Reviewed-on: https://gerrit.instructure.com/107760
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-04-06 19:40:01 +00:00
Jon Jensen a2e90cb51b ensure canvas_i18nliner uses the right coffeescript
just use whatever canvas uses, so we get the new hotness. also stop using
old jasmine since it brings along coffeescript

also tweak gem_npm stuff so they can have legit devDependencies

Change-Id: I39e3c6b96903dbbc9c4c38a886431d9b6f292616
Reviewed-on: https://gerrit.instructure.com/106476
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-03-27 19:39:24 +00:00
Derek Bender daa519130f remove script/eslint jsx glob
Change-Id: I8a7b72da8a5c6f97ad8c9a5540b3022436c270bc
Reviewed-on: https://gerrit.instructure.com/106463
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-03-27 18:26:38 +00:00
Jon Jensen 3141bcc65a spec: be less aggressive about resetting the test db, refs SD-2289
should speed up local testing a lot, and jenkins a little bit (mainly the
rerun phase right now). in a subsequent test repo commit we'll speed up
jenkins a lot, as we'll do a truncate right after we migrate, which means
the cost will be incurred in the post-merge build and not the patchset
build

* don't double truncate one of the shards
* don't randomize sequences unless an env var is set
* don't truncate unless it looks like we've never truncated
  (there are Accounts)
* remove some unnecessary switchmanning in rspec-queue

[ci verbose]

test plan:
1. run a spec on a freshly created/migrated test db
   1. confirm you see "truncating all tables"
   2. confirm you do not see "randomizing db sequences"
2. run the spec again
   1. confirm you do not see "truncating all tables"
   2. confirm you do not see "randomizing db sequences"
3. run the spec again with RANDOMIZE_SEQUENCES=1
   1. confirm you do not see "truncating all tables"
   2. confirm you see "randomizing db sequences"
4. in jenkins land on the initial run
   1. confirm you see "truncating all tables"
   2. confirm you see "randomizing db sequences"
5. in jenkins land on a rerun
   1. confirm you do not see "truncating all tables"
   2. confirm you see "randomizing db sequences"

Change-Id: Id24026e70afaa35abef4d02249be2c9ba27f1f21
Reviewed-on: https://gerrit.instructure.com/106043
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-03-23 19:36:56 +00:00
Jon Jensen dde8b3ca80 spec: stop linting for webpack topics
Change-Id: I8f3e0755de137a79fba477edeab23bd614e32c4d
Reviewed-on: https://gerrit.instructure.com/105458
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2017-03-16 22:48:12 +00:00
Ryan Shaw dae5c1d8ed Use es6 import/export syntax for everything in app/jsx
Closes: CNVS-34602

This makes it so we can use Jest to start testing things
as well as moves us forward to where everything will
use es2015 module syntax.

Webpack can handle import/export syntax natively.

Part of this was done by an automatic conversion tool
by running:
npm install ryankshaw/amd-to-es6
amdtoes6 --dir app/jsx --out app/jsx
but some of it had to be converted by hand since that tool
doesn't handle some es6 stuff like:
`...`, `static` or `import x {y, z} from 'foo'`

Test plan:
* webpack & selenium builds should all pass
* click around a couple pages to make sure things work

Change-Id: Id1b2bd55b4b7f27238754ceee720a77beca1df2b
Reviewed-on: https://gerrit.instructure.com/100536
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-03-16 15:38:39 +00:00
Simon Williams d625f63db2 don't `yarn install` from gems/ in parallel
there seem to be file system access collisions, and they are more
pronounced in the docker build.

test plan: `docker-compose build --no-cache web` should work

Change-Id: Ieeb734745846458eee4e689c3e98c384fe3b1f94
Reviewed-on: https://gerrit.instructure.com/105054
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Omar Khan <okhan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-03-14 22:29:24 +00:00
Ryan Shaw 5b88629fe0 Remove RequireJS support
closes: CNVS-31785

test plan:
all builds should pass

Change-Id: I2925934692a3d2f115f1289d7b50cb72d8cb907f
Reviewed-on: https://gerrit.instructure.com/104492
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2017-03-13 22:10:23 +00:00
Jon Jensen 0634e4d86c make xsslint handle import statements
do our own babylon parse and pass the ast into xsslint

test plan:
* use `import` in your jsx
* :cat_dance:

Change-Id: I6ea240e82143f44ea360240ada492e6cbbdaa853
Reviewed-on: https://gerrit.instructure.com/104107
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-03-06 19:29:39 +00:00
Jon Jensen ec1840b502 make xsslint not need js:generate, fixes SD-2160
this does make xsslint about 10x slower, since:
1. babel is slower than acorn
2. we now have to coffeescript everything on the fly

will revisit perf in another commit

Change-Id: I2ddad309d1921ba6a4e15cd79d3d8bd956a7e403
Reviewed-on: https://gerrit.instructure.com/103850
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-03-03 17:24:16 +00:00
Ryan Shaw 05f55c1c30 Deprecate `npm` client. Use `yarn` instead
Closes: CNVS-35152

This changes all our tooling that used `npm` to
Run scripts to use `yarn`. `npm` will still work
for now but if you have yarn installed, it will use
that.

Cheat Sheet:
old command      -> new command
npm install      -> yarn install (or just `yarn`)
npm run webpack  -> yarn run webpack
npm test         -> yarn test
See more at https://yarnpkg.com

Test plan:
* all Jenkins builds should pass
* without yarn installed:
* run script/nuke_node.sh
* it should work and warn you about how `npm` is deprecated
* now install yarn, e.g.: `brew install yarn`
* run script/nuke_node.sh again
* it should work and you should see silly yarn emoji
  in the output and it should be a lot faster

* the docker changes I made should work and docker should
  build correctly and use yarn.

Change-Id: I4aa31eeae3ecc504634a7c72a1ea0d3396f445e3
Reviewed-on: https://gerrit.instructure.com/102969
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-03-01 19:39:01 +00:00
Brad Horrocks bbfe35b108 update variable expanders
Add docs on how to update them
Update everytime we run doc:api

Change-Id: I3c7aa55d051fa5474e267897138ab01c3c7c3fb8
Reviewed-on: https://gerrit.instructure.com/102177
Reviewed-by: Jesse Poulos <jpoulos@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2017-02-27 23:15:19 +00:00
Jon Jensen c1dedb9304 spec: bump test-queue
dedicate more cores to background loading on the initial run ... sometimes
the workers are so fast they block on it

test plan:
see previous patchset w/ verbose output where `waiting time:` for all
workers was <= 1.3sec

Change-Id: I17188a0f5285ac7e8e3f03a0b954b760008246f6
Reviewed-on: https://gerrit.instructure.com/103115
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-02-23 23:58:12 +00:00
Jon Jensen ff8ffd9a14 spec: refactor error page-y stuff, refs SD-1815
reimplement it using formatters. notable changes:

1. the index page has separate sections for "Initial", "Rerun 1", etc.
2. you now get error pages for before(:all) failures
3. you now get error pages for non-selenium failures
4. you now get links to pages for failures prior to the current one
5. in addition to not capturing screenshots/videos on too-many-failures,
   we now stop making error pages if there are too many, so that we don't
   fill up the workspace on mass badness

test plan:
1. see build in repo-who-shall-not-be-named

Change-Id: I54f065f1515f2b639b3f90b471a19e434a17aece
Reviewed-on: https://gerrit.instructure.com/102002
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-02-16 19:48:56 +00:00
Ryan Shaw 84dc36d3e1 handle timezone data loading out-of-band from webpack
fixes:  CNVS-34796

emitting assets for each of these timezones adds a
non-trivial amount of time to the webpack build.
by making it so webpack doesn’t have to do anything
about them, it goes a lot faster since there is just
a lot less work to do.

this commit also uses npm to get `timezone` instead
of a git checkout

test plan:
in requireJS & webpack,
* load a few pages, make sure your timezone data loads
* automated specs should pass

Change-Id: Ice3b7b6d4c7ac53315d5cb238d4213afb9faddc5
Reviewed-on: https://gerrit.instructure.com/101116
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2017-02-10 23:42:48 +00:00
Ryan Shaw ea55fff788 fix xsslint to work with es6 imports
Change-Id: I97fa2ca9cada24d81a9ced7c8fa7d72997092673
Reviewed-on: https://gerrit.instructure.com/100836
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-02-09 23:50:46 +00:00
Nathan Mills 25154ed4ce nuke node so you can compile assets
Change-Id: Ifec01be0eb6534f7d4325c2761ee5a00d76d0dcc
Reviewed-on: https://gerrit.instructure.com/100510
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2017-02-06 19:53:29 +00:00
Jon Jensen 25d639dba1 spec: bump test-queue
* for specs w/ no description:
  * ensure they all run
  * ensure we can use stats for them
* ensure obsolete stuff falls out of .test_queue_stats

Change-Id: I576228f3adf88e4186d39f0a0bcf84b2b56aba8c
Reviewed-on: https://gerrit.instructure.com/100476
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2017-01-25 22:41:12 +00:00
Jon Jensen 3beaab5647 spec: bring test-queue rerun logic into canvas
Change-Id: I8b1cc0ed0c019eb67ee8d22df8e5f32b4b74cac2
Reviewed-on: https://gerrit.instructure.com/100475
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-25 22:29:41 +00:00
Jon Jensen f9bfcee677 spec: bring test-queue into canvas proper, refs SD-2029
deprecating the test repo, one piece at a time. still using a highly
forked test-queue

test plan:
1. jenkins should be happy

Change-Id: Ie5e5618150703c01e9d279959323e8b87b547552
Reviewed-on: https://gerrit.instructure.com/100344
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-24 18:56:52 +00:00
Landon Wilkins cf4a8f61f8 webpack commit msg linter, fixes SD-1860
test plan:
* should get a webpack comment on patchset 1

Change-Id: I3fcd5d22b2c9d1b1480958e0ea134e4fefaee714
Reviewed-on: https://gerrit.instructure.com/99354
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-01-13 02:26:07 +00:00
Landon Wilkins 5480e02eb2 lint: fix linter for eslint
Change-Id: I187bec5bd794d0e4d2469d1135b8552e10105d55
Reviewed-on: https://gerrit.instructure.com/99257
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2017-01-10 22:00:27 +00:00
Clay Diffrient fec3811d5c Make eslint avoid the campsite cleanup rule
closes CNVS-34242

This makes dr_diff have an option to avoid checking
lines surrounding changes.  It also sets up eslint
to take advantage of this rule.

Test Plan:
  - Automated Tests Pass
  - Eslint only flags errors on changed lines
    (when run through Gerrit/Jenkins/Gergich or
     via script/eslint)
Change-Id: I900430f21c4c925e8fd87bd62e75b271fa84d08e
Reviewed-on: https://gerrit.instructure.com/99048
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-01-10 20:44:24 +00:00
Landon Wilkins 65744119ca dry up linters
test plan:
* see test commit verifying linters still work

Change-Id: I406c218309e824618869c9b5f3841af8387bf836
Reviewed-on: https://gerrit.instructure.com/98329
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
2017-01-10 19:44:48 +00:00
Landon Wilkins 33bd46e368 compile_assets_dev in canvas_update
Change-Id: I7874114b5f24b7c0e3b94602ab9afd0c3d70911f
Reviewed-on: https://gerrit.instructure.com/98466
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2017-01-06 00:13:46 +00:00
Landon Wilkins 75af98699c use gergich in ruby instead of bash
fixes SD-1938

test plan:
* see that gergich still successfully comments on
  linter output on patchset 1

Change-Id: I3beecfab405e57ba0e8705821d6d297fe7423c3e
Reviewed-on: https://gerrit.instructure.com/98317
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-12-22 01:31:29 +00:00
Clay Diffrient aef1574fce [eslint] Get rid of extra build output
Change-Id: Ida3c34427a305b735ca4c3cb22912bc90a509184
Reviewed-on: https://gerrit.instructure.com/98313
Reviewed-by: Derek Bender <djbender@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2016-12-21 22:33:51 +00:00
Landon Wilkins 16733a68a1 lint: whitelist UTF-8 for commit msg linter
Change-Id: If2a230b33ded44de52bc55cb5dd17622a53960fe
Reviewed-on: https://gerrit.instructure.com/97601
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-14 19:11:57 +00:00
Clay Diffrient 21f0c8a233 Remove console logging and fix warning
Test Plan:
  - Gergich works with eslint stuffs

Change-Id: Ib2cb7cee87bb6f1eec21433d579a939ff4ba710e
Reviewed-on: https://gerrit.instructure.com/97584
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2016-12-14 17:47:00 +00:00
Clay Diffrient 4d68ce45b9 Add gergich eslint script
refs CNVS-33837

Test Plan:
  - Run script/eslint
  - It works

Change-Id: I4ab0b5746633a535c85ce79e171a781f07fe9433
Reviewed-on: https://gerrit.instructure.com/97466
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-12-13 22:29:12 +00:00
Ryan Shaw 612637531a fix ie11-polyfill so Promise.all works in IE11
fixes: CNVS-33769

the file we were building with core-js was
not including an array iterator polyfill
so if you were using this polyfill in IE 11
and did `Promise.all([1,2])` it would fail
saying ‘1,2 is not iterable!’

test plan:
in IE11,
load a page in canvas
open the developer tools and type:
Promise.all([1,2]).then(function(o,t){console.log(‘it worked’, o, t)})
it should log:
“it worked 1 2”
and not throw an error

Change-Id: I49a6cd439c151b7703d77a7400856f438937443d
Reviewed-on: https://gerrit.instructure.com/97219
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2016-12-12 21:31:28 +00:00
Bryan Petty c76a9b6a79 add brakeman scanning for ci
refs: ENGSEC-1

Runs Brakeman security scanning on CI, reporting only on relevant
source changes, and only with Medium confidence for now.

Test Plan:
1. Brakeman runs on Jenkins aux builds.
2. Security warnings are only issued for changed files.

Change-Id: I5ce0d4ff47203a5df31ca30cdcb7e9b0cba32b0a
Reviewed-on: https://gerrit.instructure.com/96775
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-07 21:22:08 +00:00
Derek Bender e10520fa5a remove defunct scripts
fixes: CNVS-33321

test plan: N/A

Change-Id: Idf4b89314ffb7779c909b3a0ee009361349046c0
Reviewed-on: https://gerrit.instructure.com/95235
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-11-15 17:49:16 +00:00
Brad Horrocks 3c809153d1 docker-compose.yml v2
If you have a docker-compose.override file you'll want to
move it somewhere else.

mv docker-compose.override.yml docker-compose.`whoami`.yml

Once you've updated your override file to the version 2 syntax, you
should add it to the COMPOSE_FILE environment variable. Probably in a
.env file in the project root.

Test plan:

You'll need to remove your existing canvas containers and volumes to 
fully test this.

to do so run this **BEFORE** you checkout this patchset

```
docker-compose down
docker-compose ps -q | docker rm
docker volume ls -q | grep canvaslms | xargs docker volume rm 
```


then you should be able to get up and running using the following

```
cp docker-compose/config/* config/
dc build
dcr web bundle exec rake db:create db:initial_setup
dc up
```

You should be able to access canvas like normal

Change-Id: Ia7ff76cfdd4f46278fc1cb2a03969fdadaa4a434
Reviewed-on: https://gerrit.instructure.com/91008
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-11-15 17:06:37 +00:00
Chris Hart 6ea6cf4d2e Make Lato the default Canvas font
Fixes: CNVS-30278

The product design team wants to standardize
on Lato across all Instructure products. See
JIRA for more information.

With this change, we no longer have to use
font-weight: 300 etc to make the right
weight of Helvetica show up. We can go back
to simply using bold and normal, etc.; so
those rules have been updated in this
commit.

Test plan:
to accurately test this you need to set up your
canvas to use a CDN. there is a dev CDN that ops
has set up for us. you put the settings in
config/canvas_cdn.yml. slack ryan if you need help
setting that up or need to know what the values
are to use.
you also need to edit your config/environments/development.rb
file so it look like this:

config.action_controller.perform_caching = true
ENV['USE_OPTIMIZED_JS'] = 'true'

and then when you make any changes you need to run:
bundle exec rake canvas:compile_assets
bundle exec rake canvas:cdn:upload_to_s3
touch tmp/restart.txt

for the changes to be seen

- This change applies only to new UI. Legacy
  should be unchanged.

- Clear cache and cookies first.

- Go to Canvas. On the first page load only
  you should see a slight shifting of the text
  as Canvas loads the Lato font and falls
  back on the Helvetica system font.

- From that point on, Lato should be
  cached in the browser and load instantly
  when you move between views:
  http://screencast.com/t/hZhUZOhH

- Canvas should still work in all supported
  languages and browsers.

Not yet converted:
- TinyMCE textarea fiekd
- Mobile login

Change-Id: I861e609c01824f60ac38d3fc15e5b960a06e44de
Reviewed-on: https://gerrit.instructure.com/85737
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Dan Sasaki
Product-Review: Kyle Follett <kfollett@instructure.com>
2016-11-11 22:09:26 +00:00
Jon Jensen fad7b8450d fix xsslint performance, fixes SD-1725
symlink into node_modules makes globby sad, so give it an explicit list
of files and directories

this is the workaround suggested in https://github.com/jenseng/globby-js/issues/2

Change-Id: Ic9fc04b1bedb4e28e38c5eea0a2f1b127e3b5e2f
Reviewed-on: https://gerrit.instructure.com/94371
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-11-04 01:06:00 +00:00
Cody Cutrer bd0792d40b convert tail_kinesis to aws sdk v2
Change-Id: Ia95ea52e094602137b5b591c7635852c70b35372
Reviewed-on: https://gerrit.instructure.com/93023
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Eric Coan <ecoan@instructure.com>
2016-10-26 15:21:14 +00:00
Landon Wilkins 5cf57c5d14 fix stylelint, refs SD-1603
test plan:
* add an invalid hex code to a css file
  ex: app/stylesheets/pages/_rubrics.scss
  color: #YARRRRRRRR
* save the file
* `script/stylelint`
* verify you see an error for this hex code

Change-Id: Iee7a0bbdae032761a7e0f1c91f2d99d469c1cb3d
Reviewed-on: https://gerrit.instructure.com/93575
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-10-25 18:08:23 +00:00
Landon Wilkins 903c9a0a66 stylelint, refs SD-1603
test plan:
* add an invalid hex code to a scss file
  e.g. _variables.scss:
  color: #YARRRRRRRR
* run stylelint with: `script/stylelint`
* verify the colored output only returns your introduced error

Change-Id: Ia4f2adef3635f34154d50d61249b952a380208bf
Reviewed-on: https://gerrit.instructure.com/92229
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-10-25 00:21:16 +00:00
Ryan Shaw 8c0c20696a run gem_npm tasks concurrently
npm installing for some gem should not be affected
by npm installing for another gem. so by doing them concurrently,
we can speed up the build process.

test plan:
* run `npm install`
* it should be faster because the npm modules for 
  canvas_i18nliner and selenimum install at the same time
  instead of one after the other


Change-Id: I73d18db0fd3473e929ac1abff25206a929ab3a45
Reviewed-on: https://gerrit.instructure.com/84599
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2016-10-24 18:20:08 +00:00
Landon Wilkins e2f918a8fd update tatl_tael's user_config location
this portion of rubocop-canvas has been ported to dr_diff

Change-Id: I651b6a012dee93935f23358024dccd8e0df62694
Reviewed-on: https://gerrit.instructure.com/93001
Tested-by: Jenkins
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
2016-10-18 21:27:59 +00:00
Landon Wilkins 8500ac5cb9 incremental linting via dr diff, fixes SD-1521
test plan:
* verify rubocop still comments on canvas-lms errors
-- add "sleep 1" to a controller
-- `./script/rlint`
-- verify you see an error about sleeping
* verify rubocop still comments on plugin errors
-- add "sleep 1" to a plugin
-- run rlint on the plugin
   `./script/rlint --plugin custom_reports`
-- verify you see an error about sleeping

Change-Id: Id0df56c3adfcb6b673a0400e9f714ae22b78242c
Reviewed-on: https://gerrit.instructure.com/90657
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-09-22 20:06:57 +00:00
Ryan Shaw b9229e1abf fix so ie11 polyfill works in webpack land
fixes: CNVS-31887

test plan:
* using both webpack and requireJS:
* in ie11, load a page in canvas
* open the IE developer console
* type: Promise.resolve().then(function(){console.log('it works')})
* it should log 'it works' to the console

Change-Id: Ib76c39a5397ca2f28280ca5c108605c63266b38b
Reviewed-on: https://gerrit.instructure.com/90270
Tested-by: Jenkins
Reviewed-by: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2016-09-22 16:44:40 +00:00
Ryan Shaw 96d4ee9af5 polyfill Promise & a few other methods for ie11
closes: CNVS-31621

every other browser supports these features.
this will just make it so we can count on things
like Promise, Object.assign, [].includes etc  (see
FEATURES_TO_POLYFILL at the top of
script/make-ie11-shim.js for full list)

what do people think of this? what do you think of the
approach, I don't want to include a polyfill in the
common bundle and force every other browser to download
this stuff they aren't going to need. but I still want
it to be performant as possible for those using ie11

Is there anything else people think we should polyfill?
the one I thought of is window.fetch, what do others
think about that?

test plan:
* in ie11, load a page in canvas
* open the IE developer console
* type: Promise.resolve().then(function(){console.log('it works')})
* it should log 'it works' to the console
* (that already works in other browsers, but you can
  check to make sure that it still does there too)

Change-Id: Ie9c99a59631a13535903174a5e575427dbfeac4f
Reviewed-on: https://gerrit.instructure.com/89626
Reviewed-by: Jennifer Stern <jstern@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2016-09-12 19:09:48 +00:00
Ryan Shaw 61fac3281d fix missing quotes in rubocop message
Change-Id: I8940ce1091e8498d4d3e96dc379dada6c88fa8db
Reviewed-on: https://gerrit.instructure.com/89218
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2016-09-07 15:46:49 +00:00
Ryan Shaw cd03c7f8b6 Add helpful gergich suggestion about ERB warning
Change-Id: Id158bac164b3fdb989ed27faef085f4600ccabf6
Reviewed-on: https://gerrit.instructure.com/88425
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-08-22 20:47:31 +00:00
Jon Jensen ef8d56076a avoid duplicate chdir, fixes SD-1442
test plan:
1. lint_commit_message should run and pass on this commit
2. it should lint a plugin commit if you set GERGICH_GIT_PATH and
   GERRIT_REFSPEC and not blow up on linting failures

Change-Id: I7349eb0885038ac11660b95a7e528735048be2bc
Reviewed-on: https://gerrit.instructure.com/88104
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-08-18 15:58:27 +00:00
Ryan Shaw a22aec3be0 update gglobby npm dep
refs: CNVS-29725

test plan:
* run `node script/xsslint.js` 
* it should work
(this is ran by jenkins so reall if it passes, it is good)

Change-Id: Ib9b68e486c32c91e3c430cea095a628daf51db2b
Reviewed-on: https://gerrit.instructure.com/87181
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2016-08-09 20:19:03 +00:00
Landon Wilkins 31e90c0ce6 allow jsx tests for coffee changes, fixes SD-1261
test plan:
* test commit

Change-Id: I9e3da787a56467c886d1e70f107b3abb916c6d1e
Reviewed-on: https://gerrit.instructure.com/82842
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-06-17 17:28:43 +00:00
Cody Cutrer 5f870d7f85 use correct class for delayed jobs CLI
Change-Id: I27faf1de0538f0d8907935ab105a2acc4c56a3df
Reviewed-on: https://gerrit.instructure.com/81897
Tested-by: Jenkins
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-06-08 16:33:41 +00:00
James Williams 0622fb51e9 enhance tatl_tael user experience
Change-Id: I793ce5d14a3da5ff153fc60ad52f2d567bdc2137
Reviewed-on: https://gerrit.instructure.com/81017
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2016-06-01 12:52:29 +00:00
Landon Wilkins 216ab2181f improve tatl_tael for public/javascripts changes, fixes SD-1196
test plan:
* test commit

Change-Id: Iba8695913f05876dc076e2bb7b1e6d0584ad0710
Reviewed-on: https://gerrit.instructure.com/80944
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-05-27 23:36:27 +00:00
Landon Wilkins 9244598c91 make tatl_tael lint on Lint-Review, fixes SD-1176
test plan:
* test commit

Change-Id: I834581ac16c7ccaee07e1c5e02aff74da1ad30c2
Reviewed-on: https://gerrit.instructure.com/80518
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2016-05-24 20:11:14 +00:00
Landon Wilkins c332022162 tatl_tael suggest type of spec, fixes SD-1080
test plan
* test commit

Change-Id: I09e55588027cd609d00e5066c6de04f1c2018a25
Reviewed-on: https://gerrit.instructure.com/79692
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-05-23 20:38:20 +00:00
Landon Wilkins b7f3541edf tatl_tael linter ignore wips, fixes SD-1094
test plan:
* see test commit

Change-Id: I63d6df91bc4636f9cfd91fca6bcb8ec33d2776f1
Reviewed-on: https://gerrit.instructure.com/79020
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-05-13 16:26:20 +00:00
Brad Horrocks f51cefcc67 Better LTI Variable Substitution Docs
Generate LTI Variable Substitution Docs from the code
Uses YARD's plugin hooks to generate the markdown.

I couldn't find a good way to do this with YARDs builtin generation
stuff. So I hacked together. No pretty, but gets the job done.

You can update the generated markdown by running this
```
script/generate_lti_variable_subustition_markdown
```

Our yard templates, dont process markdown files like YARD is supposed
to.i Not sure why? 🤷

Fixes https://github.com/instructure/canvas-lms/issues/592

Change-Id: If0728d357dc745d81381e818ed62d087d76f0e66
Reviewed-on: https://gerrit.instructure.com/74312
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-05-02 19:15:46 +00:00
Landon Wilkins 6e4838856e lint: discourage new .erb files, fixes SD-871
test plan:
* specs
* see test commit

Change-Id: Ia8084890312b674cc30a60077e9b2643d769cd4b
Reviewed-on: https://gerrit.instructure.com/78425
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-05-02 16:16:53 +00:00
Landon Wilkins 9dc6299c38 lint: encourage specs, fixes SD-1024
test plan:
- change a file w/ a path that matches:
/(app|lib|public)\/.*\.(coffee|js|jsx|html|erb|rb)$/
but not:
/(bower|mediaelement|shims|vendor)\//
- ./script/tatl_tael
- verify you see:
  [error] => Your commit does not include specs. Please add some to
             verify your changes.

Change-Id: I725daf72c14180bb29c440f9867244a43dc5169d
Reviewed-on: https://gerrit.instructure.com/77579
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-05-02 16:16:44 +00:00
Cody Cutrer 21561f5180 don't whine about no ticket when it's a github issue
Change-Id: I2b73964c64ece3b98a1809771402c53ea21e7621
Reviewed-on: https://gerrit.instructure.com/75653
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-03-29 20:43:26 +00:00
Jon Jensen b3e0fc8309 tighten up commit message linting
in spite of the only_report_errors list, this should be something everyone
can agree on

test plan:
* spec-only commits and commit messages should be linted whether or not the
  commiter is in the only_report_errors list

Change-Id: I077173db60f9f537d14f66b7acd396823e10a395
Reviewed-on: https://gerrit.instructure.com/65830
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-03-29 19:29:11 +00:00
Brad Horrocks d32b139459 Helper scripts for setting up docker
Change-Id: I9a4916e4e41d7405775cfde79688598be596e9fd
Reviewed-on: https://gerrit.instructure.com/71750
Tested-by: Jenkins
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
QA-Review: Brad Horrocks <bhorrocks@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-02-11 23:17:00 +00:00
Jon Jensen 556a0d13d9 fix commit message linting for plugins
test plan:
1. set GERGICH_GIT_PATH to a valid plugin gem path
2. script/lint_commit_message should lint according to the plugin's HEAD,
   not canvas-lms'

Change-Id: I0976c39ca8278d8241c37ed464b24fcdf7cd9e58
Reviewed-on: https://gerrit.instructure.com/71928
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2016-02-10 19:31:55 +00:00
Cody Cutrer 1b7ce8aacb don't include plugin dir in gergich output sent to jenkins
it's useful locally, but causes mismatches for Jenkins

Change-Id: I2606b1a0d15bafc5f6f9ad90735d4207dcc8bddf
Reviewed-on: https://gerrit.instructure.com/70502
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-01-18 22:08:19 +00:00
Cody Cutrer 29e65e1723 spec: don't choke on non-existent plugin
Change-Id: Id5913bb605daa8fb223d6fd7e268027efc473e8f
Reviewed-on: https://gerrit.instructure.com/70504
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-01-18 22:07:10 +00:00
Cody Cutrer 86ee3aaae2 enable rubocop for plugins
locally, pass `--plugin PLUGIN` to script/rlint

Change-Id: Ib5944c25ef25c2142340e40ceda5ff24948b05c2
Reviewed-on: https://gerrit.instructure.com/70470
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-01-18 18:11:29 +00:00
Cody Cutrer fb8d78584a switch to Syck earlier in the boot process
particularly, before canvas-jobs loads

Change-Id: Ib80215bd971bad2b4ba53aa8ac65301becf4b572
Reviewed-on: https://gerrit.instructure.com/69244
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
2015-12-19 01:40:06 +00:00
Jon Jensen ee57027349 looser test plan check
test-plan:
* put an unnecessary hyphen there ^
* gergich should not complain

Change-Id: Id092e5e9430bd6d7cb95b3f583f3bd1a5b1e82b3
Reviewed-on: https://gerrit.instructure.com/65749
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
2015-10-26 20:42:44 +00:00
James Williams 9fab373292 extend gergich opt-out to lint_commit_message
sorry, not sorry; it's better than cloak'n'daggering

Change-Id: I641167cb402a616601e9c95499bec474947f4c66
Reviewed-on: https://gerrit.instructure.com/65719
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2015-10-23 15:29:19 +00:00
Jon Jensen 5d5af5827d allow # prefix for tickets
the # is not necessary, but now you won't get misleading linter messages
if you do one, e.g. refs #PROJ-123

test plan:
1. the linter should not complain about this commit message

Change-Id: I3eb9e5de093a5b8948c2892bd3ecdec8c3ea4add
Reviewed-on: https://gerrit.instructure.com/65225
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2015-10-15 17:10:24 +00:00
Jon Jensen b57ee36b1f make linter match jira_ref_parser behavior
now you can have a colon between refs and the ticket, e.g.
refs: FAKE-123

test plan:
1. this commit message should pass the linter (even though that's not a
   real ticket)

Change-Id: I32776d59c3ee2d7935c20caba759e0bd0b2596e9
Reviewed-on: https://gerrit.instructure.com/65208
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2015-10-15 14:53:55 +00:00
Jon Jensen 3c022771b0 selinimum: the saga continues
Now with full js/jsx/coffee/hbs/scss goodness \o/

If your commit ONLY touches js/jsx/coffee/hbs/scss/views/controllers or
specific whitelisted things, and doesn't touch global-y bundles or
layouts, then your commit may** be selinimized. That means it will only
run the selenium specs that care about those files.

If you touch lib, or gems, or models, or any global-y stuff, all the specs
will still run.

Also add the ability to override what we selinimize against when testing
changes to selinimum.

**Note that actual selinimization depends on a post-merge build having
succeeded for the parent (or a near ancestor). If the post-merge build
failed, or your build starts before it finishes, or there are
unselinimizable changes between your commit and the nearest ancestor with
selinimum stats, then your commit will not be selinimized :'(

See 4a83f6b6 for the full story.

Test Plan:
* Specs should pass on this commit
* It should not be selinimized because we touch package.json
* See dependent test commits where selinimization happens

Change-Id: I62c78c316876aaff07514a0f460ff4d608dac494
Reviewed-on: https://gerrit.instructure.com/65082
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2015-10-14 18:58:49 +00:00
Jon Jensen 6a3c12b883 add a commit message linter
ruby port of the useful pieces of bridge's bash linter

test plan:
1. run it on this commit
2. it should complain that there is no ticket :P
3. feed it a commit message via stdin, e.g.
   `echo -e "yay\n\na commit"|script/lint_commit_message --stdin`
4. confirm it behaves sensibly

Change-Id: I6bdd6db53e178c4d5d7372aafba47b60c4b9f076
Reviewed-on: https://gerrit.instructure.com/65124
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2015-10-14 18:58:19 +00:00
Ryan Shaw 8a5cb75d66 fix script/canvas_update to work with brandable_css
we no longer use `npm run compile-sass` to do css.

also, css must happen before handlebars.

besides, all the js, css, styleguide and docs stuff
is handled by rake canvas:compile_assets already.
and in a way that whatever can run concurrently, 
will. 
(although, admittedly, the syntax to pass arguments 
to a rake task, e.g.: [0,0,1,0] is pretty lame)

Change-Id: I83c8ceb21b476456f47f3ec37d4ba6088ca68088
Reviewed-on: https://gerrit.instructure.com/57768
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
2015-07-07 20:41:28 +00:00
Ryan Shaw 84a7192a36 A new way of doing css/sass & New Canvas Theme Editor
what this does:
* Changes the way we generate css so we are able to generate custom
  css for people that use the theme editor.
* Sets everything up so we can push all of our static assets
  (js, fonts, css, images, etc) to s3 pre-deploy and serve them
  from cloudfront. Yay! faster canvas for everyone!
* as part of that, this enables the rails asset pipeline just so we
  can use it to put md5s in our urls.  we don't use it for any of the
  coffeescript/sass/sprockets transformer stuff.
* adds a new "Theme editor" functionality (only for people that have
  have the use-new-styles feature flag turned on) where an admin for
  an account can pick their own colors/images for all the users
  at their account/school.
* when the user is done saving things in theme editor, it will,
  in a delayed job, generate all the css with against the variables
  that user specified and push it to s3 so it will be available to
  anyone else that requests it.  (the delayed job will shell
  out to a node.js executable called `brandable_css`).
* ability to pick an existing shared theme and to reset to
  blank theme. closes: CNVS-19685
* gets rid of jammit.

test plan:
(this is exaustive, so not every person has to do every step
but we should make sure at least someone does each of these things.
maybe as part of the review add a comment if you have done one of these
bulletpoints)

* before you check this out, compile all css and copy the
  public/stylsheets_compiled directory somewhere. after you check out
  this code and regenerate all the css. make sure there are no
  significant changes to the css output. (we updated the versions of
  node-sass and autoprefixer that we use so we want to make sure they
  don't change things in a way we weren't expecting)

* make sure the way we load css for handlebars templates still works.
  eg: if there is a handlebars template at
  app/views/jst/some/template.handlebars
  if there is also a scss file at
  app/stylesheets/jst/some/template.scss
  then that stylesheet should get loaded when that template is rendered

* check out the code and run migrations. browse around canvas,
  make sure css and js files load correctly as before.

* cody, jacob, or someone on queso: look at the db migrations and
  make sure everything looks good and that I am handling sharding
  correctly.
* verify that both rake canvas:compile_assets and guard, works as well
  as `node_modules/.bin/brandable_css` (note: if you have
  "node_modules/.bin" in your PATH (which you should), it will also
  work with just `brandable_css`)

* verify that passing the --watch option to
  `.bin/node_modules/brandable_css` works and picks up changes to
  sass files, images, fonts, or any other resource that goes into
  a css file. and that it only recompiles the css files that actually
  depend on that file.

* go to https://github.com/ryankshaw/brandable_css and check out the
  code there. that is what is actually doing the sass compiling

* create a config/canvas_cdn.yml file and add aws access creds and
  an s3 bucket and cdn hostname (for testing, you can use the credentials
  for instructure_uploads_engineering from
  https://gollum.instructure.com/OtherServiceTestAccounts ). for a test
  cdn hostname you can use https://diu0rq5m1weh1.cloudfront.net. that
  is a cloudfront bucket I set up on my personal account that points to
  instructure_uploads_engineering

* run rake canvas:compile_assets again, this time, at the end, you
  should see it run the assets:precompile task that puts md5s in filenames
  and, gzipps them, and copys them to public/assets.
  then you should see it run canvas:cdn:upload_to_s3
  (look at log/development.log for progress),
  which pushes everything to s3.
  closes: CNVS-17333 CNVS-17430 CNVS-17337

* try out the theme editor: turn on new styles, go to accounts/x
  (where x is the @domain root acount you are testing from) and click
  the "theme editor" button on the right side of the page.
  that should take you to a page that has the ability to pick colors/images
  on the left side and preview your changes in an iframe on the right
  closes: CNVS-19360 CNVS-20551

* test the "preview", "save", "reset", and "choose existing" functionality
  closes: CNVS-17339 CNVS-17338 CNVS-19685

* make sure that the themeeditor works both if you have
  config/canvas_cdn.yml set up and enabled as well as if you don't.
  if it is enabled, you should see it push the css for just that new
  brand config to s3 when you hit preview, and the css
  should be accessible from the cdn you configured.

Change-Id: Ie0a812d04f5eeb40e7df7e71941ff63ea51a4d22
Reviewed-on: https://gerrit.instructure.com/53873
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2015-07-02 22:42:18 +00:00
Ryan Taylor 42bbe4c7f3 Remove migration_lint
Change-Id: Icccf89cb2aec1961d6f4967bad9f25068c0d5126
Reviewed-on: https://gerrit.instructure.com/53297
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
2015-05-04 15:28:34 +00:00
Cody Cutrer a623afaa38 gergich tweaks
* pass additional arguments to script/rlint --heavy -- --additional-args
 * disable a rails cop
 * lower style cop to info severity

Change-Id: I5cbc94bfc503ae48c635ccb77f66b60f564e1b08
Reviewed-on: https://gerrit.instructure.com/52867
Tested-by: Jenkins
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2015-04-27 18:18:34 +00:00
Ethan Vizitei 7a07985ba1 Don't let rlint bail on files that don't exist anymore
also start moving the more complicated logic
from the rlint script into tested helper
classes

Change-Id: I5c3916b0c7e695389b552dc1a6b4353aaaeba290
Reviewed-on: https://gerrit.instructure.com/52743
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-23 19:08:19 +00:00
Ethan Vizitei 937244a8e9 skip comment building on diff if no ruby changes
Change-Id: Idcf6a213ea05f016d646829561aed3dd8baef95e
Reviewed-on: https://gerrit.instructure.com/52309
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
2015-04-15 21:20:51 +00:00
Ethan Vizitei 6c77127375 don't rubocop everything if there are no ruby changes
Change-Id: I5807e19353cce8374796f4ff97814821bf95b248
Reviewed-on: https://gerrit.instructure.com/52271
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
2015-04-15 20:39:21 +00:00
Ethan Vizitei e9e659d990 add boyscout mode for rlint
also back off the hash syntax rule

Change-Id: Ib5daec82b013cb5ca3abeec7705f3838cc438d06
Reviewed-on: https://gerrit.instructure.com/52023
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
2015-04-11 15:13:26 +00:00
Ethan Vizitei 1329e71c53 colorize rlint output
Change-Id: I357a15e38c454991efd556491cd8f047a07f701a
Reviewed-on: https://gerrit.instructure.com/52008
Reviewed-by: Braden Anderson <braden@instructure.com>
Product-Review: Braden Anderson <braden@instructure.com>
QA-Review: Braden Anderson <braden@instructure.com>
Tested-by: Jenkins
2015-04-10 20:13:36 +00:00
Ethan Vizitei 13f8256e92 add heavy mode and INFO on only touched lines
lets rlint only run with local changeset unless you specify "--heavy"

Also checks for whether you actually touched a line
or not before deciding an INFO comment is relevant

Change-Id: I4a960c72644dfc46aca7a51d04321711cef0850c
Reviewed-on: https://gerrit.instructure.com/51992
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Tested-by: Ethan Vizitei <evizitei@instructure.com>
2015-04-10 16:59:07 +00:00
Ethan Vizitei f8e4b93f37 make script/rlint faster
on jenkins this was taking up to 9 minutes.

By removing the file I/O and batching
the georgich commits, this ran locally on my
sentry patch set in 15 seconds.

Change-Id: I23b0df9b9396829de4b8ff084f4f92df6e698da2
Reviewed-on: https://gerrit.instructure.com/51987
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-10 16:53:19 +00:00
Ethan Vizitei 4a42cbbeda Update script/rlint to work on jenkins
Needed some better use of environment variables
to get the right SHA.  also shouldn't care about
dirty working directory on jenkins.

Change-Id: I85d4b9468f629217adcdd25039e44f26fd20b1d5
Reviewed-on: https://gerrit.instructure.com/51907
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-09 17:40:41 +00:00
Ethan Vizitei 19a71c6b64 add some ruby linting for jenkins to take advantage of
add migration lint as rubocop cops

create frozen constant linter

find_ids datafixup lint

send_later lint

lint send_later in predeploys

add freeze_constant cop to default config

don't forget to include rubocop when running

get the rubocop runner into the script

lint for wrong algorithm name

lint primary key

lint remove_column in predeploys

get rubocop output as parsed json

diff munging for gergich

disable a few style cops

tweak rubocop setup to allow IDE plugins to work

get gergich comment format right

shell out to gergich if we're in jenkins-land

Change-Id: I6eecc8d8ede17a755c9d9a86121c3658776de9cd
Reviewed-on: https://gerrit.instructure.com/51755
Tested-by: Jenkins
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
2015-04-09 14:37:37 +00:00
Zach Wily 5d232f03af initial live events implementation
This commit adds a new module called LiveEvents that knows how to send a
certain set of events to Kinesis. The module is configured via
normal plugin settings per account. Once the plugin is configured with
a Kinesis stream, events will start getting sent to that stream.

Events are sent asynchronously, in a background thread.

test plan:
 * See `doc/live_events.md` for instructions on how to setup a local
   kinesis stream and configure the LiveEvents plugin.
 * Start tailing the stream with the command specified in
   `doc/live_events.md` in a terminal.
 * Perform the actions described in `doc/api/live_events.md` and verify
   that events show up in your Kinesis terminal with the correct data.

Change-Id: Id799688c972205a1eee84a673912f84b0c7abb57
Reviewed-on: https://gerrit.instructure.com/50324
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Product-Review: Zach Wily <zach@instructure.com>
2015-04-03 15:22:33 +00:00
Benjamin Porter b8b8b65097 canvas_update script: fix bug with missing gems/plugins and/or
vendor/plugins

When either gems/plugins or vendor/plugins doesn't exist in the repo,
the script would print an error as it tried to list the directory
contents through globbing.  This fixes that error.

Fixes CNVS-19519

Test Plan:
    - Create a new checkout with no vendor/plugins directory, or delete
      the existing one (not recommended)
    - Run the script and ensure it does not report an error with
      a missing vendor/plugins/*
    - Ensure the script completes without error

Change-Id: I4d49fc090d4abc21ac8e8005f4ed83c47b4e89c5
Reviewed-on: https://gerrit.instructure.com/50961
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins
QA-Review: Benjamin Porter <bporter@instructure.com>
2015-03-25 19:26:50 +00:00
Cody Cutrer 6aa62cfce6 update bigeasy/timezone to 0.0.40
updated with a new script - `script/update_timezone_js.sh v0.0.40`

Change-Id: Iac76910d97ed639798804a3024f7c10fe0821d9d
Reviewed-on: https://gerrit.instructure.com/50062
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2015-03-23 19:30:48 +00:00
Addison Higham 099bafa228 Make changes for node 12/iojs.
This makes a number of changes to get the compilation compatible with
node 12 and iojs.

- removes loom (no longer used)
- updates karma dependencies to more recent versions
- minor css change to make sass compilation work with node-sass
  (lib-sass)

test plan:
- should be able to compile assets with node 12 and iojs
- JS specs still pass

Change-Id: Id4a0628ff0c6dd09e622d02329a4400d60459ec2
Reviewed-on: https://gerrit.instructure.com/49493
Tested-by: Jenkins
Reviewed-by: Nick Houle <nhoule@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2015-03-05 22:43:38 +00:00
Dave Donahue 4468b0c085 add gems/plugins to canvas_update script
Change-Id: I8b356ff481993a88a6ec02116a8f1adcc0fb203d
Reviewed-on: https://gerrit.instructure.com/48111
Reviewed-by: Benjamin Porter <bporter@instructure.com>
Tested-by: Jenkins
Product-Review: Dave Donahue <ddonahue@instructure.com>
QA-Review: Dave Donahue <ddonahue@instructure.com>
2015-02-03 05:44:35 +00:00
Benjamin Porter da3296e385 canvas_update script: add double quotes and $() where apropo
bash best practice is to use double quotes to prevent globbing and word
splitting.  This probably doesn't matter in the context we are using,
but it pollutes the output of the linter so might as well just fix it.

Also switch `` to $().  Backticks are deprecated

Fixes CNVS-18183

Change-Id: I03cef6a7b3e1740bfb46c422e89788cd5d1eb7e0
Reviewed-on: https://gerrit.instructure.com/47726
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Benjamin Porter <bporter@instructure.com>
2015-01-29 16:24:41 +00:00
Ryan Shaw 15063dd11b A way for devs to set their own brand style vars
closes: CNVS-17331 CNVS-14993
refs: CNVS-17332

This is the first step to having a full theme editor where
accounts can pick their own color scheme in a UI and all of 
canvas will be branded to their school colors.

test plan:

* copy config/brand_variables.scss.example to config/brand_variables.scss
* recompile sass
* users in accounts that have "new styles" or "k12" turned on that have
  not turned on "high contrast". should see a new purple-orange canvas.
* but users that have turned on the "high_contrast" feature or accounts
  that have not turned  on either "k12" or "new styles" should not.

Change-Id: I16342d43b56e49d52fbee8fa5c6a0fd57ae6e602
Reviewed-on: https://gerrit.instructure.com/46085
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
2015-01-06 21:48:35 +00:00
Jon Jensen 7420e67f71 return non-zero exit code on xss linting failure, refs CNVS-17663
this will allow us to enforce linting in the build

also ignore plugins' vendored javascript

Change-Id: Ibf6e9b73e0051a0b581ee52b641f9ff00dd6b2f2
Reviewed-on: https://gerrit.instructure.com/46351
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2014-12-29 20:48:00 +00:00
Jon Jensen 70cdc92bdb XSS linting, fixes CNVS-17663
no significant issues/vulnerabilities fixed in this commit, rather this is
a catch-all so we can enforce linting in the build.

to better understand what's going on here, see the following:

* public/javascripts/.xssignore
* script/xsslint.js
* https://github.com/jenseng/xsslint

high level summary of what's going on in this commit:

1. .html/.append/etc. now know what to do with a SafeString ... in many
   cases we now put a $.raw around an .html argument to tell the linter
   it's ok
2. although translation is an unlikely attack vector, we now htmlEscape
   I18n.t calls used in html snippets, etc. this is a good thing, as it
   ensures we don't create a vulnerability later (e.g. by interpolating
   user content into a translation)
3. many vars were renamed (Html suffix, $ prefix) to let the linter know
   it's something that was manually vetted
4. in some cases, rather than renaming or creating a superfluous var,
   we add special xsslint comment overrides

test plan:
specs should all pass

Change-Id: Ide1df825b798d1b0c468a5308802543bf716c0d7
Reviewed-on: https://gerrit.instructure.com/46097
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-12-29 17:45:43 +00:00
Jon Jensen 8192132c3e i18nliner-js (part I)
this swaps out our "parsing" with i18nliner-js

also remove localization abilities of I18n.beforeLabel, since it's not
worth the trouble to support. it can still be called to format a string.

notable changes/fixes in generated yml:
1. client_apps are picked up by i18n:rake so they'll get translated...
   due to the old short-circuiting logic (`rc = rc && ...`), it would
   stop processing scripts within a particular file after the first one
   it found without an I18n.t
2. we no longer incorrectly double-escape special chars in our js strings
   (e.g. newlines are actually newlines, not a literal "\n")

test plan:
1. verify string extraction:
   1. `rake js:generate i18n:generate` before and after this commit
   2. confirm `config/locales/generated/en.yml` is identical, except the
      notable changes/fixes listed above
2. verify js translation file generation:
   1. `rake i18n:generate_js` before and after this commit
   2. confirm the files in public/javascripts/translations are identical
3. verify client_app checker still works:
   1. `cd client_apps/canvas_quiz_statistics/`
   2. `grunt check_i18n`

Change-Id: Ic8ad058bee1c9476f42916f10b612c1c08863fe3
Reviewed-on: https://gerrit.instructure.com/42809
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-10-30 06:25:36 +00:00
Brian Palmer f6900880bf extract delayed_job plugin into separate gem
closes CNVS-15881

This mostly involved adding hooks to the gem for things that we were
directly modifying in Canvas, then hooking into those points in the
canvas config/initializers/delayed_job.rb file.

Periodic jobs scheduling changed a bit as well -- there's no longer
support in the extracted gem for reading a special file under config/,
so I moved our periodic_jobs.rb file to a normal initializer.

test plan: delayed jobs should still work as before, including queuing
jobs, running the worker pool, and in tests.

Change-Id: I9ce57091d18f21f4355011fcb75230193d53facb
Reviewed-on: https://gerrit.instructure.com/42027
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-10-24 20:46:00 +00:00
Rob Orton f8950fc472 remove rails 2 scripts that no longer work
Change-Id: I6d93611421613d09aee01195d84625db67cb914d
Reviewed-on: https://gerrit.instructure.com/41776
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2014-09-26 16:09:30 +00:00
Cody Cutrer 65a620ed8e script/console is a rails 2 vestigial
and my fingers still want to type it. at least this will remove
it from my tab-complete

Change-Id: Id826cff0612c27bb54dc2c74925193b8f33a66cf
Reviewed-on: https://gerrit.instructure.com/41607
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-23 16:37:40 +00:00
Brian Palmer 5a9cae7d0f rails4: gemify delayed_job
closes CNVS-14275

While we're at it, fix all the rspec deprecation warnings.

test plan: delayed jobs should still work as before, including queuing,
viewing in the UI, and running.

Change-Id: I36c6b74aa2b59a99e4f1f36e25e6d0e9e153f92a
Reviewed-on: https://gerrit.instructure.com/41211
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-09-17 18:14:54 +00:00
Brian Palmer 7b2523fca1 fix double requiring of application.rb
This happens when script/rails is executed via a symlinked canvas
directory

Change-Id: I64fc408244ead13c3c78580c3b3e72102445df34
Reviewed-on: https://gerrit.instructure.com/40740
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-09 00:42:50 +00:00
Dave Donahue 25923e4ef9 fix canvas_update script sass compilation
We compile sass using npm run compile-sass now, but the
script was still referencing the old (now deprecated) rake
task, which was causing updates to fail.

Change-Id: Idbedcf61ccccbdb0f1deb5907afb25d5d6650000
Reviewed-on: https://gerrit.instructure.com/40392
Reviewed-by: Nick Houle <nhoule@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Dave Donahue <ddonahue@instructure.com>
QA-Review: Dave Donahue <ddonahue@instructure.com>
2014-09-02 19:54:03 +00:00
Ryan Shaw 1f292bf5db make sure compile-sass exists with non-zero exit code on fail
...and print a message of what went wrong

test plan:

write some bad syntax in a sass file,
run `npm run compile-sass`
it should exit with non-zero status code
it should tell you what line of css caused the error

Change-Id: I0febb3286f6100993d5d2d53083d6a53719cbedf
Reviewed-on: https://gerrit.instructure.com/39385
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Colleen Palmer <colleen@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2014-08-15 18:27:40 +00:00
James Williams 81558f728c remove rails 2 support
closes #CNVS-14261

Change-Id: I1b0e8a4438ab659ecd1ac8462bc3559d810989b3
Reviewed-on: https://gerrit.instructure.com/38744
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-08-06 18:16:19 +00:00
Ryan Shaw 485b90a6f7 replace compass with node-sass
after many steps towards this moment, we're finally here

This yanks sass and compass out of canvas-lms
completely and instead uses the libsass based
node-sass to compile our SASS files.

wins:

It is WAYYY faster!
as in, < 10 seconds to recompile all css in canvas
(compared to the 5+ minutes it used to take)

It is all in JS, helping use move to a completely
nodeJS based fronted tooling workflow.

next steps:

remove jammit: we don't need an assets.yml file
since node-sass can output compressed css for us
and we use sass to do all of our @import'ing of other
files (@colleen calls those "compiler" sheets), this
would simplify and speed up fronted asset building
even more

use gulp/broccoli/whatev to do cached, incremental builds

test plan:

all outputted css should look exactly the
same as it used to.

run `npm run compile-sass`, make sure it works
and is way faster than `rake css:generate` used to be

Change-Id: I7d865ea6b3e374cdc27a883d2019a4c15746c0e2
Reviewed-on: https://gerrit.instructure.com/38416
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2014-08-04 15:28:29 +00:00
Cody Cutrer 1a11457385 loosen up migration_lint for rails 3
allow rails 3 migrations

Change-Id: Id0bd7a0c5dcd7e2f228dbd8fda8a0bb17541c270
Reviewed-on: https://gerrit.instructure.com/38493
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-07-31 15:40:53 +00:00
Landon Wilkins cf0b220497 canvas update script
test plan:
* run `script/canvas_update`
* verify that the log output goes in /log
* verify that canvas was updated
* run `script/canvas_update -q` for QUICK_MODE
* verify QUICK_MODE's output is:

Quick mode enabled (assumes you have guard running and don't want to
generate docs)
Bringing Canvas up to date ...
  Log file is /Users/lwilkins/sandbox/canvas-lms/log/canvas_update.log
Updating plugin vendor/plugins/canvasnet_registration ...
Updating plugin vendor/plugins/instructure_misc_plugin ...
Updating plugin vendor/plugins/multiple_root_accounts ...
Pulling Canvas code ...
Checking your gems (bundle check) ...
Gems are up to date, no need to bundle install ...
Migrating DB ...
Installing npm packages ...
Tips:
  - 'bundle exec guard': auto-compiles JS files while developing
  - 'script/delayed_job run': run delayed jobs in the foreground

NOTE 1) if you see
  Gems are up to date, no need to bundle install ...
  then `bundle install` will not be run

NOTE 2) after running this command, you'll be on master branch,
  if you want to continue testing this script, checkout the
  branch you pulled down again.

Change-Id: I99c3097d452128d6fffa31d25e3b7e57a438555e
Reviewed-on: https://gerrit.instructure.com/37423
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <braden@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2014-07-11 14:21:03 +00:00
Brian Palmer ce945a721b migration lint for instance vs class migration methods
self.up works in rails2 and rails3, but up only works in rails3+

also tag the switchman migrations as RAILS3 only, now that they actually
run in rails2

Change-Id: I768c8e657e86de6504a40444d127e2d875ce6934
Reviewed-on: https://gerrit.instructure.com/35390
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-06-05 15:55:55 +00:00
Raphael Weiner 5553f62357 extract incoming mail into gem
fixes CNVS-12182

test plan
- regression test on incoming mail
- use script/process_incoming_emails to manually trigger the processing
  of incoming mail

Change-Id: Iccd74d8fe2b5af3d5eefe25a2736273e3bf559b0
Reviewed-on: https://gerrit.instructure.com/32794
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:06:02 +00:00
Joseph Rodriguez 8554d5c894 moving mail processor to module
fixes CNVS-12174

Test Plan:
Regression test on incoming mail.

Change-Id: I3f5d131ce4a1f4408bf95a5455ffc4baa6bdc85c
Reviewed-on: https://gerrit.instructure.com/32716
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:05:39 +00:00
Joseph Rodriguez 45bb1107c2 inject instance of ErrorReport::Reporter into IncomingMessageProcessor
fixes CNVS-12150

QA Test Plan:
- regression test incoming mail (check error reports)

Change-Id: Ib25cf1ad78cb76db3da5d97cf6e33740e50d472d
Reviewed-on: https://gerrit.instructure.com/32679
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:05:13 +00:00
Joseph Rodriguez a8c90d61df Extract and inject incoming message handler
fixes CNVS-12145

QA Test Plan:
- regression test incoming mail
- ensure that reply to discussion topic works

Change-Id: Iae88aa6da5cfe79e51609e233c05e356feacc198
Reviewed-on: https://gerrit.instructure.com/32610
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:42 +00:00
Joseph Rodriguez d88a31330f convert class methods to instance methods for IncomingMessageProcessor
fixes CNVS-12129

test plan
- regression on incoming mail

Change-Id: Ia9ab3419201c9fdbd89e2483a3fde51f54c7f982
Reviewed-on: https://gerrit.instructure.com/32594
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:27 +00:00
Ryan Shaw 0b4e9fe5d8 make rake canvas:compile_assets a TON faster
...by parallelizing everything I could

fixes: CNVS-12362

`time bundle exec rake canvas:compile_assets`
(on my I7 2.3GHz macbook pro)
before: "322.56s user 26.62s system 173% cpu 3:21.05 total"
after: "425.91s user 30.71s system 413% cpu 1:50.35 total"

If you ever find yourself needing to run everything all
sequentially (and not in multiple threads), you can
set the environment variable CANVAS_BUILD_CONCURRENCY=1
by default it will use all the cores your system has

You're welcome, anyone that has ever had to build canvas
or wait for jenkins to run :)

Test Plan:
* run "time bundle exec rake canvas:compile_assets"
* checkout this code
* run it again
* verify that it is faster, and everything works

Change-Id: Ib01506bc9638e86f4a329284458706279ef751ab
Reviewed-on: https://gerrit.instructure.com/33127
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-04-17 19:47:17 +00:00
Aaron Shafovaloff 20f692c884 upgraded requirejs to 2.1.10
- upgraded raphaël to 2.1.2
- upgraded FileAPI to 2.0.4
- amd-ified files
- removed unnecessary shims
- removed "use!" usage
- removed "order" requirejs plugin
- using new shim configuration format
- replace deprecated require.resourcesDone with !window.requirejs.s.contexts._.defQueue.length
- using UglifyJS separate from r.js
- added keep_trying_until in selenium specs to fix timing issue
- fix race condition in take_quiz.js with .file-upload-question-holder

Change-Id: I8c205ef4c80115fa0cbd662c184490f1b9626336
Reviewed-on: https://gerrit.instructure.com/29683
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Tested-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
2014-03-10 22:27:53 +00:00
Shawn Meredith 26464cde51 spec: rspec 2.13 parallelized_specs compatibility
Change-Id: I3600a84a6b7bde5bc6b25bfcd8ff448dfed4463f
Reviewed-on: https://gerrit.instructure.com/28736
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
2014-01-16 23:08:30 +00:00
Cody Cutrer 2c8fb04e0a remove backcompat for custom migration extensions
Change-Id: Ia8f225574c0359fc0be13a7f667572d4baef9600
Reviewed-on: https://gerrit.instructure.com/25801
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-31 18:24:12 +00:00
Cody Cutrer b7b5042b2c rename transaction attribute to disable_ddl_migration!
for Rails 4 compatibility

Change-Id: I7dd48ef8cce10e9e15536eebf3e4ab5aee365a40
Reviewed-on: https://gerrit.instructure.com/25686
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-29 20:33:53 +00:00
Jacob Fugal b12791aa99 to_json unnecessary (and wrongish) in render :json
refs CNVS-7597

render :json => thing will call ActiveSupport::JSON.encode(thing) unless
thing is a String. ActiveSupport::JSON.encode(thing) just calls
thing.to_json but with some circular reference checking that we want. we
may also want enhance ActiveSupport::JSON.encode to do additional
processing, and calling to_json straight up would bypass that.

in the cases where we do need to do the structural transformation before
passing to render :json (e.g. because of need to pass arguments), use
as_json to do structural transformation only, vs. to_json that does
serialization of the as_json result.

adds a rake task to lint the controllers to enforce as_json over to_json
in render json calls.

test-plan: heavy regression testing; no end behavior should change
(except a pair of serialization bugs that got fixed)

Change-Id: I7a91a9fe0eca70456bc5bca233f0ed6b27a54aaf
Reviewed-on: https://gerrit.instructure.com/23650
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-02 18:05:22 +00:00
Cody Cutrer 2deb504378 useful find_each
* automatically does with_exclusive_scope
 * if the scope has an order or group by, use an alternate
   implementation so it's not broken
 * alternate methods are cursors (postresql only) or temporary
   tables. if a transaction is already open, or we're on a slave,
   prefer a cursor (even over the normal method, since the query
   might be slow even without an order or group by)

test plan:
 * migrations should still work (especially data fixups)
 * lots of account reports use find_each; make sure they still run

Change-Id: If876b7b3401e6cda1d41f1c94b93af4810b78cf4
Reviewed-on: https://gerrit.instructure.com/22364
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-07-18 22:26:46 +00:00
Stanley Stuart 42888839b1 remove unused cucumber script runner
Change-Id: I391010689a6488c49a75eaef586783793fc29613
Reviewed-on: https://gerrit.instructure.com/20889
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-05-23 22:44:42 +00:00
Cody Cutrer 9d9a110f07 make discussion_topic_materialized_view.discussion_topic_id a true primary key
also added a warning to migration_lint about tables with no primary keys

test plan:
 * run the migration; it should not fail

Change-Id: I67a065355bb516b84b00313725f079842bbd8974
Reviewed-on: https://gerrit.instructure.com/20705
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-05-21 16:58:52 +00:00
Brian Palmer 31f33164b5 remove 1.8 compatibility shims
- update the Gemfile to be 1.9 only, and raise an exception on wrong
  ruby version
- remove RUBY_VERSION checks, replacing with the applicable code
- remove the FasterCSV compatibility shim, just use CSV now

test plan: trying to bundle install on ruby 1.8 or 2.0 should raise an
exception, specs should pass, canvas should work as normal on 1.9

Change-Id: I49088e9d227c59c6d5d5acb417c2df971129474a
Reviewed-on: https://gerrit.instructure.com/19806
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-03 01:43:52 +00:00
Jon Willesen d8efd3e805 improve robustness of incoming message processor
replaced the mailman gem with custom code with more error
handling. this will allow the incoming message processor to
continue processing messages after encountering a message with
an encoding or parsing error. the broken messages will be moved
aside to a separate folder for later inspection.

fixes CNVS-4970

test plan:
 - read up on the new incoming_mail.yml configuration settings.
 - configure incoming_mail.yml with the test imap accounts
   using legacy settings and check for regressions.
 - reconfigure incoming_mail.yml to read from a directory.
 - copy some testing email files into the configured directory.
   test files should be a mix of:
   - emails with encoding errors
   - emails with syntax errors
   - normal emails
 - all of the normal emails should be processed normally
 - all of the error emails should be moved into the error
   subdirectory

Change-Id: I0f946a56b41492f007db2775aa6da3cdfa4fdd3f
Reviewed-on: https://gerrit.instructure.com/19729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-29 14:47:09 +00:00
Cody Cutrer 8e9599757e migration_lint!
Change-Id: I0c0e12e0aa6401e15cf52915f1fdebe82686a0bf
Reviewed-on: https://gerrit.instructure.com/19837
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-04-22 15:22:32 +00:00
Brian Palmer cb5e957965 start adding rails 3.0 support
This can successfully load rails console and rails server. There are
many, many problems still. The idea is this won't change anything under
rails 2.3, it's all backwards compatible.

closes CNVS-4711

test plan: `touch RAILS3` in your Canvas Rails.root directory. The run
`bundle update` and verify that you get rails 3 installed. Run `bundle
exec rails c` to load console or `bundle exec rails s` to start a
webrick server. You can login, though the dashboard currently breaks.
Also jammit isn't working yet.

But more importantly, Rails 2.3 should still work same as ever. All
tests should pass, and a basic regression sanity check would be good too.

Change-Id: Idd6f35de88adde84cd2db3a650f44b71bd6e9684
Reviewed-on: https://gerrit.instructure.com/18453
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-22 19:08:40 +00:00
James Williams 5f470c69ac add File.expand_path for ruby version compatibility
code fix, no test plan

Change-Id: Iff01e6523fb7d77a84d8e9829c5efbb2a5306a51
Reviewed-on: https://gerrit.instructure.com/18622
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-18 12:25:14 -06:00
Brian Palmer 77ca8ac013 remove deprecated rails constant usage
basically convert RAILS_ROOT -> Rails.root , RAILS_ENV -> Rails.env ,
RAILS_DEFAULT_LOGGER -> Rails.logger

This is necessary for rails 3

Change-Id: I138e1aa217fa8fb186d23ac09b04031c1e2b665e
Reviewed-on: https://gerrit.instructure.com/18412
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2013-03-11 12:14:08 -06:00
Duane Johnson bbe8b17b67 adds user search API to courses
Test Plan:
- Use the API to query courses/<id>/search_users
- You should be able to specify a search_term in the query that
  narrows the results to matching users in the course
- You should be able to specify an enrollment_type of 'student'
  or 'ta' etc. to narrow the results further. Multiple 'enrollment_
  type's can be specified as a comma-separated list.
- You can limit the number of results with 'limit'

fixes #CNVS-2324

Change-Id: Ic87ff797028f71b478de6397557b142d7d0fe6b5
Reviewed-on: https://gerrit.instructure.com/16640
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2013-01-25 09:42:30 -07:00
Cody Cutrer 18385db63c remove script/spec_server closes gh-246
rspec-rails no longer includes it. use spork instead

Change-Id: Ibdd318970e45f5073ed8e498c9bbb184a8ebf7cc
Reviewed-on: https://gerrit.instructure.com/15652
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2012-11-28 13:22:15 -07:00
Brian Palmer 8ad464eecb improve guard/dj in script/server
Try harder to kill the processes when script/server exits

Change-Id: Ib401bd23cd51135122a7611f5ffad9daca086160
Reviewed-on: https://gerrit.instructure.com/11947
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-06-28 18:05:08 -06:00
Jake Sorce 90318ab33a using custom parallelized specs gem for rspec tests
Change-Id: Ia7d9ca7fd19267e9a3a66611b50d64bfc7bf3445
Reviewed-on: https://gerrit.instructure.com/10115
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-04-23 13:33:29 -06:00
Brian Palmer 3b5cdfa82a script/server improvements
don't let guard break ruby-debug

add BARE_SERVER shortcut

don't duplicate the tailing of delayed job output -- the server is
already tailing log/development.log, so tell the job daemon not to tail
it too

Change-Id: I23f8b9b413e99f515804819292b3ae15a598290d
Reviewed-on: https://gerrit.instructure.com/9796
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-04-03 10:06:04 -06:00
Brian Palmer 3c68044ef8 run delayed jobs and guard with script/server in dev
test plan: start up script/server in development mode, and verify that
jobs are running and guard catches changes to files. you should also be
able to hit enter to make guard re-compile all.

Change-Id: I064588e58d09dd770110d046b86337a0e988017a
Reviewed-on: https://gerrit.instructure.com/9593
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-03-28 16:11:49 -06:00
Bryan Madsen 990e4906a1 use parallel_tests-instructure and remove custom loggers
Change-Id: Id71849f40ae94fa073d235e178a5497284a8e3ed
Reviewed-on: https://gerrit.instructure.com/8362
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-30 11:14:50 -07:00
Bryan Madsen 20535f8fd1 create a text log of failed parallel tests
Change-Id: Ia1681235bb8a9f7c9f88da9b67c0b739b480e285
Reviewed-on: https://gerrit.instructure.com/5929
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-10-03 14:23:53 -06:00
Brian Palmer 7c29dab51b chmod +x script/ssl_server
Change-Id: Ia7008629dfb7c38cd9efae97d546b0515645ef7e
Reviewed-on: https://gerrit.instructure.com/5953
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
2011-10-03 08:21:16 -06:00
Bryan Madsen d259963460 enable parallelization of selenium tests
Change-Id: I2cbe3f19df3df1442a45479337607bb829b54188
Reviewed-on: https://gerrit.instructure.com/5739
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-09-26 15:45:35 -06:00
Ryan Shaw 2a94eb2937 add a script/ssl_server for https debugging
Change-Id: I767c818c19e7f5ac522d4b81c83744d1dfff0315
Reviewed-on: https://gerrit.instructure.com/3574
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-31 09:44:35 -06:00
Brian Palmer 26032f2046 new jobs admin area
and some work on delayed_jobs refactoring

refs #4226

Change-Id: I21a91a44368e77aef4a75e0d30cefe252a901691
Reviewed-on: https://gerrit.instructure.com/3640
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-19 10:49:37 -06:00
Cody Cutrer 63bad32df0 Handle incoming mails. Closes #4016.
* Uses Mailman gem
 * Can be configured for POP3, Maildir, or stdin (push from mailserver)
 * Maildir can be chained with fetchmail or similar to support IMAP
 * Can be run as part of the job server, or as a separate process

Change-Id: I000000000000000000000000000001
Reviewed-on: https://gerrit.instructure.com/2971
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-04-07 10:46:11 -06:00
JT Olds 046cfe54c1 oh whoops, bash might not always be the default shell
Change-Id: I3ba13544e0238579fb374a6a0886fd978689433c
Reviewed-on: https://gerrit.instructure.com/2270
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-02-11 12:33:24 -07:00
JT Olds 903bcdd371 move gem_home configuration for delayed_jobs to config folder
right now, the documentation tells people to change script/canvas_init, which
kinda sucks for people hoping to upgrade by doing git pull.

this seems sort of hacky - i'm open to suggestions.

Change-Id: I66bf3deb2f51c22c23c1963369c6ab3e5f391d33
Reviewed-on: https://gerrit.instructure.com/2145
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-02-03 13:38:32 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00