-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
File tree diff: migrate feature flag to model field #11793
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4827478
File tree diff: migrate feature flag to model field
humitos a4bdf67
Update migration
humitos 7de7658
Update tests
humitos c4d822f
Update tests
humitos 0e5ce09
Merge branch 'main' into humitos/featureflag-to-field
humitos e5a50bf
Addons: base version to compare against (DocDiff and File Tree Diff) …
humitos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
readthedocs/projects/migrations/0139_addons_filetreediff_field.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Generated by Django 4.2.16 on 2024-11-25 11:57 | ||
|
||
from django.db import migrations, models | ||
from django_safemigrate import Safe | ||
|
||
|
||
def forwards_func(apps, schema_editor): | ||
""" | ||
Enable FileTreeDiff on those projects with the feature flag enabled. | ||
""" | ||
Feature = apps.get_model("projects", "Feature") | ||
feature = Feature.objects.filter(feature_id="generate_manifest_for_file_tree_diff").first() | ||
if feature: | ||
for project in feature.projects.all().iterator(): | ||
project.addons.filetreediff_enabled = True | ||
project.addons.save() | ||
|
||
class Migration(migrations.Migration): | ||
safe = Safe.before_deploy | ||
|
||
dependencies = [ | ||
('projects', '0138_remove_old_fields'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='addonsconfig', | ||
name='filetreediff_enabled', | ||
field=models.BooleanField(blank=True, default=False, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='historicaladdonsconfig', | ||
name='filetreediff_enabled', | ||
field=models.BooleanField(blank=True, default=False, null=True), | ||
), | ||
migrations.RunPython(forwards_func), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we probably want to discuss the branding here before we bake it into the models. I feel like
File Tree Diff
is a weird name, and we probably want something a bit more user friendly.I know we talked about
Files changed
being joint branding for docdiff & FTD, but I'm open to other ideas. We could always just haveFiles changed
be a top-level concept for a workflow that includes docdiff and filetreediff?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the "generic name"
Files changed
to involve both features: docdiff and file tree diff. Due to each addon being very specific (but related, tho), I'm not able to find better names for each of them. Both names are not ideal for marketing purposes; but are pretty descriptive of what they are... for a developer at least 😅I think it's hard to explain what they do in a simple and nice name:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agjohnson @stsewd do you have any idea/suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation diff
/DocDiff
is also something we could use as overarching branding if we wanted, and is at least "brandable".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've also been advocating for not using
file tree diff
to describe this addon or the feature. I think it makes the most sense for both of these features, and the addons and UI, to be combined.Files changed
at least describes the addon now. I don't feel it makes sense as a standalone addon that users can configure though.Before we ship this, it feels like these should be a single, unified addon/feature. I don't particular like
DocDiff
for this.Diff view
is short and clear,Documentation diff
works too. Something closer to that works best I think.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use
visualdiff
for docdiff andfileschanged
for filetreediff. Those names are pretty explicit about what they are and I think they work well for marketing as well. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He, we are already using Visual Diff in the new dashboard actually:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think visual diff covers both well, I don't see a long term reason to use two names/addons/UIs.
Short term, I don't have opinions about not using
filechanged
but I would not surface this name in configuration/UI/marketing either. It should just be a single feature.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I will keep
docdiff
andfiletreediff
for the models and code names because we are already using those names in our code. When we expose this to users, I suppose we will use "Visual diff" as we are already doing, and maybe "Files changed" if we have 2 different features.I don't want to rename the model fields to use
fileschanged
if we are already usingfiletreediff
for the API response, for the function that calculate the diff, etc. It will just add more confusion to the code.I'm happy to rename the code methods, functions, model fields, if we finally find a name that we like and we are convinced about 😄