Skip to content

Commit b00dc03

Browse files
authored
GH Issue 1341 & 1493: Remove "Allow RowId to be accepted when merging" and "Use row-by-row update" experimental flags (#8162)
1 parent eaa3ae9 commit b00dc03

9 files changed

Lines changed: 3 additions & 34 deletions

File tree

‎api/src/org/labkey/api/exp/api/ExperimentService.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ public interface ExperimentService extends ExperimentRunTypeSource
131131

132132
String EXPERIMENTAL_FEATURE_FROM_EXPANCESTORS = "org.labkey.api.exp.api.ExperimentService#FROM_EXPANCESTORS";
133133

134-
String EXPERIMENTAL_FEATURE_ALLOW_ROW_ID_MERGE = "org.labkey.experiment.api.SampleTypeUpdateServiceDI#ALLOW_ROW_ID_SAMPLE_MERGE";
135-
136134
int SIMPLE_PROTOCOL_FIRST_STEP_SEQUENCE = 1;
137135
int SIMPLE_PROTOCOL_CORE_STEP_SEQUENCE = 10;
138136
int SIMPLE_PROTOCOL_EXTRA_STEP_SEQUENCE = 15;

‎api/src/org/labkey/api/query/QueryService.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public interface QueryService
7575
String MAX_QUERY_SELECTION = "maxQuerySelection";
7676
String PRODUCT_FOLDERS_ENABLED = "isProductFoldersEnabled";
7777
String PRODUCT_FOLDERS_EXIST = "hasProductFolders";
78-
String USE_ROW_BY_ROW_UPDATE = "useLegacyUpdateRows";
7978

8079
String MODULE_QUERIES_DIRECTORY = "queries";
8180
Path MODULE_QUERIES_PATH = Path.parse(MODULE_QUERIES_DIRECTORY);

‎api/src/org/labkey/api/query/SimpleQueryUpdateService.java‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
import java.util.Map;
5454
import java.util.function.Supplier;
5555

56-
import static org.junit.Assume.assumeFalse;
57-
import static org.labkey.api.query.QueryService.USE_ROW_BY_ROW_UPDATE;
5856
import static org.labkey.api.query.QueryUpdateService.ConfigParameters.PreferPKOverObjectUriAsKey;
5957

6058
/**
@@ -107,9 +105,6 @@ private boolean shouldUpdateUsingDIB(Container container, List<Map<String, Objec
107105
if (oldKeys != null) // could be called by updateChangingKeys
108106
return false;
109107

110-
if (OptionalFeatureService.get().isFeatureEnabled(USE_ROW_BY_ROW_UPDATE))
111-
return false;
112-
113108
if (!supportUpdateUsingDIB())
114109
return false;
115110

@@ -329,7 +324,6 @@ private static Map<String, Object> row(String text, int intNotNull)
329324
@Test
330325
public void testAfterInsertUpdateFiresOnce() throws Exception
331326
{
332-
assumeFalse("Row-by-row update bypasses the DIB update path", OptionalFeatureService.get().isFeatureEnabled(USE_ROW_BY_ROW_UPDATE));
333327
CountingUpdateService qus = createService();
334328

335329
BatchValidationException errors = new BatchValidationException();

‎experiment/src/client/test/integration/SampleTypeCrud.ispec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ describe('Amount/Unit CRUD', () => {
11841184
errorMsg = await ExperimentCRUDUtils.importSample(server, "Name\tStoredAmount\tUnits\n" + dataName + "\t-1.1\tkg", dataType, "MERGE", topFolderOptions, editorUserOptions);
11851185
expect(errorMsg.text).toContain(NEGATIVE_ERROR);
11861186

1187-
// Using row-by-row
1187+
// Using partitioned data iterator
11881188
await server.post('query', 'updateRows', {
11891189
schemaName: 'samples',
11901190
queryName: dataType,

‎experiment/src/org/labkey/experiment/ExperimentModule.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ protected void init()
276276
"If a column name contains a \"__<unit>\" suffix, this feature allows for testing it as a Quantity display column", false);
277277
OptionalFeatureService.get().addExperimentalFeatureFlag(ExperimentService.EXPERIMENTAL_FEATURE_FROM_EXPANCESTORS, "SQL syntax: 'FROM EXPANCESTORS()'",
278278
"Support for querying lineage of experiment objects", false, true);
279-
OptionalFeatureService.get().addExperimentalFeatureFlag(ExperimentService.EXPERIMENTAL_FEATURE_ALLOW_ROW_ID_MERGE, "Allow RowId to be accepted when merging samples or data class data",
280-
"If the incoming data includes a RowId column we will allow the column but ignore it's values.", false, true);
281279

282280
RoleManager.registerPermission(new DesignVocabularyPermission(), true);
283281
RoleManager.registerRole(new SampleTypeDesignerRole());

‎experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
import org.labkey.api.security.permissions.Permission;
114114
import org.labkey.api.security.permissions.ReadPermission;
115115
import org.labkey.api.security.permissions.UpdatePermission;
116-
import org.labkey.api.settings.OptionalFeatureService;
117116
import org.labkey.api.study.assay.FileLinkDisplayColumn;
118117
import org.labkey.api.usageMetrics.SimpleMetricsService;
119118
import org.labkey.api.util.CachingSupplier;
@@ -1027,9 +1026,7 @@ else if (isReservedHeader(name))
10271026
if (isUpdate)
10281027
continue;
10291028

1030-
// While accepting RowId during merge is not our preferred behavior, we want to give users a way
1031-
// to opt-in to the old behavior where RowId is accepted and ignored.
1032-
if (isMerge && !OptionalFeatureService.get().isFeatureEnabled(ExperimentService.EXPERIMENTAL_FEATURE_ALLOW_ROW_ID_MERGE))
1029+
if (isMerge)
10331030
{
10341031
context.getErrors().addRowError(new ValidationException("RowId is not accepted when merging data. Specify only the data name instead.", Column.RowId.name()));
10351032
return null;

‎experiment/src/org/labkey/experiment/api/ImportAbortResourceTestCase.java‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.labkey.api.dataiterator.MapDataIterator;
3030
import org.labkey.api.dataiterator.WrapperDataIterator;
3131
import org.labkey.api.exp.api.ExpSampleType;
32-
import org.labkey.api.exp.api.ExperimentService;
3332
import org.labkey.api.exp.api.SampleTypeService;
3433
import org.labkey.api.exp.query.ExpSchema;
3534
import org.labkey.api.exp.query.SamplesSchema;
@@ -38,7 +37,6 @@
3837
import org.labkey.api.query.QueryUpdateService;
3938
import org.labkey.api.query.QueryUpdateService.InsertOption;
4039
import org.labkey.api.security.User;
41-
import org.labkey.api.settings.OptionalFeatureService;
4240
import org.labkey.api.util.JunitUtil;
4341
import org.labkey.api.util.TestContext;
4442
import org.labkey.experiment.ExpDataIterators;
@@ -59,26 +57,18 @@ public class ImportAbortResourceTestCase extends Assert
5957
{
6058
private static Container _c;
6159
private static User _user;
62-
private static boolean _restoreAllowRowIdMerge;
6360

6461
@BeforeClass
6562
public static void setUp()
6663
{
6764
JunitUtil.deleteTestContainer();
6865
_c = JunitUtil.getTestContainer();
6966
_user = TestContext.get().getUser();
70-
71-
// These tests drive the RowId-on-merge rejection, so the server-wide opt-out must be off.
72-
_restoreAllowRowIdMerge = OptionalFeatureService.get().isFeatureEnabled(ExperimentService.EXPERIMENTAL_FEATURE_ALLOW_ROW_ID_MERGE);
73-
if (_restoreAllowRowIdMerge)
74-
OptionalFeatureService.get().setFeatureEnabled(ExperimentService.EXPERIMENTAL_FEATURE_ALLOW_ROW_ID_MERGE, false, _user);
7567
}
7668

7769
@AfterClass
7870
public static void tearDown()
7971
{
80-
if (_restoreAllowRowIdMerge)
81-
OptionalFeatureService.get().setFeatureEnabled(ExperimentService.EXPERIMENTAL_FEATURE_ALLOW_ROW_ID_MERGE, true, _user);
8272
JunitUtil.deleteTestContainer();
8373
}
8474

‎experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
import org.labkey.api.security.permissions.MoveEntitiesPermission;
104104
import org.labkey.api.security.permissions.ReadPermission;
105105
import org.labkey.api.security.roles.ReaderRole;
106-
import org.labkey.api.settings.OptionalFeatureService;
107106
import org.labkey.api.study.publish.StudyPublishService;
108107
import org.labkey.api.usageMetrics.SimpleMetricsService;
109108
import org.labkey.api.util.GUID;
@@ -1332,9 +1331,7 @@ private DataIterator build(DataIterator di, DataIteratorContext context)
13321331
if (isUpdate)
13331332
continue;
13341333

1335-
// While accepting RowId during merge is not our preferred behavior, we want to give users a way
1336-
// to opt-in to the old behavior where RowId is accepted and ignored.
1337-
if (isMerge && !OptionalFeatureService.get().isFeatureEnabled(ExperimentService.EXPERIMENTAL_FEATURE_ALLOW_ROW_ID_MERGE))
1334+
if (isMerge)
13381335
{
13391336
context.getErrors().addRowError(new ValidationException("RowId is not accepted when merging samples. Specify only the sample name instead.", RowId.name()));
13401337
return null;

‎query/src/org/labkey/query/QueryModule.java‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@
147147
import java.util.Set;
148148
import java.util.function.Supplier;
149149

150-
import static org.labkey.api.query.QueryService.USE_ROW_BY_ROW_UPDATE;
151-
152150
public class QueryModule extends DefaultModule
153151
{
154152
public QueryModule()
@@ -237,8 +235,6 @@ public QuerySchema createSchema(DefaultSchema schema, Module module)
237235
DataViewService.get().registerProvider(QueryDataViewProvider.TYPE, new QueryDataViewProvider());
238236
DataViewService.get().registerProvider(InheritedQueryDataViewProvider.TYPE, new InheritedQueryDataViewProvider());
239237

240-
OptionalFeatureService.get().addExperimentalFeatureFlag(USE_ROW_BY_ROW_UPDATE, "Use row-by-row update",
241-
"For Query.updateRows api, do row-by-row update, instead of using a prepared statement that updates rows in batches.", false);
242238
OptionalFeatureService.get().addExperimentalFeatureFlag(QueryServiceImpl.EXPERIMENTAL_PRODUCT_ALL_FOLDER_LOOKUPS, "Less restrictive product folder lookups",
243239
"Allow for lookup fields in product folders to query across all folders within the top-level folder.", false);
244240
OptionalFeatureService.get().addExperimentalFeatureFlag(QueryServiceImpl.EXPERIMENTAL_PRODUCT_PROJECT_DATA_LISTING_SCOPED, "Product folders display folder-specific data",

0 commit comments

Comments
 (0)