-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[BD-21] Document feature toggles #24815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BD-21] Document feature toggles #24815
Conversation
|
Thanks for the pull request, @regisb! I've created BLENDED-554 to keep track of it in Jira. More details are on the BD-21 project page. When this pull request is ready, tag your edX technical lead. |
|
@regisb: Some quick comments:
Other thoughts:
|
""" annotations allow for multi-line comments, but single-line annotations (prefixed by #) don't. I prefer to use multi-line comments as an incentive to write longer descriptions. EDIT: turns out that multi-line comments are not supported when added right in the middle of dict entries, so we'll have to revert to long, single-line comments.
Right. When commenting existing feature toggles, I have no way of discovering for what use case they were designed, so I'll just set this field to "open edx".
Sounds reasonable.
I am working on a code-annotations pull request that uses the toggle_warnings field to add a "warning" field to the generated docs. It's a fairly simple change and the visual impact is quite good (IMHO):
Sure. @nasthagiri are you open to modifications of the current feature toggle annotation schema? If yes, could we schedule a conversation with the product owners? |
|
It's difficult. In code-annotations, single line annotations are parsed line-by-line: https://github.com/edx/code-annotations/blob/97cd3397c29a492929fb8902eec40400206253b7/code_annotations/extensions/base.py#L60 |
|
b0fe52e to
9e2cf7d
Compare
|
@regisb and @robrap Yes, I am open to modifications to the current scheme definition. Please write up your proposal for the change, to give me an idea of what you are thinking. The proposal could be a PR to amend the OEP. If you'd like set up a 15-30mn meeting to hash it out, you can do so at https://calendly.com/nasthagiri Thanks! |
I'll repost what I just wrote on Slack: https://app.slack.com/client/T02SNA1T6/threads/thread/C015XNCQDDG-1597777765.002700 Thus, my PR on OEP 17 would get rid of the |
|
@regisb I spoke to @robrap about this today.
Also, to give you an idea of the "expected timelines" for the different use cases, here's what I had sent to @elhoyos several months ago:
|
41a744d to
f7fd5d7
Compare
👌
Should Unfortunately there is currently no mechanism to enforce the presence of a field conditionally on another: https://code-annotations.readthedocs.io/en/latest/configuration.html |
Yes. Either an ADR or update the OEP if the OEP itself is now invalid.
I'd like to require
When would this issue be detected? Do we generate the doc within the CI process of the PR that introduced the toggle? Or would this be in a separate CI process? I ask since I'm wondering how tight the feedback loop would be for the developers to correct their toggle annotations. |
If we want to have a very short feedback loop, I can write an ad-hoc linting script that will check the generated yaml feature toggle report. This script could even be moved to a dedicated unit test. But running this script/test would have to be done separately for each repository, assuming we add feature toggles to different repos. The alternative is that issues would only be detected once a human looks at the generated docs. |
|
@regisb @nasthagiri: Some additional thoughts: First, let me summarize what I think is temporary vs permanent based on the Temporary:
(Semi-)Permanent:
Also, based on reading the docs, I'd like to propose the following: Proposed Renames:
I don't think
Note: the second and third options don't require separate linting to ensure permanent use cases are added, and don't require a I'd vote for option 2, as long as our how_to documentation helps keep this simple. Otherwise, option 3 keeps the options simplest. Also, for all options above, we could consider adding a prefix to the use cases, like Additionally, we should make the following documentation updates:
|
|
+1 to all of the above remarks. |
|
@regisb: Do you feel comfortable starting a |
Sure. I'll open the following PRs:
|
|
@robrap I like your option 3:
The reason why I like this approach is that:
If we go with this approach, I'd suggest getting rid of the Sorry if my explanations are confusing -- maybe we can schedule a call to clarify things? |
This takes advantage of the new multiline annotation format with single-line comment prefix, from code-annotations.
Since code-annotations==0.7.0, this annotation is not used anymore.
Since code-annotations==0.7.0, incremental_release, launch_date, monitored_rollout, graceful_degradation, beta_testing are all considered as "temporary" use cases.
This annotation is deprecated since code-annotations==0.7.0
This is part of the changes brought by code-annotations==0.7.0
c8f77ca to
a4ba4ae
Compare
|
@feanil I rebased and removed the "WIP" label -- as far as I'm concerned, this is ready to merge. |
|
Your PR has finished running tests. There were no failures. |
|
PR for the flaky python test is here: https://github.com/edx/edx-platform/pull/25009 |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |

In this PR, I progressively document feature toggles one application at a time, starting at the top of a list of high-priority applications.
To detect feature toggles, I grep the application code as follows:
Although I generally have not too much trouble figuring out how feature flags are used, there are some annotation fields for which I do not quite understand how they should be used:
.. toggle_use_cases: should be one or more of incremental_release, launch_date, monitored_rollout, graceful_degradation, beta_testing, vip, opt_out, opt_in, open_edx. I have no idea what these values mean, so I just blindly set this annotation to "open_edx"... toggle_category: what should we use for this field? Should this be the name of the django app in which the feature toggle is defined (this is what I have done until now).cc @robrap: no need for a thorough review right now. Maybe just check that I'm headed in the right direction?I'll list here remaining questions I have about the feature toggles:
videos.enable_devstack_video_uploads: I did not quite understand the point of this feature toggle. My interpretation is that short-lived authentication tokens are better suited for the devstack, but I have trouble understanding why.lms/djangoapps/grades/config/waffle.py: what are the use cases for these flags? (see this comment)