Commit Graph

4 Commits

Author SHA1 Message Date
Cody Cutrer c65d57737a RuboCop: Layout lib
Change-Id: I0655d9a9d750f2debd6378b03d8ddc1403ebc31b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274158
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 20:01:52 +00:00
Cody Cutrer d0863395ea optimize several things about brand config regeneration
refs FOO-1166

 * don't randomly sample from an array that's likely already usefully
   ordered
 * re-write sub_account recursive stuff so that a relation can be used,
   and then use that relation to preload brand_configs, and to select
   only necessary columns
 * fix a bunch of callbacks so that you can actually save a slim
   account object
 * pass in an account/sharedbrandconfig object when we have one already,
   instead of force reloading

Change-Id: Ia14b539617f338be507e7773da7ef9bc3907ec4c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257443
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-02-17 23:18:35 +00:00
Cody Cutrer 06763dd519 add # frozen_string_literal: true for lib
Change-Id: I59b751cac52367a89e03f572477f0cf1d607b405
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:49:50 +00:00
Augusto Callejas 412e49baee Outcome import creation/status endpoints
closes OUT-1534

Scheduling of outcome import jobs will occur in a separate PS,
after this merges and OUT-1997 is merged too.

test plan:
  - start up canvas
  - generate api docs:
    > docker-compose run --rm web bundle exec rake doc:api
  - load api docs in http://canvas.docker/doc/api/index.html
  - read over the "Outcomes CSV Format" and make sure it reads well
  - read over the "Outcomes Import" and make sure it reads well
  - obtain an access token:
    https://community.canvaslms.com/docs/DOC-10806-4214724194
  - request an outcome import, replace "canvas-path" and "token" values:
    curl -F attachment=@<canvas-path>/spec/lib/outcomes/fixtures/demo.csv \
         -F 'import_type=instructure_csv' \
         -H "Authorization: Bearer <token>" \
         http://canvas.docker/api/v1/accounts/1/outcome_imports
  - in a rails console, confirm that the import was accepted:
    > docker-compose run --rm web bin/rails console
    % pp OutcomeImport.last
    # confirm that the import is in the 'created' state, associated with
      your user and associated with an account context
    # note the "id" value for later use
    % pp OutcomeImport.last.attachment
    # confirm that the attachment is in the 'processed' state and has
      the filename "test_outcomes_1.csv" passed in above
  - request the status of the outcome import (should return a message
    saying "The specified resource does not exist"):
    curl -H "Authorization: Bearer <token>" \
         http://canvas.docker/api/v1/accounts/1/outcome_imports/latest
  - back in the rails console created above, manually transition
    the import to "importing":
    % OutcomeImport.last.job_started
  - run the above curl command again, and this time the latest outcome
    import should be returned, in the 'importing' state
  - run the above curl command again, replacing "latest" with the "id"
    value obtained above. it should return the same response as the
    previous step.

Change-Id: Ice7d67b625b443cec70f531f2e673face6d6fbeb
Reviewed-on: https://gerrit.instructure.com/142024
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Reviewed-by: Frank Murphy <fmurphy@instructure.com>
Tested-by: Jenkins
QA-Review: Frank Murphy <fmurphy@instructure.com>
Product-Review: Neil Gupta <ngupta@instructure.com>
2018-03-05 19:22:03 +00:00