Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project overview
  • Repository
  • Issues 264
  • Merge Requests 29
  • CI / CD
  • Security & Compliance
  • Packages
  • Analytics
  • Wiki
  • Snippets
  • Members
  • Collapse sidebar
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Merge Requests
  • !452

Merged
Opened 6 days ago by Emiliano Balbuena@edgebal
Report abuse

Add environment support to Feature services

  • Overview 9
  • Commits 3
  • Pipelines 3
  • Changes 15
3/3 threads resolved

Summary

Add environment namespaces support to feature services

  • Closes #1335 (closed)

Setup

New schema:

CREATE TABLE minds.feature_toggles_cache_ns (
    environment text,
    feature_name text,
    data text,
    created_at timestamp,
    stale_at timestamp,
    PRIMARY KEY (environment, feature_name)
);

Updated CLI command:

php cli.php features sync --environment=production,canary,staging

Updated Forever runner:

php cli.php features sync --forever --environment=production,canary,staging

Steps to test

  • Get pods using kubectl get pods | grep 'goal-unleash-sync-namespaces'
  • SSH into php-fpm one with kubectl exec -ti goal-unleash-sync-namespaces-app-<RANDOM ID> sh
  • Execute cd /var/www/Minds/engine && php cli.php features sync --environment=development,sandbox
  • The above command will sync two environments. Ensure there are no Exceptions outputted
  • On another terminal, get into Cassandra shell with kubectl exec -ti cassandra-0 cqlsh
  • Execute expand on; SELECT * from minds.feature_toggles_cache_ns;
  • Ensure there are feature flag objects listed twice (one for development, other for sandbox) and that the dates are in the range of sync operation (watch out the timezone!)
  • Go to https://goal-unleash-sync-namespaces.minds.io/, log in with an administrator
  • Open menu > Admin > Features
  • Ensure Environment is correct and compare the GitLab columns with what's on the Enabled tab on https://gitlab.com/minds/infrastructure/feature-flags/-/feature_flags/ for the corresponding environment spec.
  • You can also use https://goal-unleash-sync-namespaces.minds.io/admin/features;for=0xemi to check feature for %pro and %admin groups, per example.

Note: As the previous MR, the database check part of might be tricky for @xander-miller to test. The main concern is that critical features are turned on (media modals, etc).

Estimated Regression Scope

Everything related to feature flags.

Edited 5 days ago by Emiliano Balbuena
Request to merge goal/unleash-sync-namespaces into master
Pipeline #113755311 passed for 34786da1 on goal/unleash-sync-namespaces
          Merge request approved. Approved by
          Mark Harding
          Marcelo Rivera Brian Hatchet Martin Santangelo Ben Hayward Rami Albatal

          Merged by Mark Harding 15 minutes ago

          The changes were merged into master with 5e9b7bb9

          The source branch has been deleted

          Closed #1335 (closed)

          Pipeline #115119819 waiting for manual action for 5e9b7bb9 on master
                          • Emiliano Balbuena @edgebal assigned to @edgebal 6 days ago

                            assigned to @edgebal

                          • Emiliano Balbuena @edgebal added Squad::Yellow Status::Awaiting Review scoped labels 6 days ago

                            added scoped labels

                          • Emiliano Balbuena @edgebal assigned to @markeharding, @brianhatchet, and @benhayward.ben 6 days ago

                            assigned to @markeharding, @brianhatchet, and @benhayward.ben

                          • Emiliano Balbuena @edgebal changed the description 6 days ago

                            changed the description

                            • Ben Hayward
                              Ben Hayward @benhayward.ben · 6 days ago
                              Developer
                              Resolved by Emiliano Balbuena 5 days ago

                              May not be an issue at all, but just wanted to let you know blockchain_creditcard & psr7-router are missing from https://gitlab.com/minds/infrastructure/feature-flags/-/feature_flags/?scope=enabled&page=1 but are enabled when looking at the config JSON.

                              Going to do a test of the sites functionality now and will approve assuming it all passes.

                            • Emiliano Balbuena
                              Last reply by Emiliano Balbuena 5 days ago
                            • Ben Hayward
                              Ben Hayward @benhayward.ben · 6 days ago
                              Developer
                              Resolved by Emiliano Balbuena 5 days ago

                              These may be totally irrelevant also, but just to make sure I bring them up:

                              modal-pager is true according to https://goal-unleash-sync-namespaces.minds.io/api/v1/minds/config but i see no modal pager.

                              I also don't see homepage 2019 image

                              Edited by Ben Hayward 5 days ago
                            • Emiliano Balbuena
                              Last reply by Emiliano Balbuena 5 days ago
                            • Brian Hatchet
                              Brian Hatchet :speech_balloon: @brianhatchet · 5 days ago
                              Developer
                              Resolved by Emiliano Balbuena 5 days ago

                              This all looks good, @edgebal

                              It would be good to add an admin endpoint to get the current feature flags and force a sync on them

                            • Emiliano Balbuena
                              Last reply by Emiliano Balbuena 5 days ago
                          • Emiliano Balbuena @edgebal resolved all threads 5 days ago

                            resolved all threads

                          • Emiliano Balbuena @edgebal added 1 commit 5 days ago

                            added 1 commit

                            • a6cdf876 - (feat): Admin endpoint for features breakdown

                            Compare with previous version

                          • Emiliano Balbuena @edgebal added 1 commit 5 days ago

                            added 1 commit

                            • 34786da1 - (refactor): Change breakdown response

                            Compare with previous version

                          • Emiliano Balbuena @edgebal mentioned in merge request front!753 5 days ago

                            mentioned in merge request front!753

                          • Emiliano Balbuena @edgebal changed the description 5 days ago

                            changed the description

                          • Emiliano Balbuena @edgebal resolved all threads 5 days ago

                            resolved all threads

                          • Emiliano Balbuena
                            Emiliano Balbuena @edgebal · 5 days ago
                            Developer

                            I tried by all means to introduce a Sync Now button, but I couldn't easily re-trigger manually the operation in the runner without doing a nasty polling every 1 second. Switching to a queue event based system might introduce issues with the "every X minutes" interval.

                            cc/ @brianhatchet @markeharding

                          • Emiliano Balbuena @edgebal unmarked as a Work In Progress 5 days ago

                            unmarked as a Work In Progress

                          • Emiliano Balbuena
                            Emiliano Balbuena @edgebal · 5 days ago
                            Developer

                            Review sites are defaulting to development environment. I tried to set MINDS_ENV at Helm chart's values.yaml container definitions (env key), but no luck.

                            I'm going to still move this to BuddyReview so everybody can start taking a look.

                            cc/ @brianhatchet @markeharding

                          • Emiliano Balbuena
                            Emiliano Balbuena @edgebal · 5 days ago
                            Developer

                            Fixed MINDS_ENV issue at helm-charts!30 (merged).

                            cc/ @brianhatchet @markeharding

                          • Emiliano Balbuena @edgebal resolved all threads 5 days ago

                            resolved all threads

                          • Mark Harding @markeharding changed target branch from production to master 16 minutes ago

                            changed target branch from production to master

                          • Mark Harding @markeharding approved this merge request 15 minutes ago

                            approved this merge request

                          • Mark Harding @markeharding merged 15 minutes ago

                            merged

                          • Mark Harding @markeharding mentioned in commit 5e9b7bb9 15 minutes ago

                            mentioned in commit 5e9b7bb9

                          Please register or sign in to reply
                          4 Assignees
                          Mark Harding's avatar
                          Emiliano Balbuena's avatar
                          Brian Hatchet's avatar
                          Ben Hayward's avatar
                          None
                          Milestone
                          None
                          Time tracking
                          No estimate or time spent
                          2
                          Labels
                          Squad::Yellow Status::Awaiting Review
                          Lock merge request
                          Unlocked
                          9
                          9 participants
                          user avatar
                          user avatar
                          user avatar
                          user avatar
                          user avatar
                          user avatar
                          user avatar
                          Reference: minds/engine!452