Remove ML_SUGGESTED_EDIT_V2 flag
It's already rollout to 100% for several months.
Release-Notes: skip
Change-Id: Ib230af695a8906036cc0c7c187703a5b58a4f97b
diff --git a/polygerrit-ui/app/elements/settings/gr-preferences/gr-preferences.ts b/polygerrit-ui/app/elements/settings/gr-preferences/gr-preferences.ts
index c97a036..a65c8a4 100644
--- a/polygerrit-ui/app/elements/settings/gr-preferences/gr-preferences.ts
+++ b/polygerrit-ui/app/elements/settings/gr-preferences/gr-preferences.ts
@@ -124,15 +124,13 @@
() => this.getConfigModel().docsBaseUrl$,
docsBaseUrl => (this.docsBaseUrl = docsBaseUrl)
);
- if (this.flagsService.isEnabled(KnownExperimentId.ML_SUGGESTED_EDIT_V2)) {
- subscribe(
- this,
- () => this.getPluginLoader().pluginsModel.suggestionsPlugins$,
- // We currently support results from only 1 provider.
- suggestionsPlugins =>
- (this.suggestionsProvider = suggestionsPlugins?.[0]?.provider)
- );
- }
+ subscribe(
+ this,
+ () => this.getPluginLoader().pluginsModel.suggestionsPlugins$,
+ // We currently support results from only 1 provider.
+ suggestionsPlugins =>
+ (this.suggestionsProvider = suggestionsPlugins?.[0]?.provider)
+ );
}
static override get styles() {
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
index b55c9fd..7a3b7ec 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
@@ -436,32 +436,29 @@
this.autocompleteComment();
}
);
- if (this.flagsService.isEnabled(KnownExperimentId.ML_SUGGESTED_EDIT_V2)) {
- subscribe(
- this,
- () =>
- this.generateSuggestionTrigger$.pipe(
- debounceTime(GENERATE_SUGGESTION_DEBOUNCE_DELAY_MS)
- ),
- () => {
- this.generateSuggestEdit();
+ subscribe(
+ this,
+ () =>
+ this.generateSuggestionTrigger$.pipe(
+ debounceTime(GENERATE_SUGGESTION_DEBOUNCE_DELAY_MS)
+ ),
+ () => {
+ this.generateSuggestEdit();
+ }
+ );
+ subscribe(
+ this,
+ () => this.getUserModel().preferences$,
+ prefs => {
+ this.autocompleteEnabled = !!prefs.allow_autocompleting_comments;
+ if (
+ this.generateSuggestion !==
+ !!prefs.allow_suggest_code_while_commenting
+ ) {
+ this.generateSuggestion = !!prefs.allow_suggest_code_while_commenting;
}
- );
- subscribe(
- this,
- () => this.getUserModel().preferences$,
- prefs => {
- this.autocompleteEnabled = !!prefs.allow_autocompleting_comments;
- if (
- this.generateSuggestion !==
- !!prefs.allow_suggest_code_while_commenting
- ) {
- this.generateSuggestion =
- !!prefs.allow_suggest_code_while_commenting;
- }
- }
- );
- }
+ }
+ );
}
override connectedCallback() {
@@ -1150,7 +1147,6 @@
// private but used in test
showGeneratedSuggestion() {
return (
- this.flagsService.isEnabled(KnownExperimentId.ML_SUGGESTED_EDIT_V2) &&
this.suggestionsProvider &&
this.editing &&
!this.permanentEditingMode &&
@@ -1224,14 +1220,8 @@
if (this.generateSuggestion) {
this.generateSuggestionTrigger$.next();
} else {
- if (
- this.flagsService.isEnabled(
- KnownExperimentId.ML_SUGGESTED_EDIT_V2
- )
- ) {
- this.generatedFixSuggestion = undefined;
- this.autoSaveTrigger$.next();
- }
+ this.generatedFixSuggestion = undefined;
+ this.autoSaveTrigger$.next();
}
this.reporting.reportInteraction(
this.generateSuggestion
@@ -1240,9 +1230,7 @@
);
}}
/>
- ${this.flagsService.isEnabled(KnownExperimentId.ML_SUGGESTED_EDIT_V2)
- ? 'Attach AI-suggested fix'
- : 'Generate Suggestion'}
+ Attach AI-suggested fix
${when(
this.suggestionLoading,
() => html`<span class="loadingSpin"></span>`,
@@ -1278,13 +1266,7 @@
}
}
- private generateSuggestEdit() {
- if (this.flagsService.isEnabled(KnownExperimentId.ML_SUGGESTED_EDIT_V2)) {
- this.generateSuggestEdit_v2();
- }
- }
-
- private async generateSuggestEdit_v2() {
+ private async generateSuggestEdit() {
const suggestionsProvider = this.suggestionsProvider;
const changeInfo = this.getChangeModel().getChange();
if (
@@ -1854,8 +1836,6 @@
}
getFixSuggestions(): FixSuggestionInfo[] | undefined {
- if (!this.flagsService.isEnabled(KnownExperimentId.ML_SUGGESTED_EDIT_V2))
- return undefined;
if (!this.generateSuggestion) return undefined;
if (!this.generatedFixSuggestion) return undefined;
// Disable fix suggestions when the comment already has a user suggestion
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.ts
index 7292c64..fe19d9b 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment_test.ts
@@ -48,7 +48,6 @@
CommentsModel,
commentsModelToken,
} from '../../../models/comments/comments-model';
-import {KnownExperimentId} from '../../../services/flags/flags';
import {GrSuggestionDiffPreview} from '../gr-suggestion-diff-preview/gr-suggestion-diff-preview';
suite('gr-comment tests', () => {
@@ -1005,11 +1004,6 @@
},
],
};
- setup(async () => {
- stubFlags('isEnabled')
- .withArgs(KnownExperimentId.ML_SUGGESTED_EDIT_V2)
- .returns(true);
- });
test('renders suggestions in comment', async () => {
const comment = {
diff --git a/polygerrit-ui/app/services/flags/flags.ts b/polygerrit-ui/app/services/flags/flags.ts
index 0bf3c97..750b421 100644
--- a/polygerrit-ui/app/services/flags/flags.ts
+++ b/polygerrit-ui/app/services/flags/flags.ts
@@ -19,7 +19,6 @@
CHECKS_DEVELOPER = 'UiFeature__checks_developer',
PUSH_NOTIFICATIONS_DEVELOPER = 'UiFeature__push_notifications_developer',
PUSH_NOTIFICATIONS = 'UiFeature__push_notifications',
- ML_SUGGESTED_EDIT_V2 = 'UiFeature__ml_suggested_edit_v2',
REVISION_PARENTS_DATA = 'UiFeature__revision_parents_data',
COMMENT_AUTOCOMPLETION = 'UiFeature__comment_autocompletion_enabled',
SAVE_PROJECT_CONFIG_FOR_REVIEW = 'UiFeature__save_project_config_for_review',