Commit Graph

1703 Commits

Author SHA1 Message Date
Cody Cutrer a6caa96aa6 rails 7.1: fix schema caching
Change-Id: I8d152eb347cb768d63a31ee250513c7f90e3e3cf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/339572
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-02-05 16:14:47 +00:00
Cody Cutrer 84d092889f rails 7.1: fix moved timestamped_migrations method
Change-Id: Iec9060556ef80ba7fc4db2ccbcef884cefe5f04d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/339551
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-02-02 19:12:41 +00:00
Cody Cutrer 8a0ff22afd rails 7.1: fix deprecation callstack filtering
Change-Id: If652f16f59426f360b9cc05e73c247850b5fecdb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/339389
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-02-01 21:36:33 +00:00
Cody Cutrer a334c21b82 fix a rack deprecation warning
Change-Id: Ic99785ed063918040d395c6ebe728302f065ea4b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/339391
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-02-01 21:36:14 +00:00
Jacob Burroughs 1f7cf9237b Boot on rails 7.1
Change-Id: Ib5b0ec7e617b02b7edd9d2bf72204186169f22d4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/336192
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2024-01-31 18:10:22 +00:00
Cody Cutrer d5c60665b1 don't bother unnecessarily setting max_update_limit
avoids 1 to 3 extra db round trips if we're already doing batches
of 1000

Change-Id: I0b17a1072ad0a54c01ba0b9778f94bf3255ef014
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/338146
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2024-01-30 19:17:50 +00:00
Cody Cutrer b525c0f700 fix order of update/delete_all extensions interacting with sharding
make sure that switchman's extension is still active

Change-Id: I8d9d06103f1eb4b09f529b634fba758c72da371a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/339249
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-01-30 18:59:56 +00:00
Cody Cutrer be89b444d6 lock rows when doing an update/delete with a subquery
to avoid a concurrency issue where another of the same query selects
the row, and then it's gone before it can delete it, causing an error

Change-Id: I1155044c007988c4c7244352fae87de84c34894b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/338921
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-01-30 18:59:41 +00:00
Jacob Burroughs 3d7aa546d3 Remove more settings
Change-Id: Ibefe77b3ba1ec7e74e6e2af168f49ce06d6f49a9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/337253
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2024-01-29 16:21:38 +00:00
Roberto Noguera e3b5a11610 Add support to clone alignments after course copy
Add new state to assignment state machine to support cloning
alignments after the course copy process finishes.

closes OUT-6050
closes OUT-6051
flag=course_copy_alignments

test plan:

- unit test pass

Change-Id: Ib720edfae055aa109b11666d85f5928333633b54
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/336640
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Dave Wenzlick <david.wenzlick@instructure.com>
QA-Review: Dave Wenzlick <david.wenzlick@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2024-01-25 18:50:48 +00:00
Jeremy Stanley bb840f11eb remove graphql query timeout
because the transaction causes more trouble than the shorter
statement timeout solves

leave the transaction/timeout in place for mutations, since
tests depend on the atomicity it provides

test plan:
 - specs pass

flag=none
closes FOO-4149

Change-Id: I6c23934e8d000e08a400eb9049da058495f9ab55
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/338038
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2024-01-25 17:30:39 +00:00
jake.oeding 2392c54242 make dynamic settings writable in dev/oss
closes AE-567
flag=none

test plan:
-specs pass

Change-Id: I1a0309d14c195053a04662e72ecb13a65efb74ce
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/337226
QA-Review: Jake Oeding <jake.oeding@instructure.com>
Product-Review: Jake Oeding <jake.oeding@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
2024-01-23 15:20:56 +00:00
Cody Cutrer 6003b785aa bundle update switchman
Change-Id: I35e06b7c45699c4bae6f7779d7e795786882185b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/337924
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Isaac Moore <isaac.moore@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2024-01-18 17:23:46 +00:00
Jacob Burroughs 3b7130c161 Remove a lot of settings
[ignore-stage-results=Flakey Spec Catcher]

refs AE-551

Change-Id: If7b5191c20cfadc438cdc2bc8b489eb2806582fe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/334831
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2024-01-09 21:32:17 +00:00
Spencer Olson e67f851130 add SubAssignment model
closes VICE-3943
flag=discussion_checkpoints

Test Plan:
- specs pass
- Create an assignment, old quiz, new quiz and graded discussion
 assigned to multiple students and ensure each can be submitted
 to by the assigned students.
- Sanity check that the submissions can be viewed and graded
 within Speedgrader

Change-Id: I058a4093ee8bd00d8d7186fb6ada2dd5ba37d016
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/334399
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2023-12-19 16:13:47 +00:00
Cody Cutrer 3e27ddeae0 bundle update rubocop-performance, rubocop-rails
[skip-stages=Flakey]
[skip-crystalball]

99% of fixes are Performance/StringIdentifierArgument, but one or
two instances of each of Performance/Count, Performance/MapCompact,
Rails/Pluck in safe navigation chains

Change-Id: Ibd2292fb9e7c1e9162068021073c3c0f4b0d65df
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/335489
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-12-18 20:28:02 +00:00
Cody Cutrer c32d30f662 bundle update rubocop
[skip-stages=Flakey]
[skip-crystalball]

and apply corrections from new/updated cops:

 * Layout
 * Lint/AmbiguousRange
 * Lint/RedundantSafeNavigation
 * Style/HashEachMethods
 * Style/HashSyntax
 * Style/InverseMethods
 * Style/RedundantLineContinuation
 * Style/RedundantParentheses
 * Style/RedundantReturn
 * Style/SuperWithArgsParentheses
 * Style/SymbolProc

Change-Id: I787e46f5b1c89e0fedebd5452ba74567d66954c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/334291
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-12-06 14:25:02 +00:00
Spencer Olson e9d96e7e3e Introduce single table inheritance (STI) to the Assignment model
flag=discussion_checkpoints
closes VICE-3941

test plan:
 - Specs pass.
 - Cursory testing of everything related to assignments
   across Canvas LMS.
 - Create an assignment, old quiz, new quiz and graded discussion
   assigned to multiple students and ensure each can be submitted
   to by the assigned students.
 - Sanity check that the submissions can be viewed and graded
   within Speedgrader.

Change-Id: Ib31b8e604040b094381571b854ea3429ac10622a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/334305
Tested-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Omar Soto-Fortuño <omar.soto@instructure.com>
Reviewed-by: Aaron Suggs <aaron.suggs@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2023-12-05 22:09:24 +00:00
Cody Cutrer 1ff461e9df tag sentry reports in jobs with current shard and db
Change-Id: I3fec7ec730dba557a6f96d0c63e518e7ccc69365
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/332722
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-12-04 22:07:06 +00:00
Spencer Olson cd41464f8a make serializable_hash always return a hash with indifferent access
flag=none

Previously, the method would only return a hash with indifferent access
when include_root was false. When include_root was true, it would return
a plain-old hash. This change makes the return value type consistent, so
that it always returns a hash with indifferent access.

Test Plan:
- specs pass

Change-Id: I8fbc23523f1476a45a592cd02884d84d7c5a85e3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/334369
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2023-12-04 17:38:48 +00:00
Tucker McKnight 625081ffff spec: remove tests related to CDC
Change-Id: I604ae5d9b9152de85a8389ddf8fcb002f41f25b3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/325871
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
2023-11-21 04:59:49 +00:00
Omar Gerardo Soto-Fortuño 002f55b91a Add ability for class to specify override_reflection_type_values
closes VICE-3963
flag=none

test plan:
  - Specs pass.
  - Using the rails console, query an association that
      is polymorphic. For example: Assignment.take.versions.to_sql
  - Make sure this part shows in the query:
      "versionable_type" IN ('Assignment', 'AbstractAssignment')

qa risk: low

Change-Id: I86dd3f41489f885484ceff19bc185eb0b900b808
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/333147
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Product-Review: Omar Soto-Fortuño <omar.soto@instructure.com>
2023-11-20 17:13:20 +00:00
Jacob Burroughs f8a572148a Periodically run the attachment garbage collector
fixes AE-637

Change-Id: I0b21479fde1f9c2c9dc2270debbbb8f901f65125
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/332982
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-11-15 20:43:03 +00:00
Jackson Howe c7e3053207 Revert "Log state in touch_context"
We added this instrumentation to try and figure out what was happening
in LS-3147, but this has been in place for 1.5 years and we haven't
received any related reports since.

This reverts commit 7624569b39.

Change-Id: I4c99333204f14c3a77b0350c246d2928cae861be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/330695
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2023-10-20 15:47:03 +00:00
Cody Cutrer d0abf493cc bundle update switchman
region helpers have been hoisted into switchman proper, so
remove them locally

Change-Id: I1eda64fd64eda61b7647b15ec2ba62db986d19bd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/329655
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-10-12 20:31:19 +00:00
Jacob Burroughs 17e5e3c385 Disable writable shadow records
fixes AE-548

Change-Id: Ice3ec5d6f0debc578c682f5c72dc92e91ab5fa56
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/329196
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-10-04 00:31:46 +00:00
Cody Cutrer 88a5803982 bundle update redis
closes AE-494

[skip-stages=Flakey]
[skip-crystalball]

several things going on here. in general, many of our monkeypatches
have been implemented in upstream, but in a vastly different way, so
we need to enable/configure those things

 * `servers` is no longer accepted as a backwards compatible
   configuration option; use `url`
 * `database` is no longer accepted as a backwards compatible
   configuration option; you _can_ use `db`, but preferable to
   just use `url`
 * no longer merge together redis.yml and cache_store.yml; if one
   references the other, simply use the config from the other
 * `nil_store` is no longer accepted as a backwards compatible
   configuration option; use `null_store` (almost no one should
   be explicitly using this anyway, so nbd)
 * automatically not-even-trying when redis has previously failed
   is now handled by redis-client's circuit breaker. be sure to
   configure it in redis.yml/cache_store.yml/dynamic settings
 * ignoring redis failures completely is already done by
   RedisCacheStore; just rely on that, except for the few cases
   where we use redis directly. some of these now take advantage
   of a new `failsafe` kwarg (and often in combination with
   pipelining), and some just handle it directly
 * move logging to a RedisClient middleware
 * move Twemproxy disallowed commands to a RedisClient middleware
 * simplify Canvas.lookup_cache_store to have far less special casing
   (in particular, patching is done automatically now)
 * add ability to use Redis::Cluster (configure with `nodes` instead
   of `url`)
 * still override Redis::Distributed's HashRing, so that we don't
   change our ring layout with the new MD5 hashing for servers. but
   we got to vastly simplify the new class, due to upstream
   refactorings allowing us to simply override a single method rather
   than having to re-implement the entire class
 * statsd reporting of redis errors is now simply passed as a callback
   to RedisCacheStore, breaking CanvasCache's dependency on InstStatsd

Change-Id: I787672677a21994d40ae304dbac0fbf3a960a779
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/325641
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-09-28 15:49:47 +00:00
Cody Cutrer cdf0c2071d remove Setting.skip_cache
in favor of a kwarg on individual callsites

refs AE-494

Change-Id: I56eb8271b38bfe6e05ea20aaca10f7cbdd4cb5fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/328789
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-09-27 17:08:20 +00:00
Cody Cutrer 4e6a6c082c remove shims from CanvasCache extraction
refs AE-494

[skip-stages=Flakey]

Change-Id: Id8f64e0c2b641ef55177e29637db3157160e9b72
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/328786
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-09-27 17:07:00 +00:00
Cody Cutrer 22b7677b3b switch from byebug to debug
It's the new default debugger in ruby 3.1. Rails switched to it in 7.0,
avoids issues with Zeitwerk, has a more modern interface based on
current IRB, supports Unix Domain Sockets for remote debugging,
promises even better future maintenance due to being part of Ruby,
etc.

Change-Id: Ieaa7872f1c0308b16ae180fdb16df5dd6caa87a8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/328241
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Build-Review: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-09-20 23:48:39 +00:00
Jacob Burroughs 2bab2c1408 On-demand create missing partitions
This does add an additional query every time we insert a versioned record, but it
is a very lightweight query that shouldn't hit the disk and record insertions are
orders of magnitude more expensive, so it should have an insignficant performance
impact.

fixes AE-445

Change-Id: I9ae43121a221442fc1db9f1c1486778b58803917
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/326670
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-08-31 20:06:24 +00:00
Cody Cutrer 2cfeebb3e7 remove week_of_month dependency
we only used it for one thing, and honestly with all of the dynamic
method dispatch it's not clear what it's even doing, so just do the
math ourselves

Change-Id: I17b601732d7b6e5e2236eb01e9ef368fc9d1fa89
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/326665
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-31 19:20:24 +00:00
Cody Cutrer 163fbd2b69 remove thor hook
the version we use now properly calls super in inherited

Change-Id: I1da36c07877712c8362d7cb31090a271b0f37c51
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/326475
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-08-30 18:54:06 +00:00
Cody Cutrer eed5b38eee remove unused LinkedIn gem
Change-Id: I797580b2b9e9e65831984db8c5946cfa4e590a55
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/326106
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-28 15:59:01 +00:00
Spencer Olson 15f9441a12 fix spelling: assocation -> association
refs EVAL-3436
flag=none

Test Plan:
- specs pass

Change-Id: I2c899fb2576cd82aeecac5b08917759cabf5e665
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/326052
Reviewed-by: Samuel Lee <samuel.lee@instructure.com>
Reviewed-by: Cameron Ray <cameron.ray@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
2023-08-24 14:43:03 +00:00
Cody Cutrer cfead13ea6 bundle update statsd gems
need to remove strand filter (it never worked)

Change-Id: Id3f6970216b68936a775aa246341cc5db2e9d2a7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/325484
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-17 19:37:09 +00:00
Cody Cutrer f1c08099fb don't send Delayed::Backend::JobExpired to Sentry
fixes CANVAS-KWHP

the only job we have that uses it has a permanent_failure_callback anyway

Change-Id: Ie8034969943d958ed6ef59ee815bc5153283820a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/324601
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-08-07 20:16:40 +00:00
Cody Cutrer 8f8f6f7313 bump rubocop gems and apply changes
[skip-stages=Flakey]

Change-Id: I5f080be6efb64351b4a89e6bd6040bc6f0432e82
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/323854
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-08-07 20:13:35 +00:00
Cody Cutrer 5ab6068593 avoid extra round trip to db every time we fetch a module progression
Change-Id: If920a7e4fdee30e8cf31c230f9064a0f6ebcc373
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/324192
Reviewed-by: Luis Oliveira <luis.oliveira@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-08-07 16:35:29 +00:00
Steve McGee eee443e1d7 stop "Grade pass back unsupported" to Sentry
why: we want to reduce Sentry "noise" and not sending 400s
errors from `lti_api_controller#check_outcome` will help

closes INTEROP-8159

test plan:
deploy to beta and make sure it's working as expected

Change-Id: I8c672dd5e40c7d13f085343c650b6007bec380c3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/323986
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Steve Mcgee <steve.mcgee@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-08-02 15:42:13 +00:00
Cody Cutrer 3b90b979eb ignore permissions errors when attempting to write to Consul failsafe cache files
refs AE-380

Change-Id: Ib6c29da30883fe07008b17faf4e2f9dc4a08cf75
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/323282
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-07-27 16:52:01 +00:00
Cody Cutrer 764838e8a1 remove old monkeypatch for an optimization now in upstream rails
Change-Id: I7fa12ac47729d65c683ff0cd1a20625a3827ac10
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/322900
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ryan Hawkins <ryan.hawkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-07-17 23:29:59 +00:00
Cody Cutrer f8f579cd82 switch LiveEvents config to use a single Consul key
makes it much easier to do a failsafe local cache on it

refs AE-380

Change-Id: Ia4bda742e3ee3f80749f3f074e2411b68476b49c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/322309
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-07-12 14:53:08 +00:00
Cody Cutrer 014b010c05 implement failsafe local caching of several Consul settings
either used at boot, or on every request (recaptcha)

refs AE-380

Change-Id: I3e75b6063591c4704a01fda807273ca36a93cb44
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/322308
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-07-12 14:52:34 +00:00
Cody Cutrer 61df8f99f2 implement failsafe local caching of cache store config
refs AE-380

Change-Id: Ie66913a4762d7c1a4a4e1d68b31d3e0bed4cb3a6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/322299
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-07-12 14:52:15 +00:00
Cody Cutrer 09a6b94036 add reasonable failsafes for several usages of Consul
refs AE-380

a lot of these are APM style settings that would be okay to just turn
off while Consul is down. others are things that should just silently
not have any data, instead of failing the request

Change-Id: I34c553b089197f85b2d46029e5079851227090b6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/322239
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-07-12 14:51:15 +00:00
Cody Cutrer aa7041d2c1 update rubocop, and apply new cops
[skip-stages=Flakey]

Change-Id: I2d3ffbeb652a6668941125a8a2afe87f104c8d0a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/321953
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-07-03 22:11:42 +00:00
Isaac Moore 62d034f5a0 Add periodic job to identify bad LDAP certs
This job will run once daily to make two test connections against each
LDAP authentication provider, and log a warning to Sentry if their TLS
certificate is not valid.

flag=none
closes AE-349

test plan:
- create an LDAP auth provider with a bad TLS cert
- run AuthenticationProvider::LDAP.ensure_tls_cert_validity
- ensure you get a warning in Sentry
- create an LDAP auth provider with a valid TLS cert
- run AuthenticationProvider::LDAP.ensure_tls_cert_validity
- ensure you get no warning in Sentry

Change-Id: Idd1157068f34a610f3f0e2fb1de89557cb585575
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/321403
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-06-27 16:04:30 +00:00
jen.smith 071a64628d add server support for points based grading schemes
add new columns 'points_based' (boolean) and 'scaling_factor'
(decimal) to grading_standards table.  Add support for
GET, PUT, CREATE of these new attribures to the json
based grading_schemes rails controller.

flag = points_based_grading_schemes

Test Plan
   - tests pass

closes EVAL-3256
closes EVAL-3257
closes EVAL-3258

Change-Id: I0851d5d3b11b4e29098d810bbd96397c61f872ce
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/320659
Migration-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
2023-06-21 19:32:38 +00:00
Cody Cutrer 5431d47758 rubocop: Rails/I18nLocaleAssignment
manually done. the big one was the explicit locale assignment
in set_locale_with_localizer needs undone in a controller callback

then using with_locale everywhere, specs no longer need to be concerned
about being in an uncertain locale

Change-Id: I5a1d2c907a6f52ee4d8c2307b8c789a1f1ea436e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/320112
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-06-13 21:59:50 +00:00
Cody Cutrer d2b02ba910 rubocop: Lint/SendWithMixinArgument
I'm not sure why rubocop didn't find these; I found them manually

Change-Id: Id2654b6d2a4a2827d56dfd0baef7a7d668591144
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/320149
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-06-09 16:04:56 +00:00
Jacob Burroughs 7dcc507d0a Rubocop for ruby 3.1
[skip-stages=Flakey]

Change-Id: I6abefdfa9fed6dd4525c8786e93efa548b3710f2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/319603
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-06-06 16:44:26 +00:00
Aaron Ogata b0cbf2629a pull vault_credential_path from the right subkey
fixes CANVAS-KD7Y
refs AE-254

Change-Id: I9c4a635b839bdaa441e4bf95c899fe6ada9aa918
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318910
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-05-23 16:11:45 +00:00
Aaron Ogata e6d6ba051d deep clone to prevent modifying frozen hash
refs AE-254

Change-Id: Ica0569bbba2d67a0d7ce5310a5b1f4955b5a08a8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318821
Reviewed-by: Ryan Norton <rnorton@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-05-23 00:33:37 +00:00
Jacob Burroughs e34ecff983 Don't mutate delayed::cli config
Change-Id: Ib787e8cf4fdb6b3a79ddb82c5566db0467018854
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318199
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-05-15 20:46:17 +00:00
Jacob Burroughs 4fa2719cc1 Correctly identify if we are in a transaction
Change-Id: I42e8dbe319551a7ccb19ad20dde60fd38046dc49
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318170
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-05-15 16:21:34 +00:00
Jacob Burroughs 3a0d2d7c1b Don't create new transactions if we already have one
Change-Id: Ife6c14c0c9f373af8c8f675dfe68304e44cd9ac8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/318157
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-05-15 14:34:22 +00:00
Aaron Ogata 25e347edd6 convert incoming_mail_processor to using vault
refs AE-254

Change-Id: I0f1cb98b83464e4cef3e2843fe844a644f4f0bf6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317865
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2023-05-11 15:01:37 +00:00
Aaron Ogata 761606c842 use vault role for jobs autoscaling
refs AE-50

Change-Id: I183bdf0533e971014d207499c85ca6fbfc6ca44b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317774
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2023-05-10 13:48:53 +00:00
Jacob Burroughs 2cc84ccd8e Bump switchman and report deprecations to sentry
refs AE-248

Change-Id: Ibcceeed4a8163648ed5a7d9f41b00499affae990
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317764
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-05-09 16:46:04 +00:00
Cody Cutrer aa4c092467 use Arel for EXISTS sub-queries
so that switchman can tranpose the sub-queries

refs AE-164

Change-Id: I0bb0be10cd7c47126767d94e0bdb83cd0b3d16bf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316973
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-05-02 17:30:40 +00:00
Jacob Burroughs 7109a6cbae Clean up more bulk update warnings
refs AE-158

Change-Id: Ibede015c86ec7f04bab5235ed57acc42a4659b8f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317117
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-05-02 15:08:03 +00:00
Cody Cutrer 502aa068da rubocop: Layout/Multiline*LineBreaks
[skip-stages=Flakey]

Change-Id: I24912809267088bc19a4082c49bc5f78ca7b76bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/317302
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-05-01 19:31:42 +00:00
Isaac Moore 1c61a27781 Fix rubocop violations in AR initializer
Change-Id: I8a4b84177cfcb89ad148c18a7a06149a7117d285
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316758
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-04-25 16:52:30 +00:00
Isaac Moore 42e55a6553 Remove `account_authorization_configs` from old migrations
closes AE-239
flag=none

test plan:
- migrations run successfully on Jenkins
- tests pass

Change-Id: Ic89e000b89bb35f2ae20ea98b950b45e4fbe3089
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316549
Reviewed-by: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-04-25 16:52:05 +00:00
Cody Cutrer 25461d73b8 bump inst-jobs
[skip-crystalball]

Change-Id: I42f3748bbde72653d242bf7815f9fb31576e8c7f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/316253
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
2023-04-19 15:36:04 +00:00
Cody Cutrer 7c37aa5f64 rubocop: prep for updating rubocop-rails
auto-correctable cops applied

[skip-stages=Flakey]

Change-Id: Ie80bdfd170d9233d4a750edce6be467c93f3493f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315835
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-14 14:07:22 +00:00
Cody Cutrer 1d3d9ed499 rubocop: fix miscelleneuos violations in prep of bumping rubocop
Change-Id: I9d37303737f00d6e022cb8fc08726e293a7336ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315166
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-12 19:26:13 +00:00
Cody Cutrer 0fed7b7336 switch to native pg12 collation for ICU sorting
closes AE-81

test plan:
 * the people page for an account or course should load properly,
   and still sort properly (enforced by specs)

Change-Id: Id8f252af44b2fa4a31786c5c4b7fef9d2aad0946
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314759
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-12 17:18:46 +00:00
Cody Cutrer b2b0bff902 rubocop: Style/TernaryParentheses, Style/RedundantParentheses
[skip-stages=Flakey]

Change-Id: I8d860eedd8b199ed3adf0e2bf9162b43096c5347
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315130
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-04-12 14:56:48 +00:00
Jeremy Stanley 5ad7ddd6b0 fix postgres error logging
fixes CANVAS-K0Y4

Change-Id: I8d715b404a5eecc375f909110c2abbfbf9ed572d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315642
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2023-04-12 13:04:54 +00:00
Cody Cutrer f46fef5599 rubocop: Style/MapToHash, Style/MapToSet
Change-Id: I75a78a3d86d5875b450d4f32c2f71d8a44a735f4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315125
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-11 14:41:55 +00:00
Cody Cutrer c101827780 rubocop: Style/RedundantConstantBase
[skip-stages=Flakey]

Change-Id: Ie18389de5b45f433aa82a13f62daa2a5a9d44b80
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/315120
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-10 20:56:27 +00:00
Matt Petro cf29d19f31 Use SHA256 for cache keys
This is part of the FIPS compliance project

Changing the hashing algorithm for cache keys should not affect site operation

Test plan:
- specs pass

Change-Id: I253821ec5a34fe69496a5690d11d735eeb001ae5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266082
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-04-05 17:57:09 +00:00
Cody Cutrer afcb28e152 fix PG collation query
at some point Postgres started putting the locale in a separate column
for ICU collations. so just rely on the collation name

Change-Id: I135fbe11c56c1fe4d32c1f2709c0e08f64dd7c07
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314745
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-03-30 20:53:36 +00:00
Jacob Burroughs 5d09941973 Fix some bulk update violations
refs AE-158

Change-Id: I1c805f91e417ce5f1afd99107ef4cc050d9c0353
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314575
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-03-30 17:05:43 +00:00
Jacob Burroughs 6f020202c7 No lazy loading when eager loading
Change-Id: I7a907ff8978e80271a115572fcd32e92c25c183e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314711
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-03-30 16:43:37 +00:00
Cody Cutrer 9519bcabb4 update i18n gem
closes AE-99

re-work LazyPresumptiousI18nBackend:
 - most of the functionality is now in upstream as Backend::LazyLoadable
 - the locales.yml and community.csv containing data for all locales is now
   in a new Backend::MetaLazyLoadable
 - CSV parsing got put into its own module

test plan:
 - Canvas should load in English, including the list of other languages
 - changing language should still work
 - community translations are still available
 - (testable in console) I18n.backend.initialized? should not return true
   after setting I18n.locale until after a translation has been requested
   while that locale is active

Change-Id: I060763de4d7f889efae234109fde801867192c43
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314616
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2023-03-30 15:38:32 +00:00
Spencer Olson 205fe619a3 add prosopite n+1 query detection
Detection is disabled by default, but can be enabled by setting the
N_PLUS_ONE_DETECTION environment variable to 'true'. For more information,
see doc/detect_n_plus_one_queries.md

closes EVAL-2973
flag=none

Test Plan:
1. Start rails
2. Create a coures with multiple assignments and go to
   /courses/:id/assignments
3. Notice there are no N+1 query warnings shown in log/development.log
   and that log/prosopite.log does not exist.
4. Run the `spec/models/grading_period_spec.rb` spec file and notice that
   no N+1 query warnings are shown in log/test.log
5. Set `N_PLUS_ONE_DETECTION: 'true'` in docker-compose.override.yml
   under web: :environment.
6. Stop/start rails
7. Go to /courses/:id/assignments
8. Notice there are N+1 query warnings shown in log/development.log
   and that log/prosopite.log exists and also has warnings in it.
9. Run the `spec/models/grading_period_spec.rb` spec file and notice that
   N+1 query warnings are shown in log/test.log (but not in
   log/prosopite.log)

Change-Id: I33f43e65df10e2161f1a0687eee3e0b7826bfe3d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/313592
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Cameron Ray <cameron.ray@instructure.com>
2023-03-29 22:34:20 +00:00
Isaac Moore 21363d56a4 Read LinkedIn creds from Vault
refs AE-51
flag=none

test plan:
- specify `linked_in_creds` in `vault_contents.yml`
- confirm they're loaded correctly when calling
  `LinkedIn::Connection.config`

Change-Id: I98e391466abfe3137bec30110c201a7bf2973295
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314227
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
2023-03-28 14:01:04 +00:00
Jacob Burroughs 809ca3cac9 Send postgres warnings to sentry
And make the errors from guard_excessive_updates likely group
better for sentry's purposes

refs AE-149

Change-Id: Iea04ebdbb96653b82e1eed7026697fe8419f6879
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/313635
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-03-17 21:54:49 +00:00
Jacob Burroughs 35c56fb9b9 Revert "Revert "Introduce guardrails for excessive db modifications""
This reverts commit d2f0962da9.

Fixed now to not break jenkins

[build-registry-path=jenkins/canvas-lms/jburroughs-test]
[change-merged]

Change-Id: I9e55a234000043dce4e296952279e275bbb281a3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/312747
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-03-08 15:00:09 +00:00
Jacob Burroughs 9511784c4d Actually override all db configs when overriding
fixes AE-165

Change-Id: Icf837a09fa95da1c1f4d52fd074203f58d88b5f6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/312700
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
2023-03-07 22:07:13 +00:00
Aaron Ogata d2f0962da9 Revert "Introduce guardrails for excessive db modifications"
This reverts commit 8bc4a9e6a3.

Reason for revert: broke jenkins

Change-Id: I4beb70f18707d52665ed489b31f513c4165bf51c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/311360
Tested-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
2023-02-24 19:02:04 +00:00
Jacob Burroughs 8bc4a9e6a3 Introduce guardrails for excessive db modifications
For now warn so we can measure and make necesssary changes; will
allow opting in to hard fialures per database server

fixes AE-149

Change-Id: I4588ccbda726ea0b9fdf4eb9fe15246388ac0478
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/311729
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Reviewed-by: Hubert Lubaczewski <hlubaczewski@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
2023-02-24 15:51:35 +00:00
Aaron Ogata 87fb1ffdab improve caching of ignored_columns
refs AE-124

Change-Id: Ia458e233a64a9d4fbd878537d39418a1349660db
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/311728
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2023-02-24 15:18:29 +00:00
Jacob Burroughs d166798ef9 Drop rails 6.1 support
Change-Id: I25be73991a0542755579de897b98561ded3cd0c2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310452
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Build-Review: Jacob Burroughs <jburroughs@instructure.com>
2023-02-14 21:47:03 +00:00
Aaron Ogata 0aca0be810 allow additional columns to be ignored through Consul
refs AE-124

When running pre-deploy migrations that add a new column, if an application server loads the schema on a shard where the migration has already run, and tries to run queries on a shard where the migration has not already run, it can lead to errors. Fix this by allowing ignored_columns to append to its value dynamically through Consul.

Change-Id: I3b13e0fd2ac066e1439d3d314d71f2ebd8938e0c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310561
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2023-02-08 17:05:57 +00:00
Aaron Ogata ca7fa755d4 add jobs cluster tag
refs AE-119

Change-Id: I1b2f903a60793459feca2c0ef4d9eed9df12b508
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/309463
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2023-01-27 15:09:00 +00:00
Jacob Burroughs 62e9dd0ae1 Unbreak loading session secret keys
This re-adds a require_dependency to keep the change small; we should
do a followon change to remove the require_dependency.

(fixes issue introduced in 618a6e702e)

Change-Id: Ib77c904d432cc7b6abaa230dc1b0ea7cfcc3982e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/309211
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Ethan Fox <ethan.fox@instructure.com>
Reviewed-by: Isaac Moore <isaac.moore@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2023-01-19 22:53:42 +00:00
Aaron Ogata b8dd8ee10b report health checks to stats periodically
refs AE-106

Change-Id: If395f7e381c283e8d334f2397f3dd605475c18d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308553
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2023-01-17 17:11:16 +00:00
Isaac Moore d602faaf0b Remove SAML provider `require_dependency` calls
refs AE-31

flag=none

test plan:
- verify Canvas boots in CD
- verify no influx of new errors in CD

Change-Id: Ifcb0fdd95ad77f7d4934442de8f63385841ba2ac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308420
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
2023-01-09 19:56:41 +00:00
Jacob Burroughs 618a6e702e Kill require_dependency
refs AE-31

flag=none

test plan:
- verify Canvas boots in CD
- verify no influx of new errors in CD

[fsc-timeout=1]
[ignore-stage-results=Flakey Spec Catcher]

Change-Id: I26663e32d9452c198c87b957b026170ee3e4bc93
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/305073
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
2023-01-09 19:51:01 +00:00
Isaac Moore d6584b490a Remove unnecessary require statements
closes AE-30

flag=none

test plan:
- verify Canvas boots in CD
- verify no influx of new errors in CD

[fsc-timeout=30]

Change-Id: Ifa04bebe1b09f01c6d3b8b2d8f3bb424759730f5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/308067
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
Build-Review: James Butters <jbutters@instructure.com>
2023-01-04 21:38:21 +00:00
Aaron Ogata c6f720cd2b make “in region” methods enqueue_args mandatory
refs AE-92

Ruby 2.7 will put the enqueue_args, in kwargs if there are no additional arguments provided, even if enqueue_args is provided as a hash.

```
def x(a, b={}, *args, **kwargs)
  puts a, b, *args, **kwargs
end

x(1, {'a': 'b'})

# 1
# {}
# {:a=>"b"}
```

In practice, this method is always sent enqueue_args anyway, so just make it mandatory.

Change-Id: I0e31e73bf9d4f7b20d4006ac2e34dd2f11bb1178
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307827
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-12-21 14:09:14 +00:00
Aaron Ogata 1f5eb2782b fix openstruct deserialization for ruby 3.x
refs AE-96

Change-Id: I9339ae485022cee58d7803fb2cc495026af4d765
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307750
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-12-20 15:42:29 +00:00
Aaron Ogata c519c7993f fix “in region” methods to send kwargs separately
refs AE-92

Change-Id: Ia3b073c68a1f91d976af0eff04e1a9d83f78b2ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307328
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2022-12-13 19:18:14 +00:00
Jacob Burroughs 686ff49035 Fix initializers for ruby 3.0
Change-Id: I91f1cad1486ce7a9695f9e7eaefd54a1b24e772b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307223
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-12-13 14:29:18 +00:00
Jacob Burroughs f5ef671937 Fix migrations on ruby 3.0
Change-Id: Id1240c757f3e8470c27b8c1fdd0f5fe3f9c48e4e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307222
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
2022-12-13 14:26:35 +00:00
Aaron Ogata 9c0413c2b2 fix as_json method signature for ruby 3.x
refs AE-92

Change-Id: I84c97922308d4c3ebf404e8942b24fbf4885bd6d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/307218
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2022-12-12 20:58:00 +00:00