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

Add feature flag for replacing Applications and Sources with query service backend #2746

Merged
merged 9 commits into from
Apr 26, 2023

Conversation

jpellizzari
Copy link
Contributor

@jpellizzari jpellizzari commented Apr 19, 2023

Closes #2727
Closes #2759

Adds a feature flag to swap out the UI/Backend of Applications/Sources with the query service backend. Set the WEAVE_GITOPS_FEATURE_QUERY_SERVICE_BACKEND flag to enable it. The UI is roughly the same, although it is simplified to accommodate our querying system.

Screenshot from 2023-04-20 11-20-01

@jpellizzari jpellizzari added the enhancement New feature or request label Apr 19, 2023
@jpellizzari jpellizzari force-pushed the 2727-apps-sources branch 2 times, most recently from 707fa56 to 81012ef Compare April 20, 2023 18:27
@jpellizzari jpellizzari requested a review from enekofb April 20, 2023 18:27
@jpellizzari jpellizzari marked this pull request as ready for review April 20, 2023 18:27
pkg/query/store/sqlite.go Outdated Show resolved Hide resolved
Copy link
Contributor

@enekofb enekofb left a comment

Choose a reason for hiding this comment

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

lgtm!

Some thoughts to catchup later on:

  • to instrument the switch to understand users behavior, to provide info on whether we improve their situation and whether there is still some feature gap that customers might require (this sounds like a ticket)
  • when used the applications or sources based on explorer, how the user could search or navigate the collection.
  • how to cover user documentation (another ticket or same issue)
  • add some unit tests

i could read and understand the UI code but not fully reliable for reviewing the lower details for the UI, we might want also to add some FE as a reviewer

@@ -85,6 +85,10 @@ spec:
- name: WEAVE_GITOPS_FEATURE_TERRAFORM_UI
value: "true"
{{- end }}
{{- if .Values.useQueryServiceBackend }}
Copy link
Contributor

Choose a reason for hiding this comment

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

if we are able to enable that switch out of the deployment context + captured that behaviour via events (see my comment on pendo), we could have greater insight on which one has more adoption and measure that over time to help us with Objective 1

something like https://flaviocopes.com/react-show-different-component-on-click/

Copy link
Contributor

Choose a reason for hiding this comment

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

it could also helps framing the maturity message of swich to new experimental UI or similar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this were an open source feature, I would be more inclined to collect usage metrics at scale with Pendo. Since it will only be a couple customers at the start, we can probably skip metrics for now.

Copy link
Contributor

@enekofb enekofb Apr 24, 2023

Choose a reason for hiding this comment

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

👍 on pendo,

if we are able to enable that switch out of the deployment context

do you think that putting the switch logic in the UI vs as Feature Flag at deployment time could be beneficial at this stage?

My hypothesis is that if we put it as feature flag, the journey for the platform admin would be like

  1. I deploy with useQueryServiceBackend=true
  2. I go to applications or sources
  3. I use it in my regular workflows
  • if I find limitations using it (which is expected given its maturity)
    • I will report the feedback, switch back to the old experience and wont try it again until that feedback is addressed
  • If i don't find limitations, we are happy

In the context of having the feature flag in the UI, the journey could be the same but given that flipping to the old one does not require deployment, it is less effort for the platform admin to try it back and forth so more chances to get better feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We aren't really equipped to do a button-press feature-enable. We would need to persist that and the only option available to us would be the user's localStorage.

Given that the customer probably cannot even load the other experience, I don't know how useful that would be.

@jpellizzari
Copy link
Contributor Author

Added UI tests

@jpellizzari
Copy link
Contributor Author

jpellizzari commented Apr 24, 2023

@enekofb PTAL Added sync controls and the backend logic necessary for scoped querying, so the text input is back:

Screenshot from 2023-04-24 12-34-31

@enekofb
Copy link
Contributor

enekofb commented Apr 25, 2023

The backend changes looks good
In the UI, when tested locally with queryBackendEnabled

Screenshot 2023-04-25 at 07 56 11

i could see how from the app and sources experiences there are calls to the old endpoints

Screenshot 2023-04-25 at 07 53 23

Screenshot 2023-04-25 at 07 56 53

I've pointed our integration environment to the branch to test it

https://wge-2448.eng-sandbox.weave.works/applications

It has the same behaviour

@enekofb
Copy link
Contributor

enekofb commented Apr 25, 2023

Doing some searches i could see how the data from the backend comes correctly but the UI has some unexpected rows

Screenshot 2023-04-25 at 08 23 37

Screenshot 2023-04-25 at 08 23 47

@jpellizzari
Copy link
Contributor Author

Doing some searches i could see how the data from the backend comes correctly but the UI has some unexpected rows

@enekofb Could you provide a link? Or is this in local dev.

@jpellizzari
Copy link
Contributor Author

The backend changes looks good In the UI, when tested locally with queryBackendEnabled

I've pointed our integration environment to the branch to test it

https://wge-2448.eng-sandbox.weave.works/applications

It has the same behaviour

Have the pods been bumped?

@jpellizzari
Copy link
Contributor Author

i could see how from the app and sources experiences there are calls to the old endpoints

@enekofb This part of the code is requesting sources, so this is not coming from the table but from another component that needs that data:

@enekofb
Copy link
Contributor

enekofb commented Apr 25, 2023

i could see how from the app and sources experiences there are calls to the old endpoints

@enekofb This part of the code is requesting sources, so this is not coming from the table but from another component that needs that data:

@jpellizzari thanks for looking

Not sure if you have also experienced but that seems to block the page loading some times (given the feeling that is the data table which is slow). Not sure if we could / should do something about it but just pointing out.

@jpellizzari jpellizzari force-pushed the 2727-apps-sources branch 2 times, most recently from c02636e to c55dd89 Compare April 25, 2023 18:06
@jpellizzari
Copy link
Contributor Author

@enekofb This should fix the issue of weird rows showing up: c55dd89

PTAL

@enekofb enekofb self-requested a review April 26, 2023 08:29
Copy link
Contributor

@enekofb enekofb left a comment

Choose a reason for hiding this comment

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

LGTM

Tested locally with a few queries around apps v2, sources v2 and explorer and everything looks good to me

Screenshot 2023-04-26 at 09 30 41

I realised that given the calls to the v1 objects endpoint loading apps page it takes longer than explorer or sources (added ticket to follow up #2769 (comment))

I was not able to do a thorough look into the UI code so suggested to get some other reviewer for this part to validate the configuration logic around apps and sources UI

@jpellizzari jpellizzari merged commit 3b2deb1 into main Apr 26, 2023
@jpellizzari jpellizzari deleted the 2727-apps-sources branch April 26, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants