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

PR for Building sm-integration Branch #822

Open
wants to merge 69 commits into
base: main
Choose a base branch
from
Open

PR for Building sm-integration Branch #822

wants to merge 69 commits into from

Conversation

ralikio
Copy link
Member

@ralikio ralikio commented Aug 20, 2024

PR for building sm-integration branch using exisiting mechanism. DO NOT MERGE. Related to #442

@kyma-bot kyma-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 20, 2024
@kyma-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kyma-bot kyma-bot added area/documentation Issues or PRs related to documentation cla: yes Indicates the PR's author has signed the CLA. labels Aug 20, 2024
Copy link

Add one of following labels

- kind/feature -> Use it when you want to submit a new feature

- kind/enhancement -> Use it when you modify or improve an existing feature

- kind/bug -> Use it when you fix a bug

@kyma-bot kyma-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 20, 2024
@ralikio ralikio changed the title PR For PR for Building sm-integration Branch Aug 20, 2024
@ralikio ralikio added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 20, 2024
@ralikio ralikio closed this Aug 20, 2024
@ralikio ralikio reopened this Aug 20, 2024
@szwedm szwedm force-pushed the sm-integration branch 3 times, most recently from fc39203 to bce299e Compare August 21, 2024 12:29
szwedm and others added 17 commits August 22, 2024 07:47
* Add interface for cluster object provider

* Interface segregation

* Add context param to interfaces

* Add NamespaceProvider

* Add SecretProvider

* Add ServiceInstanceProvider

* tweaks - use pointers, name changes

* Include ServiceInstanceProvider in SecretProvider

* Get secrets from secret ref in SI

* Fix provider interface

* Fix constructor

* Add NamespaceProvider unit tests

* Fix ServiceInstanceProvider constructor

* Fix secret reference filter

* Add unit tests for service instance provider

* Fix secrets fetching

* Log warning when SecretProvider does not find btp operator secrets

* Add SecretProvider unit tests

* Apply suggestions from code review
* Run components in separate goroutines

* Separate components

* Pass pointers of parsed config values to setupManager

* Add if to print secrets name and namspace when SecretList is not empty

* Check SI CRD existance before fetching secrets

* Add logs for debug
* Add SM client

* Get secret for SM http client

* Build HTTP client for Service Manager

* Add method to fetch service offerings

* Add method to fetch service offerings

* Add Common struct with fields common to all SM objects

* Add ServiceOffering struct

* Add method to extract ServiceOffering metadata fields values

* Adjustments for running in main

* nil checks and log improvements

* Add method for setting client for given secret

* Fix not found error return

* Fix tests after adding ServiceInstance CRD existence check

* go mod tidy and goimports

* Handle k8s not found error when default secret does not exist
Add unit test for Service Manager client and ServiceOfferings endpoint
Fix not responding api after remove gorilla mux by go http
* Add ServicePlan struct

* wip

* Service Offering with plans request

* Add struct tags for plans in Service Offering details

* Add fake service plans

* Add unit test for service offering details and plans for given service offering ID

* Fix typos

* Refactor URL query for Service Plans
add service offerings support
* Serve frontend from go

* Build UI static files

* Change metrics server port

* Add API config fields in deployment

* Fix serving API on 8080 port

* Add makefile rule to build ui

* Change the order of makefile rules

* eslint

* eslint

* Fix dockerfile copy

* Add doc describing how to deploy BTP Manager with UI

* Fix docs

* Add cleanup info, prerequisites info and fix formatting

* Typos

* Apply suggestions from doc review

Co-authored-by: Iwona Langer <[email protected]>

* Rename ui.md to 09-10-ui.md

---------

Co-authored-by: Iwona Langer <[email protected]>
* sm ui service offerings and plans
plan details
* rm internal/ from gitignore

* Add Operation struct

* Add ServiceInstance struct

* ServiceInstances path const

* Change the field name in collections of SM objects to Items

* GET Service Instances

* GET Service Instance by ID

* Add SI, Error structs for SM responses

* POST Service Instance

* Refactor http response body reading

* DELETE Service Instance

* PATCH Service Instance

* GET Service Instance params

* Add fake SI JSONs for tests

* GET Service Instances test

* GET Service Instance by ID test

* POST Service Instance test

* Refactor SM client unit test to use typed structs instead of generic maps

* PATCH Service Instance test

* DELETE Service Instance by ID test
…#735)

* wip

* wip

* wip

* Rebase and sort imports

* wip

* Fix fetching structs fields

* Fix ServiceBinding struct

* GET Service Instances in API

* CRUD Service Bindings

* GET Service Plan by ID in SM client

* GET Service Instance by ID in API

* Revert temp changes

---------

Co-authored-by: Marcin Szwed <[email protected]>
Co-authored-by: Ksawery Zietara <[email protected]>
* Simple Instances Loading Based on Offerings

* Linter

* Testing Corrections

* Interfaces, Mocks, AttachRoutes Extraction

* ListInstances Test

* Add Missing Dependency

* Linter

* Code Duplication Removal

Removed code duplication pointed out in #746 (comment).

* Corrected Want to Expected

Corrected want to expected as pointed out in #746 (comment)

* Corrected Want to Expected

Corrected want to expected as pointed out in #746 (comment)

* Missing Test

Added test suggested in #746 (comment)

* Added Missing Interface Methods and Theirs Rename

* Removed Setting Client By Namespace and Name from the Path

* Linter & Compilation Corrections

* Duplicated Path

* Corrected Test Expectation

* Removed Unnecessary Mock Method

* Removed Unnecessary Import

* Code Review - Test Addition

Added a tests as requested in #746 (comment)

* code Review - Added Const with testdata Path

Addressed #746 (comment) discussion

* Code Review - Unnecessary IF

The remove if may result in false positives if someone invoked test with empty expected by accident and tested method returned expected as well - addresses #746 (comment)
* Service Bindings API

* Extend Client interface
* Switching Between Test Data and API Call

* Extracted Test Data to Separate File
Removal of Recursive Rendering
ralikio and others added 6 commits August 22, 2024 07:47
* Conditional Rendering of Navigation and Router Outlet

If secrets was not loaded correctly use empty string to showcase it and hide Layout components to block any user action.

* Prevent Infinite Loader

setLoading was not invoked correctly with false value when props contained incorrect values. Such implementation resulted in infinite loading indicator.

* Removed Unnecessary Comments

* Move Error Message Outside of the renderData Method

If mentioned IllustratedMessage is put inside of renderData method then ui5.Menu complains about calling `length` on undefined.

* Moved loadSecrets to useEffect Method

* Expand Error Message to Occupy Full Parent Height
Corrected Placement and Size of NoEntries Message

Previously the message was displayed inside of a table resulting in its unatural placement with "Auto" size making it too big. Now the message is smaller and centered in the view.
* Minimum Delay on Busy Indicator

Setting delay attribute's value to 1 to minimize time needed for Busy indicator to appear.

* Clearing Instance Between Dialog Reloads

Previously, when opening dialog for am instance with bindings before doing the same for an instance without bindings dialog kept data for the former one. Clearing instances and bindings list data prevents this behaviour.

* Corrected Loading State

Removed unnecessary `setLoading(false)` invocations not to turn BusyIndicator off too soon.

* Correct CSS for Object Page and Busy Indicator

Display ObjectPageContent with additional top padding. Center busy indicator by setting its display property to `block`.
* Block SB creation when secret exists

* Add unit test for POST SB when secret exists

* go mod tidy
* Show secret connection status to SM

* Add check if secret was not deleted during loading

* Fix linter
* Added Generic UI Mapping

The following solution is adaption of https://stackoverflow.com/a/64687181 to provide default route to ui app if the file server does not contain given path. The file server returns 404 path if requested path does not correspond to any files in its filesystem. Because of that while routing request to our single page app (e.g. path "/instances/{id}") the request was handled by file server and not by the app itself (which corresponds to `index.html`). The solution routes existing paths, like "/static/*", to the file server and non existing, like "/instances/{id}", to the app frontend.

* Linter
KsaweryZietara and others added 15 commits August 22, 2024 13:08
* Add hint to press Enter when adding labels to SI

* Bump image

* Add quotes

* Change hint

* Change hint
* PR Update

* Removed Unnecessary Error

* PR Update
* Add PUT Service Binding for secret restoring

* Add unit tests

* Restore timeouts values in API tests

* Change app image in docs
* Passing `secret_name` and `secret_namespace` headers to UI

* Unnecessary Addition

* Update 09-10-ui.md

---------

Co-authored-by: Marek Michali <[email protected]>
* Corrected Param Names

* Bump Image
* Remove states from api

* Redo tests

* Refactor tests

* Add path

* Adjust put

* Adjust frontend

* Fix name

* Fix bindings

* chore: Update BTP Manager image to europe-docker.pkg.dev/kyma-project/dev/btp-manager:PR-844

* Limit methods scope

* Revert error message

* Add error to service instance to not render them when changing secret

* Review remarks

* Revert back to id in path
* Flexible Column Layout for Offerings and Instances

* Updated PR Number

* Unnecessary DialogRef and OpenPortal

* Corrected Border Radius and Error Message Margin

Main object page was displaied with rounder bottom corners, which is not compliant with how Busola displays it. Additionally, error message was rendered just at the top of its component withouth any margins.

* Removed Unused Imports

* UnableToLoad Page Corrections

Copied the same mechanics from offerings view for displaying error message when secret data is not able to load hiding main view. Previously, the view for service instances was rendered without any data. Not it is hidden behind error banner.

Added additional error message to UnableToLoad banner to show more detailed message of what has gone wrong.

* Unused Import

* Unused Import

* Closing Panel on Selected Secret Change
* Added Service Instance Id

Added service instance id to instance details view, error message after successful instance removal and to instances table for reference.

* Added Service Instance Id to Error Message

* Introduce Separate UnableToLoad Error

New error for loading instances so that other error do not hide entire service instances view.

* Introduce Separate UnableToLoad Error

* Hide Details on Successful Instance Removal

* Update 09-10-ui.md
* Add button for secret restoration

* Display restore secret button only when secret's data is empty

* Handle Secret restore button press

* Share states of button and binding

* Display data from existing binding when restoring a secret

* Refresh Service Bindings list after restoring a secret

* Update image version in docs

* Fix Service Bindings list refresh after secret restore

* Apply suggestions from code review

* Change PR number in error msg in docs
* Auto generate suffix for binding name

* Revert auto name suffix

* Suggest binding name

* Fix state when input blocked

* Bump

* Fix disabled input field when applying the restore

* Generate suffix when creating another binding

* Fix spacing
* Closing Message Strip

* Update 09-10-ui.md
@ralikio
Copy link
Member Author

ralikio commented Oct 22, 2024

/test all

@kyma-bot
Copy link
Contributor

@ralikio: No presubmit jobs available for kyma-project/btp-manager@main

In response to this:

/test all

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ralikio ralikio marked this pull request as ready for review October 22, 2024 13:14
@ralikio ralikio requested review from a team as code owners October 22, 2024 13:14
@kyma-bot kyma-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 22, 2024
@kyma-gopher-bot kyma-gopher-bot enabled auto-merge (squash) October 22, 2024 13:14
* Rebuild image

* Bump image version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Issues or PRs related to documentation cla: yes Indicates the PR's author has signed the CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants