This PS adds logic to compute context about a feature flag being
evaluated at the time it is checked, and pushed to an SQS queue if
configured. Whether or not to push the result of the evaluation to the
queue is both sampled and cached so as to not overwhelm the queue or
produce too much overhead on the Canvas side. The general process is:
1. Feature flag is evaluated
2. A random value between 0-1 is checked against a threshold stored in
the dynamic setting feature_analytics.sampling_rate.
3. If under the threshold, the LocalCache is checked for any recent
evaluations of the same flag / context / value combo.
4. If the result isn't already cached, the message is sent to SQS.
5. If anything unexpectedly goes wrong, an error is sent to Sentry and
feature evaluation continues normally (no user-facing error).
refs DE-926
flag = none
Test plan:
- Set up config in dynamic_settings.yml like the following:
feature_analytics:
cache_expiry: '60'
sampling_rate: '1.0'
queue_url: <canvas-feature-analytics SQS queue url in inseng>
region: 'us-west-2'
- Start canvas from a vaulted shell with inseng credentials
- Go to a user's dashboard, a few coures pages, etc..
- Expect to see messages show up in the SQS queue / its consumers
after a minute or two delay
- Expect to not see the same feature / context / value combo show up
on repeated evaluations
- Update the sampling_rate in dynamic_settings.yml to '0.0' and
restart canvas
- Flush redis cache
- Go to the same pages as before
- Expect to not see any more evaluations show up in SQS
Change-Id: I189e127dd5f31dc5d504bf45d354e93f7208107a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278885
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Jeff Largent <jeff.largent@instructure.com>
[skip-stages=Flakey]
auto-corrected with post review ensuring line breaks continue to
convey original meaning of separated conditions, and cleaning up
some now-duplicated conditions
Change-Id: Ib9b31226de0665a2e4427fe595639d0d91a33f83
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279151
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>
it'll never hit the db anyway, because it knows it has no parents, so it's a
useless caching
Change-Id: Ie6496b1dbcec1ddc3a32da52cdff7c1614b0d14b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271527
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>
it natively works as a normal where condition in Rails now
Change-Id: I74e6990e583bfd54bf4bd6c86fd5e00051818b99
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271671
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>
since they are the most common target of feature flag predicates
Change-Id: I2c6be68f442b2eb66f8cd5ad57cafbc83f114ba1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271502
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Feature !== FeatureFlag so we were missing a bunch of stats. This commit
moves all logging to the root feature_enabled? check
test plan:
- tests pass
qa risk: low
Change-Id: I1cd9af13762e40656fb4d1fdc20bec77ee3d4e1a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271023
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
so that we can return the same one every time if called multiple times
for the same context
Change-Id: I2c5825ab115c50d1332d05d1e3cecbe45cbe7ea1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270297
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>
test plan
- check status of feature flag
- it should log a stat containing tags for feature and if it is enabled
fixes VICE-1578
flag = all_the_flags
Change-Id: I42262914255f04649745ca13420ceeb5ca5d26e5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/266840
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
Change-Id: I078c5cbb3bc214df3409ff3b8661200e404709d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/265686
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>
The previous behavior made no sense for enabled unlocked features. Even
if they are root_opt_in, they should inherit from siteadmin if allowed_on
Change-Id: I66652a16241dabcfe728097fddd2e631e4fb1e0a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256574
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
Allow feature flags to be "allowed on". Updates user facing langauge
to be enabled/disabled + "(always)" or "(default)", which is clearer
than allowed, especially with 4 states. Also moves from backbone UI
to react UI rather than retrofitting the changes to the old UI. The
backbone ui can be killed in a separate PS. The new UI is easier to
ctrl-f on and presents the flags in alphabetical order according to
the user's current locale.
This includes a somewhat gross workaround for a bug in InstUI <Menu>
which is why it goes in an explicit <Popover>
fixes FOO-835
test plan:
- Ensure 'New Feature Flags' feature is off
- Make sure feature flags work in all the expected ways at the siteadmin, account, and course level
- Turn on 'New Feature Flags'
- Make sure that you can still use the feature flag ui in natural ways at each level
- Try turning a feature flag "on" but unlocking it/leaving it unlocked
- Ensure it is inherited on but overridable
Change-Id: I520824cdf6e18b5a7da5ab5f552a7fd3140fd4bf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249917
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Burroughs <jburroughs@instructure.com>
i.e. the page you're on. this prevents constantly querying site admin
feature flags directly when getting user feature flags, while still
preserving what looks like cache coherency when you flip an account
level feature flag
Change-Id: I694c83da3d548ae34428d3ffd8e18e2384df6656
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249645
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
fixes FOO-599
test plan:
- Enable a feature flag in siteadmin
- It should not appear in regular accounts
- Enable a course and account flag in a regular account
- On refresh they should still appear
- The course flag should not appear in courses in the account
Change-Id: I6af96794b0f0f9a5534374dd32b3b539a4b7f486
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244506
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
test plan:
* in a production-like environment, feature flag changes should
not appear to be undone when refreshing the page (while the
cache is still in the process of invalidating)
closes #ADMIN-2939
Change-Id: I495820850f8facaa6965188140d979bd5227994d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/211436
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Reviewed-by: Rex Fleischer <rfleischer@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
because clay can't spell
also get rid of that feature flag enabling on
every user in specs
also handle development features disabled in prod
Change-Id: Ifd6c590011e6963e7acea90f8f58bd2372123d26
Reviewed-on: https://gerrit.instructure.com/171781
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
Looks like it broke for development feature flags when canvas was
running in production mode.
This reverts commit 974a6e809a.
Change-Id: I1946137a2c4fade435ca00fde75f2dcb3a795ac4
Reviewed-on: https://gerrit.instructure.com/171728
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Jenkins
QA-Review: Keith Garner <kgarner@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
because clay can't spell
also get rid of that feature flag enabling on
every user in specs
Change-Id: I96b72b94f7421a4d7b1c0215d36733f369862b2f
Reviewed-on: https://gerrit.instructure.com/171457
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Change-Id: Ie6c9e4a2682d76f9d82131f38a0ff979e192f2fa
Reviewed-on: https://gerrit.instructure.com/162291
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
closes QUIZ-203, closes QUIZ-3434
test plan:
case 1: when a root account is not provisioned by uuid provisioiner
- 'Quiz Next' feature flag is not visible in root account, sub
accounts and courses
case 2: when a root account is provisioned by uuid provisioiner
- should see 'Quiz Next' feature flag in root account
- when the FF in root account is turned to On, all courses have access
to Quizzes.Next (Quiz Migration and Easy button)
- when the FF is off, all courses don't have access to Quizzes.Next
- when the FF is allowed, subaccounts and courses should have options
to turn Quizzes.Next On or Off
Change-Id: Ib41ce2db9943151f47ad42a676d29b744c381799
Reviewed-on: https://gerrit.instructure.com/135805
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Dariusz Dzien <ddzien@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
test plan:
- change a course/user feature flag
- the change should stick and apply
Change-Id: I2b4045bf6a0c5c57c58591c98ddcd513e8243fa0
Reviewed-on: https://gerrit.instructure.com/126202
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
slightly less performant but it'll fix whatever's associated with
the user that's causing marshalling errors sometimes
closes #CNVS-35073
Change-Id: Id4c18b6de829687c3a7d734fa16629fc3457bd5b
Reviewed-on: https://gerrit.instructure.com/102688
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Tested-by: Jenkins
QA-Review: Gentry Beckmann <gbeckmann@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
This is one piece of SIS-2636
Refs: SIS-2636
Test Plan:
Verify that an assignment requires a due date under certain
conditions:
assignment.post_to_sis = true
account's sis_require_assignment_due_date is true
the new_sis_integrations feature flag is on
Change-Id: Id614b6606127cad630b7c622c94893289aad59e6
Reviewed-on: https://gerrit.instructure.com/99181
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Tested-by: Jenkins
Product-Review: Oxana
basically means we don't have to reload the contexts
all the time
also make sure that inverse associations are populated
when calling temp_record
Change-Id: I2a0baefeccc814746a241f506a8f2db02aa8eebf
Reviewed-on: https://gerrit.instructure.com/99642
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Tested-by: Jenkins
basically means we don't have to reload the contexts
all the time
also make sure that inverse associations are populated
when calling temp_record
Change-Id: I22adf77d218f8084f76632d397161c05945cbae4
Reviewed-on: https://gerrit.instructure.com/98381
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
gets called multiple times per request
Change-Id: Id630760d1b34724d3d089e7dd48ad1c8268078b8
Reviewed-on: https://gerrit.instructure.com/82632
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
test plan:
As a site admin user,
1. Set "Post grades to SIS" to Allowed in a root account
2. Turn it on in a course
3. Turn it back off in the root account
4. Return to the course and reload the feature settings page
5. The page should load without error
NOTE: the fact that "Post grades to SIS" is still enabled in
the course is the subject of CNVS-29319 and will be addressed
separately. tl;dr hidden features are weird
fixes CNVS-29365
Change-Id: Ia9958bb6d4a56dc45a717503e437816a82e89b0c
Reviewed-on: https://gerrit.instructure.com/79631
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
remove the copying of grading periods. teachers
and sub-account admins can no longer create
grading periods (although they can still edit
and delete previously-created grading periods),
and they cannot edit root account grading periods.
closes CNVS-26727
test plan:
1. Course level
- sign in as a teacher in a course with multiple
grading periods enabled
- navigate to the grading periods page at
/courses/:course_id/grading_standards
- if there are existing course-level grading
periods, verify you can edit and delete them
- verify you cannot create new grading periods
- if there are not existing course-level grading
periods, verify account level grading
periods show up and they are not editable (if
the sub-account owning the course has grading
periods, sub-account periods should be displayed.
if the sub-account does not exist or does not have
grading periods, the root-account grading periods
should be displayed)
2. Root account level
- sign in as a root account admin and go to the
account grading periods page at
/accounts/:account_id/grading_standards
- verify you can still add new grading periods
and you can edit existing grading periods
3. Sub-account level
- sign in as a sub-account admin and go to the
sub-account grading periods page at
/accounts/:sub_account_id/grading_standards
- if there are existing sub-account grading
periods, verify you can edit and delete them
- verify you cannot create new grading periods
- if there are not existing sub-account grading
periods, verify root account grading
periods show up and they are not editable
Change-Id: If2083defa524a81cbc557e39350b553c417e6f81
Reviewed-on: https://gerrit.instructure.com/77396
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Christi Wruck
instead of assuming [self, Account.site_admin]
refs CNVS-26291, CNVS-26292
Change-Id: I8c20a3e29f5af91d04e380794f21705706fd96a8
Reviewed-on: https://gerrit.instructure.com/69841
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
that was only needed in rails 2
Change-Id: I1e2a00f65237d45ac82daa19eaecf5c589171718
Reviewed-on: https://gerrit.instructure.com/61025
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
explicitly have one copy per node in a ring (instead of relying
on hashing of a different to hopefully evenly spread copies around
the ring).
test plan:
* configure a ring of redis servers for cache
* canvas should still work
Change-Id: I17e086aac28c1c095c9717a7625ca51c86d0598f
Reviewed-on: https://gerrit.instructure.com/48069
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
something i came across while reading some logs
refs #CNVS-14539
Change-Id: Iaec7a290f49c2fa5a4e52550c14918abbdbfec44
Reviewed-on: https://gerrit.instructure.com/53106
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
test plan:
0. enable "better file browsing" and "usage rights required"
in a course
1. upload and expand a zip file and confirm the files are
unpublished initially
2. confirm that a file imported from an imscc package is
(a) unpublished in the new course if no usage rights
were set in the source course, regardless of whether
the file was published in the source course
(b) unpublished in the new course if it was unpublished
in the source course, regardless of whether usage
rights were set in the source course
(c) published in the new course if it was published in
the source course and had usage rights set.
3. repeat step 2, but with course copy instead
fixes CNVS-19620
Change-Id: I9a32adeafb94e4922ba95ad6466c72aca3fd3598
Reviewed-on: https://gerrit.instructure.com/52465
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
test plan:
* confirm that the permission to "View the answer matrix
in Quiz Submission Logs" is only visible when the
"Quiz Log Auditing" feature flag is allowed on the
account level
closes #CNVS-18192
Change-Id: Ibbd0a082af20e49ef5fd5471c22ce6c236fbfade
Reviewed-on: https://gerrit.instructure.com/47820
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins