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 granular control of query service components #3485

Merged
merged 10 commits into from
Oct 25, 2023

Conversation

jpellizzari
Copy link
Contributor

@jpellizzari jpellizzari commented Oct 12, 2023

Closes #3424

Allow for granular controls of when Explorer replaces the current table UI/backend.

To test locally, turn off the NATIVE_BUILD flag with unset NATIVE_BUILD, then the Helm chart values changes should work.

Breaking Change release note copy:

⚠️ Breaking Change ⚠️

We have changed the way the explorer feature is enabled. It is now possible to enable or disable explorer on different parts of the application. Previously, there was a global toggle set in the Helm Chart values called enableExplorer. This flag has been replaced by two keys: explorer.enabled and explorer.enabledFor:

explorer:
  enabled: true # global enable/disable flag
  # ...
  enabledFor: # list of components that can be enabled or disabled
    - applications
    - sources
    - gitopssets
    - templates

Adding or removing items from this list will control which parts of the UI utilize the explorer backend.

The current values that are supported for this key:

    - applications
    - sources
    - gitopssets
    - templates

See this section of the docs for more info: https://docs.gitops.weave.works/docs/explorer/getting-started/

@jpellizzari jpellizzari added the enhancement New feature or request label Oct 16, 2023
@jpellizzari jpellizzari force-pushed the 3424-explorer-feature branch 3 times, most recently from f96ad92 to 5b62bf1 Compare October 16, 2023 18:21
@jpellizzari jpellizzari marked this pull request as ready for review October 16, 2023 18:39
@jpellizzari jpellizzari force-pushed the 3424-explorer-feature branch from 1f31d6b to 535cdf0 Compare October 16, 2023 18:54
@opudrovs
Copy link
Contributor

opudrovs commented Oct 16, 2023

I see the following error when testing this branch with make cluster-dev and NATIVE_BUILD unset:

Screenshot 2023-10-16 at 21 32 47 Screenshot 2023-10-16 at 21 32 57

Is it that yaml or d3 import issue again, just in WGE this time?

weaveworks/weave-gitops#2305
weaveworks/weave-gitops#3672

Will try it on the clean cluster again now.

@opudrovs
Copy link
Contributor

opudrovs commented Oct 16, 2023

The same error. Can check main in an hour.

@opudrovs
Copy link
Contributor

opudrovs commented Oct 16, 2023

Yeah, the UI works fine for me in the main branch, but in the current one I see the same error.

@@ -213,16 +213,18 @@ cluster-controller:
tag: v1.5.2

#### Explorer
# Turns on explorer to true
enableExplorer: false
Copy link
Collaborator

@foot foot Oct 17, 2023

Choose a reason for hiding this comment

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

This change looks good!.. I think quite a few clusters (demoX, maybe some customers) etc will be using this old value.

We could complicate the code w/ a bunch of

{{- if or (.Values.explorer.enabled .Values.explorerEnabled) }}

But also users will notice the explorer has been disabled, check the release notes which will call this out, and turn it back on, no biggie I think? cc @enekofb

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There will be a corresponding docs change: https://github.com/weaveworks/weave-gitops/pull/4088/files

If we think backwards compatibility is important here, I can add that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are fine with having it:

  • announced as a breaking change in the release notes and
  • how users could adapt the configuration.

We have it marked as alpha https://docs.gitops.weave.works/docs/explorer/intro/ to given users the right expectations of: yes it improves the situation but is not yet proven to reach a level of maturity to be proven useful for range of scenario.

i definitely think after this change is in we shoudl engage with Steve F. and Darryl to get more feedback though in particular on the explorer-based UIs

@jpellizzari
Copy link
Contributor Author

Yeah, the UI works fine for me in the main branch, but in the current one I see the same error.

@opudrovs Can you try rebasing, then doing a yarn install to ensure that you have the latest deps?

@opudrovs
Copy link
Contributor

@jpellizzari yes, just a moment.

@opudrovs opudrovs force-pushed the 3424-explorer-feature branch from 46a94ed to 5bf1d33 Compare October 18, 2023 17:02
@jpellizzari jpellizzari force-pushed the 3424-explorer-feature branch from 5bf1d33 to 17d720d Compare October 18, 2023 17:04
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.

Tested with

explorer:
  enabled: true
  enabledFor:
    - applications
    - sources
    - gitopssets
    - templates

with these args

Screenshot 2023-10-19 at 16 44 17

I could see Explorer enabled

Screenshot 2023-10-19 at 16 41 59

but i dont see the other ones

Screenshot 2023-10-19 at 16 45 16

looking at

To test locally, turn off the NATIVE_BUILD flag with unset NATIVE_BUILD, then the Helm chart values changes should work.

charts/mccp/templates/clusters-service/deployment.yaml Outdated Show resolved Hide resolved
@@ -53,6 +53,10 @@ spec:
{{ if .Values.explorer.cleaner.disabled }}
- --explorer-cleaner-disabled=true
{{- end }}

# {{- if .Values.explorer.enabledFor }}
- --explorer-enabled-for=applications,sources
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a leftover debug line that has been fixed. We now iterate through the items in the Values.EnabledFor field. This was also causing the issue you reported with gitopssets not using Explorer.

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, i mean passing configuration as runtime flags like this vs just adding them to the config map ?

https://github.com/weaveworks/weave-gitops-enterprise/pull/3485/files#diff-95ac9e88b54348348d8a588312fe429de368aab3f45a8d6f69e2ccd4dfa5f101R61-R62

it feels that having all configuration values in the configmap simplifies config management

@@ -213,16 +213,18 @@ cluster-controller:
tag: v1.5.2

#### Explorer
# Turns on explorer to true
enableExplorer: false
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are fine with having it:

  • announced as a breaking change in the release notes and
  • how users could adapt the configuration.

We have it marked as alpha https://docs.gitops.weave.works/docs/explorer/intro/ to given users the right expectations of: yes it improves the situation but is not yet proven to reach a level of maturity to be proven useful for range of scenario.

i definitely think after this change is in we shoudl engage with Steve F. and Darryl to get more feedback though in particular on the explorer-based UIs

@enekofb enekofb self-requested a review October 19, 2023 15:58
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.

tested without native build and

explorer:
  enabled: true
  enabledFor:
    - applications
    - sources
    - gitopssets
    - templates

I could see apps and sources with explorer

Screenshot 2023-10-19 at 16 59 50

but not gitopsssets nor templates

Screenshot 2023-10-19 at 17 00 59

is this expected?

@jpellizzari
Copy link
Contributor Author

is this expected?

@enekofb My leftover debug efforts were causing issues where we didn't loop over the items in the values.yaml. Fixed now!

@jpellizzari jpellizzari force-pushed the 3424-explorer-feature branch from 191a08c to cfdbfc7 Compare October 20, 2023 16:25
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.

Super! Ive verified worked with all values selected and some selected 🚀

Limitation: my frontend review not of much value (as usual)
Doubts:

@jpellizzari jpellizzari force-pushed the 3424-explorer-feature branch from fe84c79 to 1bed81e Compare October 23, 2023 22:36
@jpellizzari jpellizzari requested review from enekofb and foot October 23, 2023 22:56
@jpellizzari
Copy link
Contributor Author

@enekofb Updated to use configmap, and added a note that can hopefully be copy/pasted into our release notes

@foot See above re breaking change release note.

@enekofb enekofb added the breaking-change to flag breaking changes similar to weave gitops oss label Oct 24, 2023
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.

just small comment below

@@ -60,7 +59,7 @@ const WGApplicationsDashboard: FC = ({ className }: any) => {
<OpenedPullRequest />
</Flex>
<div className={className}>
{useQueryServiceBackend ? (
{isQueryServiceEnabled ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

we might want use isExplorerEnabled as we have other uis https://github.com/weaveworks/weave-gitops-enterprise/pull/3485/files#diff-b9da4e2b2d5014f5b181f3a2c849a4cfbe3f3ac4b537b618c0ecb24e650ba267R44

or the other way around isQueryServiceEnabled ... explorer seems clearer to me though

@enekofb enekofb self-requested a review October 24, 2023 14:45
@jpellizzari jpellizzari force-pushed the 3424-explorer-feature branch from 1bed81e to 11acba5 Compare October 24, 2023 16:52
We want to be able to enable and disable the Explorer and query service backend for different parts of the UI. Before this, it was a global on-off switch handled via feature flags. This commit adds a dedicated enpoint for us to hit to enable or disable components via the helm values file.
Consolidates all of the explorer related configuration options underneath the `enabled` yaml key for consistency.
@jpellizzari jpellizzari force-pushed the 3424-explorer-feature branch from 11acba5 to f08c34f Compare October 25, 2023 17:10
@jpellizzari jpellizzari merged commit 3c8f577 into main Oct 25, 2023
@jpellizzari jpellizzari deleted the 3424-explorer-feature branch October 25, 2023 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change to flag breaking changes similar to weave gitops oss enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add granular controls for turning Explorer on and off for different parts of the UI
4 participants