Commit Graph

18 Commits

Author SHA1 Message Date
James Williams 77d6d56b5e raise error on missing feature
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>
2018-11-26 16:22:32 +00:00
Keith T. Garner ff96bdbbd0 allow new gradebook to be set to on at account level
closes GRADE-1472

test plan:
 - Ensure New Gradebook can be set to On at account level

Change-Id: I42fbaf135bc171bea6fcce7e8bfddb9eb177c221
Reviewed-on: https://gerrit.instructure.com/160718
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Tested-by: Jenkins
QA-Review: Ryan Kuang <rkuang@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2018-08-14 19:11:35 +00:00
Keith Garner ff6a1039c4 stop locking new gradebook in an off state
Given certain circumstances the new gradebook would be in a locked off
state. The original intention was to leave it locked on once backwards
incompatible features were used.

fixes GRADE-1419

test plan:
 - Have a course with new gradebook turned on
 - Use one of the backwards incompatible features such as manually
   marking late status
 - In the rails console force the new gradebook feature flag off with
   a command line such as:
   FeatureFlag.where(context_id: <course id>, context_type: "Course",
     feature: "new_gradebook").update(state: 'off')
 - Visit the course settings feature flag editors and ensure that New
   Gradebook has a toggle in the office position not the locked "Off"
 - Turn on the new gradebook. Reload the feature flag page, note that
   its now in a locked on position.

Change-Id: Iba2dc617ddeaf33888d0d97cf5e1f91c1cb0ec19
Reviewed-on: https://gerrit.instructure.com/158548
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Jeremy Neander <jneander@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2018-07-30 16:41:32 +00:00
Shahbaz Javeed 9f7ee5f6b3 prevent disabling new gradebook if any sub-account/course uses it
closes GRADE-767

test plan:
* Create a sub-account 2 levels deep
* Create a course for this sub-account

* Go to the root account and look for the "New Gradebook" feature flag
* Verify visually that you're allowed to turn the flag off

* Enable the "New Gradebook" feature flag on the course
* Go to the root account and look for the "New Gradebook" feature flag
* Verify visually that you're no longer allowed to turn the flag off

* Disable the "New Gradebook" feature flag on the course
* Enable the "New Gradebook" feature flag on the sub-account
* Go to the root account and look for the "New Gradebook" feature flag
* Verify visually that you're no longer allowed to turn the flag off

* Disable the "New Gradebook" feature flag on the sub-account
* Go to the root account and look for the "New Gradebook" feature flag
* Verify visually that you're allowed to turn the flag off

Change-Id: Ifc7444ff114d8fb3b297ea20f5e2891a450497c5
Reviewed-on: https://gerrit.instructure.com/142011
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Pert Eilers <peilers@instructure.com>
2018-03-07 17:30:49 +00:00
Keith Garner 6c6f18930f update new gradebook feature flag
This patchset updates the new gradebook feature flag to 1) allow
teachers to enable the new gradebook for a course (if the admin has
set new gradebook to allow) and 2) disable the ability to turn off the
new gradebook for a course if backwards incompatible features are
used. For now, the features that would stop a move backwards are
enabled late or missing policies, or any submission that had a
late_policy_status manually set.

closes GRADE-691

test plan:
 - As an admin, in the account settings set new gradebook to allow
 - Create a course with a teacher, a ta, a student, and an assignment
 - As a ta, go the course settings and confirm you can't configure new
   gradebook
 - Perform the following actions as a teacher unless otherwise
   specified
    - go to the course settings and enable the new gradebook
    - in the gradebook, configure a late policy
    - go the course settings and confirm you can't turn off new
      gradebook
    - as an admin, go to the course settings and confirm you can't
      turn off new gradebook
    - in the gradebook, turn off the late policy and configure a
      missing policy
    - go the course settings and confirm you can't turn off new
      gradebook
    - as an admin, go the course settings and confirm you can't turn
      off new gradebook
    - in the gradebook, turn off the missing policy
    - go the course settings and confirm you can turn off new
      gradebook (but leave it enabled)
    - as an admin, go the course settings and confirm you can turn off
      new gradebook (but leave it enabled)
    - go into the gradebook, set a missing or late status on the
      assignment for the student
    - go the course settings and confirm you can't turn off new
      gradebook
    - as an admin, go the course settings and confirm you can't turn
      off new gradebook

Change-Id: Ibfde1398c60254de1fd2b9697e8155fabbb1b781
Reviewed-on: https://gerrit.instructure.com/134521
Tested-by: Jenkins
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-12-08 17:30:15 +00:00
Cody Cutrer cdf5050f57 spec: mocha => rspec-mocks for lib
Change-Id: I5cd79ee9256d18e782f2ec36f97425fbb1e598d3
Reviewed-on: https://gerrit.instructure.com/120499
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2017-07-26 19:20:32 +00:00
Matt Taylor 3b5c40bd70 allow gradezilla to be default gradebook at a course level
fixes CNVS-36920
fixes CNVS-36919

Rename the :gradezilla feature flag to :new_gradebook, with the
following attributes

display_name: t('New Gradebook')
  No longer display the "Gradezilla" code name in the UI or URLs
  Many internal code objects still keep gradezilla names for now
applies_to: 'Course'
  The feature must be enabled at a course level to be used
state: 'hidden'
  The feature flag is hidden and cannot be enabled until an
  Instructure site admin allows it
root_opt_in: false
  Root account admins cannot turn the feature ON at once for all
  the courses they control
beta: true
  The "beta: label is displayed next to the feature toggle element
development: true
  The feature cannot be enabled in production.  Beta is allowed
admin_only: true
  Only site, account or subaccount admins can enable the
  feature for a course.  Teachers cannot enable the feature.

The admin_only attribute is new, added here as an experiment.
It is false by default, and the code supporting it is kept
as localized as possible in case it is later decided this
functionality is not desired in Canvas

version query parameter is now development-only

Test Plan:
  1. Before enabling "New Gradebook" feature as site admin
     a. non-INST admin does not see the flag at account level
     b. teacher does not see the feature flag at course level
     c. site admin sees it at account level, but can only
        choose "Off" or "Allow"
     d. site admin does not see the flag at course level
  2. After enabling feature as site admin at account level
     a. non-INST admin can modify the flag at account level
        to "Off" or "Allow" but not to "On"
     b. non-INST admin can modify the flag at course level
        to "Off" or "On"
     c. teacher can see but not modify the flag at course level
  3. After enabling feature as non-INST admin at course level
     a. "Gradezilla" is replaced with "New Gradebook"
        in both standard and individual views of the UI
     b. teacher sees "New Gradebook" feature as "On"
  4. As Developer
     a. Use the version query parameter to override feature flag
     b. Use the version query parameter to override user preference

Change-Id: I20a03832544a8e60d3b9b726694d3e88f01381fb
Reviewed-on: https://gerrit.instructure.com/112457
Tested-by: Jenkins
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2017-05-31 17:03:29 +00:00
Landon Wilkins a55623016d da licença part 47
add consistent license headers to all source files

Change-Id: I8d372efee113550ada3255f32ec6f1858e5520c4
Reviewed-on: https://gerrit.instructure.com/110152
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-28 17:59:55 +00:00
Clay Diffrient e880e4faa3 Add mechanism for toggling tutorials
closes FALCOR-70
closes FALCOR-71

Test Plan:
  - Create a new user
  - Add them to a course
  - They should have the tutorial option showing as on in
    user settings
  - Tutorial trays should show from the right side
  - Clicking end tutorial in the tray should open up a
    dialog to confirm
  - Cancelling should do nothing but close the dialog
  - Clicking okay on the modal should trigger the page to
    refresh
  - Tutorial options should be gone and the feature flag
    should be turned off in user settings
Change-Id: I0b287be7278059a24df07c75436def8fb53b3b17
Reviewed-on: https://gerrit.instructure.com/103568
Tested-by: Jenkins
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Dan Sasaki
Product-Review: Christi Wruck
2017-03-13 15:00:08 +00:00
Simon Williams 57497719a7 spec: rename the `course` helper to `course_factory`
closes CNVS-34046

test plan: specs should pass

Change-Id: I8684d30e5af7be04566b2d3903db2b7f4b14b24b
Reviewed-on: https://gerrit.instructure.com/98439
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-27 20:25:29 +00:00
Dan Minkevitch 5a8a8f7547 Setup CR for account on feature enable
Closes CYOE-86

Test Plan:
* Enable the "Conditional Release" feature
  in Canvas for a new account & course
* Verify in CYOE that a request has been made
  and a corresponding Account model has been
  created for the root account of the feature
  enabled course.

Change-Id: Ide8ed35f664ddafbf61e26cda0d0233bbf4f3781
Reviewed-on: https://gerrit.instructure.com/77455
Tested-by: Jenkins
Reviewed-by: Christian Prescott <cprescott@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2016-09-28 15:51:25 +00:00
James Williams c31de7196e spec: don't break feature definitions in feature_spec
fixes a problem where running feature_spec will break
any future specs in the same run that depend on features

Change-Id: Ia81c8f0ff89a475b84290bff0ed996ddcd3aaeea
Reviewed-on: https://gerrit.instructure.com/43731
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-11-03 15:35:20 +00:00
Jeremy Stanley bfcaa96bd2 implement 'hidden_in_prod' feature status
this is 'hidden' in production environments and 'allowed' elsewhere

test plan:
 - The 'better_file_browsing' feature should be hidden in production
   environments (such as a portal with config/testcluster.yml
   removed).

fixes CNVS-16352

Change-Id: Ic8eefcb53122d27fbf9094cbc010efdbd40e2a59
Reviewed-on: https://gerrit.instructure.com/43098
Reviewed-by: Jon Willesen <jonw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2014-10-21 22:12:39 +00:00
Cody Cutrer 9407689be8 rspec 3-ify spec/lib
refs CNVS-16239

Change-Id: Id6d24bf80d8c5722b7ba613e566edafefb177b89
Reviewed-on: https://gerrit.instructure.com/42660
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <braden@instructure.com>
Product-Review: Braden Anderson <braden@instructure.com>
QA-Review: Braden Anderson <braden@instructure.com>
2014-10-14 20:47:42 +00:00
Jeremy Stanley 58fb282035 make 'development' features invisible in production
also remove the 'development' tag on existing features, other
than those that manually made themselves invisible in prod.
we'll let 'beta' suffice for the purpose of informing the user
that a feature is not fully baked.

test plan:
  - Deploy normally to your QA portal.  The 'quiz stats'
    feature flag should be available and operational.
  - Remove the testcluster.yml file from your config/
    directory (or move / back it up to a safe place)
  - Restart your QA portal.
  - The quiz stats feature flag should not be available
    or visible.

fixes CNVS-15724

Change-Id: I9e4e46f8cc4f54ac62f5226dbca09ae4885c93a9
Reviewed-on: https://gerrit.instructure.com/41551
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2014-09-25 14:47:10 +00:00
Jeremy Stanley cc4f0925ef remove "Allowed" state for RootAccount features on root accounts
the "Allowed" state means a feature is off in an account, but
sub-accounts or courses below it are allowed to enable it.

the 'allowed' state does not, however, make a lot of sense for
features that apply to RootAccount. since the feature cannot
be controlled in sub-accounts or courses, the 'allowed' state
is equivalent to 'off' here.

so to make this less confusing, remove the "allowed" state
for RootAccount features.

(specifically, lock the transition in the API, and make the
UI hide buttons for locked transitions that don't have
messages to display when the user tries to perform them)

test plan:
 - set the Use New Styles feature to "Allowed" in Site Admin
   account settings
 - in a root account settings page, ensure the 'Allowed'
   option is not selectable for this feature
 - ensure that the API reports the new_styles feature is "off"
   and its "allowed" transition is locked
   i.e., GET /api/v1/accounts/1/features/flags/new_styles
   includes state: 'off' and transitions: {allowed: {locked: true}}
 - ensure the API refuses to set the new_styles feature to "allowed"
   in the root account
   i.e., PUT /api/v1/accounts/1/features/flags/new_styles?state=allowed
   should return a 403 error and not change the state
 - regression test: in a sub-account, ensure the 'Use New Styles'
   feature does not appear
 - regression test: verify that when a (non-site-admin)
   root account admin attempts to disable Draft State in
   an account, the Off button is still there, and a message appears
   when you click it, and the feature remains enabled

fixes CNVS-13220

Change-Id: I4d41076c10696b02d0c482a778d2555714487f17
Reviewed-on: https://gerrit.instructure.com/35473
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-05-30 19:56:24 +00:00
Jeremy Stanley 4e1641b833 customize feature flag state transitions for draft state
test plan:
0. render and consult the API documentation on feature flags,
   specifically looking at the 'transitions' member that
   was added to FeatureFlag
1. enable draft state in a course
2. use the API to show the draft state feature flag for the
   course (GET /courses/X/features/flags/draft_state)
   - verify that transitions['off'] contains a warning
     message about what happens to unpublished data
3. allow draft state in an account
4. as a non-site-admin user, use the API to show the
   draft state feature flag for the account
   (GET /accounts/X/features/flags/draft_state)
   - verify that transitions['on']['locked'] is false
   - verify that transitions['off']['locked'] is true
     and is accompanied by an explanatory message
5. attempt to turn the feature off via the API
   (still as a non-site-admin user)
   - you should get a 403 Forbidden error
6. repeat step 4 as a site-admin user
   - neither transition should be 'locked', but the
     message should still accompany 'off'
7. repeat step 5 as a site-admin user
   - it should succeed

fixes CNVS-10355
fixes CNVS-10356

Change-Id: I36b0d387ad09f98cdf3d4de9e4e351bfd6aa8c58
Reviewed-on: https://gerrit.instructure.com/28541
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-01-22 22:01:58 +00:00
Jeremy Stanley 0e075a24b4 feature flags infrastructure and API
test plan:
 - install the test_features plugin (since no real features exist yet)
 - render and consult the feature flags documentation
 - have a test environment with a root account,
   sub-account, course in sub-account, and user

 - Use the "list features" endpoint as a root account admin
   (with no site admin privileges), on the root account context, and
   confirm that hidden features do not show up
 - Use the "list features" endpoint as a site admin user,
   on the root account context, and confirm that hidden features
   show up
 - Use the "list features" endpoint on the site admin account
   and confirm the hidden features show up

 - Use the "set feature flag" endpoint on a hidden feature on site
   admin and ensure the feature becomes visible in all root accounts
 - Use the "set feature flag endpoint" on a hidden feature on a
   single root account, and ensure the feature becomes visible to
   that root account and not others

 - Confirm that root_opt_in features appear "Off" by default
   in root accounts, after being "Allowed" in code or site admin

 - Confirm a feature flag that is set to "on" or "off" (vs. "allowed")
   cannot be overridden in a lower context (and the API returns
   locked=true for them)

 - Confirm that setting locking_account_id requires admin rights
   in the locking account
 - Confirm that a feature flag with locking_account_id cannot be
   changed without admin rights in the locking account (e.g.,
   set a feature flag on a course, locked with the root account's id,
   and make sure a teacher who is not an account admin can't change it)

 - Confirm feature flags can be deleted with the "remove feature flag"
   endpoint (and they are only deleted where they are defined, not
   when called on an object that inherits a flag)

Change-Id: I3e12e23b4454889b6e8b263f1315e82d8f2ada52
Reviewed-on: https://gerrit.instructure.com/25502
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-11-19 20:50:03 +00:00