-
Notifications
You must be signed in to change notification settings - Fork 30
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 intermediate statuses to Explorer #3696
Conversation
5eaeaeb
to
caddbd3
Compare
Add `SuspendableAdapter` for computing the `Suspended` object status. Update status and message tests for `FluxObject`. Add UI icons for indicating Explorer object statuses. Remove empty lines for consistency.
Add `SuspendableAdapter` for computing the `Suspended` object status. Update status and message tests for `FluxObject`. Add UI icons for indicating Explorer object statuses. Remove empty lines for consistency.
c61cdea
to
c346374
Compare
* Add `SuspendableAdapter` for computing the `Suspended` object status. * Update status and message tests for `FluxObject`. * Add UI icons for indicating Explorer object statuses. * Remove empty lines for consistency. * Improve test coverage of Explorer object statuses.
c346374
to
a71a4d8
Compare
a71a4d8
to
8ce8116
Compare
* Add `SuspendableAdapter` for computing the `Suspended` object status. * Update status and message tests for `FluxObject`. * Add UI icons for indicating Explorer object statuses. * Improve test coverage of Explorer object statuses. * Remove empty lines for consistency.
* Add `SuspendableAdapter` for computing the `Suspended` object status. * Update status and message tests for `FluxObject`. * Add UI icons for indicating Explorer object statuses. * Improve test coverage of Explorer object statuses. * Remove empty lines for consistency.
916aeb1
to
13575be
Compare
* Add `SuspendableAdapter` for computing the `Suspended` object status. * Update status and message tests for `FluxObject`. * Add UI icons for indicating Explorer object statuses. * Improve test coverage of Explorer object statuses. * Remove empty lines for consistency.
13575be
to
475b937
Compare
* Add `SuspendableAdapter` for computing the `Suspended` object status. * Update status and message tests for Explorer objects. * Add UI icons for indicating Explorer object statuses. * Add a snapshot test for Explorer object status indicators. * Improve test coverage of Explorer object statuses. * Remove empty lines for consistency.
475b937
to
6dceafe
Compare
* Add `SuspendableAdapter` for computing the `Suspended` object status. * Update status and message tests for Explorer objects. * Add UI icons for indicating Explorer object statuses. * Add a snapshot test for Explorer object status indicators. * Improve test coverage of Explorer object statuses. * Remove empty lines for consistency.
eb1df71
to
03ca925
Compare
d80c7b2
to
56df98a
Compare
@enekofb @jpellizzari changes addressed, please re-review. Main changes:
I will squash the commits after the PR is approved, keeping them for higher visibility of the latest changes. Tested the branch locally, the intermediate statuses are visible in Explorer after the latest changes: |
56df98a
to
96f69bb
Compare
* Add `SuspendableAdapter` for computing the `Suspended` object status. * Expand status and message tests for Explorer objects. * Add showing icons for intermediate Explorer object statuses in the Explorer UI. * Add unit and snapshot tests for rendering UI indicators of Explorer object statuses. * Rename `AutomatedClusterDiscoveryAdaptor` to `AutomatedClusterDiscoveryAdapter` for consistency with other adapters. * Remove empty lines for consistency.
added @weaveworks/pesto and @weaveworks/timber-wolf for visibility (not required approval) but to be aware of the PR for the changes around their affected resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Add `SuspendableAdapter` for computing the `Suspended` object status. * Expand status and message tests for Explorer objects. * Add showing icons for intermediate Explorer object statuses in the Explorer UI. * Add unit and snapshot tests for rendering UI indicators of Explorer object statuses. * Rename `AutomatedClusterDiscoveryAdaptor` to `AutomatedClusterDiscoveryAdapter` for consistency with other adapters. * Remove empty lines for consistency.
b1f91cb
to
9ed0317
Compare
* Add `GetConditionsFunc` and `GetSuspendedFunc` to `ObjectKind` to simplify adding new object kinds (with updates required in a single place). * Add showing icons for intermediate Explorer object statuses in the Explorer UI. * Expand status and message tests for Explorer objects. * Add unit and snapshot tests for rendering UI indicators of Explorer object statuses. * Remove the `FluxObject` interface, `ToFluxObject` function, and adapters. * Add returning errors from `StatusFunc` and `MessageFunc`. * Update the comment for the `defaultStatusFunc` function to reflect changes in status computation logic logic. * Rename `AutomatedClusterDiscoveryKind` to `AutomatedClusterDiscoveryObjectKind` for consistency. * Add a test for computing `AutomatedClusterDiscoveryObjectKind` status message. * Remove empty lines for consistency.
9ed0317
to
72fbbff
Compare
* Add `GetConditionsFunc` and `GetSuspendedFunc` to `ObjectKind` to simplify adding new object kinds (with updates required in a single place). * Add showing icons for intermediate Explorer object statuses in the Explorer UI. * Expand status and message tests for Explorer objects. * Add unit and snapshot tests for rendering UI indicators of Explorer object statuses. * Remove the `FluxObject` interface, `ToFluxObject` function, and adapters. * Improve error handling in `StatusFunc` and `MessageFunc`. * Rename `AutomatedClusterDiscoveryKind` to `AutomatedClusterDiscoveryObjectKind` for consistency. * Remove empty lines for consistency.
72fbbff
to
05d8c7e
Compare
* Add `GetConditionsFunc` and `GetSuspendedFunc` to `ObjectKind` to simplify adding new object kinds (with necessary modifications consolidated in one location). * Remove the `FluxObject` interface, `ToFluxObject` function, and related adapters. * Improve error handling in `StatusFunc` and `MessageFunc`. * Add showing icons for intermediate Explorer object statuses in the Explorer UI. * Expand status and message tests for Explorer objects. * Add unit and snapshot tests for rendering UI indicators of Explorer object statuses. * Rename `AutomatedClusterDiscoveryKind` to `AutomatedClusterDiscoveryObjectKind` for consistency. * Remove empty lines for consistency.
05d8c7e
to
ee74234
Compare
* Add `GetConditionsFunc` and `GetSuspendedFunc` to `ObjectKind` to simplify adding new object kinds (to ensure that necessary modifications are consolidated in one location). * Remove the `FluxObject` interface, `ToFluxObject` function, and a related adapter. * Improve error handling in `StatusFunc` and `MessageFunc`. * Add showing icons for intermediate Explorer object statuses in the Explorer UI. * Expand status and message tests for Explorer objects. * Add unit and snapshot tests for rendering UI indicators of Explorer object statuses. * Rename `AutomatedClusterDiscoveryKind` to `AutomatedClusterDiscoveryObjectKind` for consistency. * Remove empty lines for consistency.
8c383ab
to
56b8b88
Compare
* Add `GetConditionsFunc` and `GetSuspendedFunc` to `ObjectKind` to simplify adding new object kinds (to ensure that necessary modifications are consolidated in one location). * Remove the `FluxObject` interface, `ToFluxObject` function, and a related adapter. * Improve error handling in `StatusFunc` and `MessageFunc`. * Add showing icons for intermediate Explorer object statuses in the Explorer UI. * Expand status and message tests for Explorer objects. * Add unit and snapshot tests for rendering UI indicators of Explorer object statuses. * Rename `AutomatedClusterDiscoveryKind` to `AutomatedClusterDiscoveryObjectKind` for consistency. * Remove empty lines for consistency.
@enekofb re-tested it locally, working as expected. The latest comments addressed. If there are no more changes required, I am merging it. |
* Add `GetConditionsFunc` and `GetSuspendedFunc` to `ObjectKind` to simplify adding new object kinds (to ensure that necessary modifications are consolidated in one location). * Remove the `FluxObject` interface, `ToFluxObject` function, and a related adapter. * Improve error handling in `StatusFunc` and `MessageFunc`. * Add showing icons for intermediate Explorer object statuses in the Explorer UI. * Expand status and message tests for Explorer objects. * Add unit and snapshot tests for rendering UI indicators of Explorer object statuses. * Rename `AutomatedClusterDiscoveryKind` to `AutomatedClusterDiscoveryObjectKind` for consistency. * Remove empty lines for consistency.
56b8b88
to
e517eae
Compare
Closes #3679
Added intermediate Explorer object statuses (based on how intermediate object statuses are currently computed on the frontend ).
Added
SuspendableAdapter
for computing theSuspended
object status.Expanded status and message tests for Explorer objects.
Added showing icons for intermediate Explorer object statuses in the Explorer UI (based on how icon type and color are currently computed on the frontend in the non-Explorer UI).
Added unit and snapshot tests for rendering UI indicators of Explorer object statuses.
Renamed
AutomatedClusterDiscoveryAdaptor
toAutomatedClusterDiscoveryAdapter
for consistency with other adapters.Removed empty line(s) for consistency (this is optional, if there is a reason those lines were added, can put them back).
Re-arranged some (one old and two new) object type switch cases alphabetically based on object Kind without package name, for readability. Can re-arrange them back if needed.
Screenshots of the new intermediate statuses in Explorer UI:
Testing:
Reconciling
andSuspended
) in Explorer. ThePendingAction
status is possible for TF objects only (because it checks for theTerraformPlannedWithChanges
condition reason), which are not supported by Explorer yet.Notes:
Kustomization
with a TF object condition in a unit test for thePendingAction
object status because Explorer for now does not support TF objects and it's beyond the scope of the current issues to add them.Added a to-do to replace this fake TF objects with a real TF object after support for TF objects is added to Explorer.
It's the best I can do with adapters. 😅 If you knwo of a better way to add getting the value of
Spec.Suspend
from underlying Flux objects in Explorer'sFluxObject
, any suggestions are most welcome.In
pkg/query/configuration/fluxobject_test.go
, I had to change the type of test object fromFluxObject
toclient.Object
because with the new adapter added I was getting an error:[object kind] does not implement FluxObject (missing method GetSuspended
.Questions:
Should the object message is computed be reworked with taking some intermediate statuses into account? Or is using only message from object
Condition
with typeReady
orAvailable
, as now, still OK?Based on the frontend logic (how the icon is picked for different statuses), the icon for the
NoStatus
status isRemoveCircleIcon
instead of the same icon as the error icon, which before was used for bothFailed
andNoStatus
status.Should any of the custom status functions used by the following objects:
PolicyAgentAuditEventObjectKind
weave-gitops-enterprise/pkg/query/configuration/objectkind.go
Line 228 in 1172c1d
GitopsTemplateObjectKind
weave-gitops-enterprise/pkg/query/configuration/objectkind.go
Line 268 in 1172c1d
CapiTemplateObjectKind
weave-gitops-enterprise/pkg/query/configuration/objectkind.go
Line 293 in 1172c1d
be reworked too to include intermediate statuses? Do intermediate statuses make sense for any of the objects which use custom status functions? I guess not (those objects cannot be suspended or reconciled, I mean similar to Applications and Sources, correct?) but wanted to check.
Ready
status for test Explorer objects data in the existing frontend tests (for example, here) be updated toSuccess
, to match the way it is returned from the backend (currently in the main branch too,Success
is returned)? In the new UI snapshot test, I used theSuccess
status in test objects.