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
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package io.stargate.sgv2.jsonapi.config.feature;

import io.smallrye.config.ConfigMapping;
import java.util.Map;

/** Configuration mapping for Data API Feature flags. */
@ConfigMapping(prefix = "stargate.feature")
public interface DataApiFeatureConfig {
tatu-at-datastax marked this conversation as resolved.
Show resolved Hide resolved
Map<DataApiFeatureFlag, Boolean> flags();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.stargate.sgv2.jsonapi.config.feature;

public enum DataApiFeatureFlag {
TABLES("tables");

private final String featureName;

DataApiFeatureFlag(String featureName) {
this.featureName = featureName;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider forcing lcase here, because the feature name is used raw in the header name and other places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add validation.

}

public String featureName() {
return featureName;
}
}
4 changes: 4 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ stargate:
exception-mappers:
enabled: false

feature:
flags:
TABLES: null
amorton marked this conversation as resolved.
Show resolved Hide resolved

# custom grpc settings
grpc:

Expand Down