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

Explorer extending - gitopssets #3267

Merged
merged 11 commits into from
Sep 6, 2023
Merged

Explorer extending - gitopssets #3267

merged 11 commits into from
Sep 6, 2023

Conversation

ranatrk
Copy link
Contributor

@ranatrk ranatrk commented Aug 30, 2023

Closes #2957

What changed?
Add gitopssets to explorer filters

Why was this change made?
Extending the explorer to be compatible to filter based on the kind Gitopssets

How was this change implemented?
Add gitopsset to compatible objects used in the explorer filter

How did you validate the change?

  • Explain how a reviewer can verify the change themselves
    manual test: Add gitopsset, then through the explorer view tab, enable the gitopssets filter to only show the gitopsset

Release notes
Add gitopssets to explorer filters

Documentation Changes
N/A

Other follow ups

@ranatrk ranatrk force-pushed the explorer-extending branch 2 times, most recently from cab5a50 to c2d4f58 Compare September 3, 2023 13:57
@ranatrk ranatrk added the enhancement New feature or request label Sep 3, 2023
@ranatrk ranatrk marked this pull request as ready for review September 4, 2023 13:09
@ranatrk ranatrk changed the title Explorer extending Explorer extending - gitopssets Sep 4, 2023
@ranatrk ranatrk requested review from enekofb and a team September 4, 2023 13:10
Copy link
Contributor

@bigkevmcd bigkevmcd left a comment

Choose a reason for hiding this comment

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

I think we should fix the category.

pkg/query/configuration/objectkind.go Outdated Show resolved Hide resolved
@enekofb enekofb requested a review from jpellizzari September 4, 2023 13:49
@bigkevmcd bigkevmcd self-requested a review September 4, 2023 14:21
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, just suggesting adding an integration test case

pkg/query/configuration/objectkind.go Show resolved Hide resolved
AddToSchemeFunc: gitopssets.AddToScheme,
StatusFunc: defaultFluxObjectStatusFunc,
MessageFunc: defaultFluxObjectMessageFunc,
Category: CategoryAutomation,
Copy link
Contributor

Choose a reason for hiding this comment

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

@jpellizzari do we expect to use this category?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would think no. This will put the GitOpsSets objects into the Applications table. I would give them their own category, so that they show up in their own table.

Copy link
Contributor

Choose a reason for hiding this comment

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

tested and i could see gitopsssets with applications UI as you mentioned

Screenshot 2023-09-05 at 16 50 33

@ranatrk please lets change the category

Copy link
Contributor

Choose a reason for hiding this comment

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

@enekofb enekofb requested a review from opudrovs September 4, 2023 15:17
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.

thanks for adding the test case! i think there is a small change required. ptal

@@ -169,6 +170,36 @@ func TestQueryServer(t *testing.T) {
query: fmt.Sprintf("kind:%s", sourcev1beta2.BucketKind),
expectedNumObjects: 1, // should allow only on default namespace,
},
{
name: "should support gitopssets",
access: allowHelmReleaseAnyOnDefaultNamespace(principal.ID),
Copy link
Contributor

Choose a reason for hiding this comment

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

you might want to change this for allowGitOpsSetsAnyOnDefaultNamespace

@enekofb enekofb self-requested a review September 4, 2023 15:43
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.

e2e tested with the following:

I could see the gitopssets showing in explorer view

Screenshot 2023-09-04 at 16 43 16

However when i click through brings me to the generic view not the gitopssets details one.

Screenshot 2023-09-04 at 16 43 31

@ranatrk
I believe you want to be redirected to gitopsset view, isn't?

Suggestions added for the routing here #3267 (review)

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.

suggestions added to make the routing work

ui-cra/src/utils/nav.ts Outdated Show resolved Hide resolved
ui-cra/src/utils/nav.ts Outdated Show resolved Hide resolved
@ranatrk
Copy link
Contributor Author

ranatrk commented Sep 4, 2023

@enekofb yes, i'll try to fix it with these updates! thank you

@enekofb
Copy link
Contributor

enekofb commented Sep 4, 2023

@enekofb yes, i'll try to fix it with these updates! thank you

Super, happy to approve once tests are green .. thanks you 🙏

@ranatrk ranatrk force-pushed the explorer-extending branch 4 times, most recently from f578c43 to edb25ba Compare September 5, 2023 11:34
@ranatrk ranatrk requested a review from enekofb September 5, 2023 14:08
Copy link
Contributor

@jpellizzari jpellizzari left a comment

Choose a reason for hiding this comment

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

Code LGTM. I would expect an Explorer UI component to be used somewhere with the corresponding category= prop set. But maybe that will be a follow up PR?

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.

added follow-up on the category, see comment above

AddToSchemeFunc: gitopssets.AddToScheme,
StatusFunc: defaultFluxObjectStatusFunc,
MessageFunc: defaultFluxObjectMessageFunc,
Category: CategoryAutomation,
Copy link
Contributor

Choose a reason for hiding this comment

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

tested and i could see gitopsssets with applications UI as you mentioned

Screenshot 2023-09-05 at 16 50 33

@ranatrk please lets change the category

AddToSchemeFunc: gitopssets.AddToScheme,
StatusFunc: defaultFluxObjectStatusFunc,
MessageFunc: defaultFluxObjectMessageFunc,
Category: CategoryAutomation,
Copy link
Contributor

Choose a reason for hiding this comment

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

@enekofb enekofb self-requested a review September 5, 2023 16:07
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.

Please merge this https://github.com/weaveworks/weave-gitops-enterprise/pull/3290/files or similar one before merging to main

awesome one @ranatrk 👏

@ranatrk ranatrk merged commit 95ff6ff into main Sep 6, 2023
@ranatrk ranatrk deleted the explorer-extending branch September 6, 2023 08:47
AsmaaNabilBakr pushed a commit that referenced this pull request Sep 6, 2023
* Add gitopsset kind to supported objects in explorer query

* add gitopssets to rbac rules

* Add gitopssets to ToFluxObject

* Add gitopssets to getKindRoute fn in ui

* Add gitopssets query server testcase to server integration tests

* Use allowGitOpsSetsAnyOnDefaultNamespace for gitopsset support query server test

* Add gitopssets crd to query suite test

* changed category gitopsset (#3290)

---------

Co-authored-by: Eneko Fernández <[email protected]>
AsmaaNabilBakr added a commit that referenced this pull request Sep 6, 2023
* fix button spaces

* remove unused imports

* update snaps

* remove unused styled components

* Rename ui-cra -> ui and move package.json to root (#3263)

* Search replace all the ui-cra to ui
* and move package.json to root
* run eject

* Update fields in cluster-service API to be snake_case (#3237)

* Update fields in cluster-service API to be snake_case
* Make sure all network requests in the UI use the protobuf types
* And remove all a lot of unused code in the FE too


---------

Co-authored-by: Simon Howe <[email protected]>
Co-authored-by: Simon <[email protected]>

* Bump @adobe/css-tools from 4.2.0 to 4.3.1 (#3284)

Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.2.0 to 4.3.1.
- [Changelog](https://github.com/adobe/css-tools/blob/main/History.md)
- [Commits](https://github.com/adobe/css-tools/commits)

---
updated-dependencies:
- dependency-name: "@adobe/css-tools"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Simon <[email protected]>

* Bump async from 2.6.3 to 2.6.4 (#3285)

Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](caolan/async@v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Simon <[email protected]>

* Explorer extending - gitopssets (#3267)

* Add gitopsset kind to supported objects in explorer query

* add gitopssets to rbac rules

* Add gitopssets to ToFluxObject

* Add gitopssets to getKindRoute fn in ui

* Add gitopssets query server testcase to server integration tests

* Use allowGitOpsSetsAnyOnDefaultNamespace for gitopsset support query server test

* Add gitopssets crd to query suite test

* changed category gitopsset (#3290)

---------

Co-authored-by: Eneko Fernández <[email protected]>

* update snaps

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Simon <[email protected]>
Co-authored-by: Sara Elzayat <[email protected]>
Co-authored-by: Simon Howe <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rana Tarek Hassan <[email protected]>
Co-authored-by: Eneko Fernández <[email protected]>
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
Development

Successfully merging this pull request may close these issues.

Switch Cluster/Template/Gitopsset etc querying to the explorer querier
4 participants