Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add an admin API endpoint to support per-user feature flags #15344

Merged
merged 29 commits into from
Apr 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5a1f946
add an experimental features table and a class to access it
H-Shay Mar 28, 2023
ec04542
add an admin endpoint and handler class to access table
H-Shay Mar 28, 2023
0841f79
add some tests of basic functionality
H-Shay Mar 28, 2023
28f835a
newsframent
H-Shay Mar 28, 2023
1b68698
Merge branch 'develop' into shay/experimental_flags
H-Shay Mar 28, 2023
daf8a9f
fix schema delta
H-Shay Mar 28, 2023
dc6207a
fix bad import (thanks pycharm)
H-Shay Mar 28, 2023
845c07e
drop unnecessary handler class and user enum for verification
H-Shay Mar 28, 2023
c999fea
rewrite table
H-Shay Apr 4, 2023
5c9c4b7
allow for bulk setting/getting of features, cache result of getting
H-Shay Apr 4, 2023
6280124
update tests
H-Shay Apr 4, 2023
d3f7032
Merge branch 'develop' into shay/experimental_flags
H-Shay Apr 4, 2023
aa74c4a
update schema
H-Shay Apr 4, 2023
985eba9
Merge branch 'develop' into shay/experimental_flags
H-Shay Apr 17, 2023
2c1191d
update comments and schema number
H-Shay Apr 17, 2023
4847df7
add new boolean column to `port_db` script and capitalize FALSE
H-Shay Apr 20, 2023
1ca2989
properly handle boolean column in sqlite
H-Shay Apr 20, 2023
e86e39c
it's postgres, not postgre
H-Shay Apr 21, 2023
fadb5e6
make PUT and GET more symmetrical for ease of use
H-Shay Apr 21, 2023
0496d1d
Update docs/admin_api/experimental_features.md
H-Shay Apr 24, 2023
2044c14
update docs
H-Shay Apr 24, 2023
dcc9c41
fix the urls
H-Shay Apr 26, 2023
37e7f30
get rid of sqlite-specific table
H-Shay Apr 26, 2023
401cb10
schema version is now 75 so move file
H-Shay Apr 26, 2023
8927eae
Apply suggestions from code review
H-Shay Apr 28, 2023
17e48be
Merge branch 'develop' into shay/experimental_flags
H-Shay Apr 28, 2023
427d65f
fix schema drift
H-Shay Apr 28, 2023
80d3f69
Merge branch 'shay/experimental_flags' of https://github.com/matrix-o…
H-Shay Apr 28, 2023
6a994dd
update test to accompdate new error message
H-Shay Apr 28, 2023
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
properly handle boolean column in sqlite
  • Loading branch information
H-Shay committed Apr 20, 2023
commit 1ca2989f2ed367865fcd1715a26baf62da351c65
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Copyright 2023 The Matrix.org Foundation C.I.C
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

-- Table containing experimental features and whether they are enabled for a given user
CREATE TABLE per_user_experimental_features (
-- The User ID to check/set the feature for
user_id TEXT NOT NULL,
-- Contains features to be enabled/disabled
feature TEXT NOT NULL,
-- whether the feature is enabled/disabled for a given user, defaults to disabled
enabled BOOLEAN DEFAULT 0,
H-Shay marked this conversation as resolved.
Show resolved Hide resolved
FOREIGN KEY (user_id) REFERENCES users(name),
PRIMARY KEY (user_id, feature)
);