Skip to content
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

Fix #1335: add general-purpose Feature flag system #1390

Merged
merged 20 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
975bdc0
Fix #1355: add general-purpose Feature flag system
tatu-at-datastax Sep 4, 2024
15d73d5
Remove Tables-enabled check from NamespaceCache, cannot override on p…
tatu-at-datastax Sep 4, 2024
2674491
Fix unit test wrt now passing access to table schema info
tatu-at-datastax Sep 4, 2024
ba97987
Re-wire enable-tables, temporarily
tatu-at-datastax Sep 4, 2024
4cd7526
Add sysprop for ITs to enable Tables feature
tatu-at-datastax Sep 4, 2024
68a3cfb
Incremental progress...
tatu-at-datastax Sep 4, 2024
a4b10e1
Wire DataApiFeatures in CommandContext for better access
tatu-at-datastax Sep 4, 2024
7a5278c
Complete initial implementation: things now seem to work as designed
tatu-at-datastax Sep 5, 2024
594ebb4
Comment fixes
tatu-at-datastax Sep 5, 2024
4e0fad7
Change API Feature flags to use lower-case names in all config (but U…
tatu-at-datastax Sep 5, 2024
f7920f3
Renaming from code review
tatu-at-datastax Sep 5, 2024
b68176f
More changes from code review
tatu-at-datastax Sep 5, 2024
c3b6032
Merge branch 'main' into tatu/1335-feature-flags
tatu-at-datastax Sep 6, 2024
26ceefa
...
tatu-at-datastax Sep 6, 2024
fa09a86
Fix CreateTableIntegrationTest
tatu-at-datastax Sep 6, 2024
f378b9a
Add an IT to verify blocking of CreateTable if feature flag not enabled
tatu-at-datastax Sep 6, 2024
bb355c7
Complete IT to verify `ApiFeature.TABLES` functioning, header override
tatu-at-datastax Sep 7, 2024
e318d5a
Final touches wrt naming
tatu-at-datastax Sep 7, 2024
be9acd7
Further improve docs (comment)
tatu-at-datastax Sep 7, 2024
7ca1f3e
Last changes from code review
tatu-at-datastax Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add sysprop for ITs to enable Tables feature
  • Loading branch information
tatu-at-datastax committed Sep 4, 2024
commit 4cd752615d4f7e2667362b852dadd623c13bc972
Original file line number Diff line number Diff line change
@@ -107,6 +107,14 @@ public Uni<RestResponse<CommandResult>> postCommand(
@Size(min = 1, max = 48)
String namespace) {

// create context
// TODO: Aaron , left here to see what CTOR was used, there was a lot of different ones.
// CommandContext commandContext = new CommandContext(namespace, null);
// HACK TODO: The above did not set a command name on the command context, how did that work ?
CommandContext<KeyspaceSchemaObject> commandContext =
new CommandContext<>(new KeyspaceSchemaObject(namespace), null, "", null);

// Need context first to check if feature is enabled
if (command instanceof TableOnlyCommand
&& !apiFeatureConfig.isFeatureEnabled(DataApiFeatureFlag.TABLES)) {
return Uni.createFrom()
@@ -116,14 +124,7 @@ public Uni<RestResponse<CommandResult>> postCommand(
.map(commandResult -> commandResult.map());
}

// create context
// TODO: Aaron , left here to see what CTOR was used, there was a lot of different ones.
// CommandContext commandContext = new CommandContext(namespace, null);
// HACK TODO: The above did not set a command name on the command context, how did that work ?
CommandContext<KeyspaceSchemaObject> commandContext =
new CommandContext<>(new KeyspaceSchemaObject(namespace), null, "", null);

// call processor
// call processor
return meteredCommandProcessor
.processCommand(dataApiRequestInfo, commandContext, command)
// map to 2xx unless overridden by error
Original file line number Diff line number Diff line change
@@ -71,7 +71,11 @@ public Map<String, String> start() {
ImmutableMap.Builder<String, String> propsBuilder = ImmutableMap.builder();
propsBuilder.putAll(env);
propsBuilder.put("stargate.jsonapi.custom.embedding.enabled", "true");
propsBuilder.put("stargate.tables.enabled", "true");

// 04-Sep-2024, tatu: [data-api#1335] Enable Tables using new Feature Flag:
// propsBuilder.put("stargate.tables.enabled", "true");
propsBuilder.put("stargate.feature.flags.TABLES", "true");

propsBuilder.put(
"stargate.jsonapi.custom.embedding.clazz",
"io.stargate.sgv2.jsonapi.service.embedding.operation.test.CustomITEmbeddingProvider");