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

New feature flags backend (part 2) #818

Merged
merged 15 commits into from
Aug 8, 2019
Merged

Conversation

fisx
Copy link
Contributor

@fisx fisx commented Aug 7, 2019

Replaces #817 (which was broken by github).

migration plan

  • merge New feature flags backend #813.
    • this will create the new team_features table, but not use it for legalhold.
    • all teams with sso configured will continue working normally, but report as "sso disabled". (weird, yes. sorry.)
  • migrate data:
    • for every team that has an idp, set the "sso enabled" flag in galley, in the new table.
    • we'll let legalhold break on all existing teams that have it enabled (not newly created ones).
  • merge [WIP] New feature flags backend (part 2) #817
    • switch legalhold feature flag lookup and update from old to new table.
    • this also breaks legalhold.
  • yet another PR:
    • this will remove the old legalhold feature flag table.

tasks

  • make "put /i/sso-disabled" fail with an explanation why implementing this is hard.
  • write (and run) migration script for SSO flag. (frontend depends on this to be sound.)

@fisx fisx changed the title New feature flags backend (part 2) [WIP] New feature flags backend (part 2) Aug 7, 2019
@fisx fisx changed the title [WIP] New feature flags backend (part 2) New feature flags backend (part 2) Aug 7, 2019
@fisx fisx force-pushed the new-feature-flags-backend-part-2 branch from 5168f55 to 875d833 Compare August 7, 2019 21:03
@fisx fisx force-pushed the new-feature-flags-backend-part-2 branch from 8060f18 to fe72331 Compare August 8, 2019 11:13
Copy link
Contributor

@tiago-loureiro tiago-loureiro left a comment

Choose a reason for hiding this comment

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

Small nitpicks, check mainly the comments/thoughts on adding the migration on this PR.

@fisx
Copy link
Contributor Author

fisx commented Aug 8, 2019

Migration works. I will push another commit soon that irons out a few wrinkles. Here is the log from staging:

spar> select team, idp from spar.idp where team=cf0e5a44-257a-4640-ae3a-b0e9e4fe24e3 allow filtering;

 team                                 | idp
--------------------------------------+--------------------------------------
 cf0e5a44-257a-4640-ae3a-b0e9e4fe24e3 | e64ed7f7-8814-4155-ac83-d3b07f947401
galley> select * from galley.team_features where team_id=cf0e5a44-257a-4640-ae3a-b0e9e4fe24e3 ;

 team_id                              | legalhold_status | sso_status
--------------------------------------+------------------+------------
 cf0e5a44-257a-4640-ae3a-b0e9e4fe24e3 |             null |          0
export GALLEY_HOST=...
export GALLEY_KEYSPACE=...
export SPAR_HOST=...
export SPAR_KEYSPACE=...

ssh -v -f ubuntu@${GALLEY_HOST} -L 2021:${GALLEY_HOST}:9042 -N
ssh -v -f ubuntu@${SPAR_HOST} -L 2022:${SPAR_HOST}:9042 -N

./dist/migrate-sso-feature-flag --cassandra-host-galley=localhost --cassandra-port-galley=2021 --cassandra-keyspace-galley=${GALLEY_KEYSPACE} --cassandra-host-spar=localhost --cassandra-port-spar=2022 --cassandra-keyspace-spar=${SPAR_KEYSPACE}
D, Connecting to ::1:2022
I, New control connection: eu-west:1a:::1:2022#12
D, Connecting to ::1:2021
::1 port 41206 to ::1 port 2021, nchannels 4
D, Connection established: eu-west:1a:::1:2022#14
D, Connection established: eu-west:1a:::1:2022#17
I, convs=10
D, Connection established: eu-west:1a:::1:2021#15
I, convs=20
I, convs=30
I, convs=40
I, convs=50
[...]
I, convs=3570
I, convs=3580
I, convs=3590
I, convs=3600
I, convs=3610
I, convs=3620
I, convs=3630
I, convs=3640
I, convs=3650
I, convs=3660
I, convs=3670
I, convs=3680
I, convs=3690
I, convs=3700
I, convs=3710
I, convs=3720

$ echo $?
0
galley> select * from galley.team_features where team_id=cf0e5a44-257a-4640-ae3a-b0e9e4fe24e3 ;

 team_id                              | legalhold_status | sso_status
--------------------------------------+------------------+------------
 cf0e5a44-257a-4640-ae3a-b0e9e4fe24e3 |             null |          1

@fisx fisx merged commit bce219d into develop Aug 8, 2019
@fisx fisx deleted the new-feature-flags-backend-part-2 branch August 8, 2019 14:54
@fisx fisx mentioned this pull request Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants