Skip to content

Conversation

@opudrovs
Copy link
Contributor

@opudrovs opudrovs commented Oct 13, 2023

Closes #3374

  • Replaced custom sync/suspend controls with the new SyncControls component.
  • Replaced the icon EditButton with a text-based EditButton with the new Settings icon.
  • Updated the snapshots.
  • Fixed related tests.

Notes:

@opudrovs opudrovs self-assigned this Oct 13, 2023
@opudrovs opudrovs added enhancement New feature or request and removed area/ui labels Oct 13, 2023
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch 6 times, most recently from b8f2350 to ea39bfa Compare October 20, 2023 05:35
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch 14 times, most recently from dfe7f2d to af8c6a2 Compare October 29, 2023 22:55
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch 2 times, most recently from 43a8030 to fca4de8 Compare October 30, 2023 12:33
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch from 9d8f274 to 854dbb4 Compare October 30, 2023 21:39
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch 3 times, most recently from 99f807a to 5863c1f Compare October 31, 2023 17:18
@opudrovs
Copy link
Contributor Author

opudrovs commented Oct 31, 2023

Put on hold until Thursday because of failing tests (breaking changes in OSS).

@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch from 5863c1f to 6f6de48 Compare November 7, 2023 11:28
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch from 90f7b3b to 7fdaf5e Compare November 7, 2023 11:47
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch from 7fdaf5e to 63b38fd Compare November 7, 2023 11:48
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch from 63b38fd to 47cf6d7 Compare November 7, 2023 12:04
opudrovs added a commit that referenced this pull request Nov 7, 2023
#3487)

* Add `SyncControls` instead of custom controls on `GitOpsSet`, `Terraform` object, and `Secret` detail views.

* Replace the icon EditButton with a text-based EditButton with the new Settings icon.

* Update snapshots.

* Fix related tests.
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch from c0912cb to 7094be6 Compare November 7, 2023 12:22
clusterName: (resource as GetTerraformObjectResponse)?.object
?.clusterName,
});
case 'GitOpsSet':
Copy link
Contributor

Choose a reason for hiding this comment

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

i could click on edit gitopsset from template. the request is executed with 500

Screenshot 2023-11-07 at 13 32 02
{
    "code": 2,
    "message": "looking up objects of kind GitOpsSet not supported",
    "details": []
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, in this case maybe editing GitOpsSet objects is not supported on the backend? Because I only added the edit button on the frontend (if I got the ticket requirements right).

Maybe we need to move adding Edit button to GitOpsSets to a separate ticket? I thought the backend part is finished already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The backend error message is from core/server/primarykinds.go in OSS:

// Lookup ensures that a kind name is known, white-listed, and returns
// the full GVK for that kind
func (pk *PrimaryKinds) Lookup(kind string) (*schema.GroupVersionKind, error) {
	gvk, ok := pk.kinds[kind]
	if !ok {
		return nil, fmt.Errorf("looking up objects of kind %v not supported", kind)
	}

	return &gvk, nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The frontend error message visible on the screenshot is from a frontend check for template name in annotations:

const templateName = getCreateRequestAnnotation(resource)?.template_name;
if (!templateName) {
...
[show notification with text]
No edit information is available for this resource.
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure how a GitOpsSet is created from a template and if the template name should be added automatically or manually. Maybe this functionality should be added too.

>
{object?.suspended ? 'Resume' : 'Suspend'}
</Button>
<SyncControls
Copy link
Contributor

Choose a reason for hiding this comment

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

In the terraform table page i could see controls but sync hangs

I dont see sync controls in terraform within the details page

Uploading Screenshot 2023-11-07 at 13.36.51.png…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dont see sync controls in terraform within the details page

Weird, they should be there. They are rendered non-conditionally.

Copy link
Contributor Author

@opudrovs opudrovs Nov 7, 2023

Choose a reason for hiding this comment

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

Have you pulled in the latest commit? Because I think I removed Sync controls on the TF object details page temporarily on rebase and re-added them later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the terraform table page i could see controls but sync hangs

TF object sync always hangs for me even locally in the main branch, I have not changed any sync logic.

There was an old issue for it with sync timing out:
#2264
but it looks like it was fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here are the new controls I can see in the TF object details page in the current branch:

Screenshot 2023-11-07 at 14 52 50

Where else you cannot see the new controls?

Copy link
Contributor

@enekofb enekofb Nov 7, 2023

Choose a reason for hiding this comment

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

checking again, i was able to see the new controls in the other but terrraform UIs

Copy link
Contributor Author

@opudrovs opudrovs Nov 7, 2023

Choose a reason for hiding this comment

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

@enekofb weird, must be a caching issue (Tilt, yarn or browser), because I see them in the app, they are replaced in the code on TerraformObjectDetail view, and TerraformObjectDetail view tests are updated with the test IDs from the new controls.

Could you delete the node_modules folder and run make node_modules? And possibly restart everything (native-ui-build, compile, clusters-service, whatever is relevant) in Tilt manually and re-test?

I think I had a similar issue with UI not updating in the past once or twice.

@jpellizzari @joshri could any of you please check that the new Sync/Suspend controls are present on the Terraform object details view?

@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch from 053334f to 1e4b621 Compare November 7, 2023 14:21
#3487)

* Add `SyncControls` instead of custom controls on `GitOpsSet`, `Terraform` object, and `Secret` detail views.

* Replace the icon EditButton with a text-based EditButton with the new Settings icon.

* Update snapshots.

* Fix related tests.
@opudrovs opudrovs force-pushed the 3374-standartize-sync-suspend-edit-buttons branch from 1e4b621 to a08069b Compare November 7, 2023 14:48
@opudrovs
Copy link
Contributor Author

opudrovs commented Nov 7, 2023

@enekofb @jpellizzari @joshri as discussed with @LappleApple , I removed the Edit GitOpsSet functionality (it might be added in another issue later), so the current PR can be reviewed.

@enekofb enekofb requested a review from jpellizzari November 7, 2023 15:04
@opudrovs
Copy link
Contributor Author

opudrovs commented Nov 7, 2023

Integration tests are failing twice, restarting them.

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.

LGTM 👍

@opudrovs opudrovs merged commit fbadfad into main Nov 7, 2023
@opudrovs opudrovs deleted the 3374-standartize-sync-suspend-edit-buttons branch November 7, 2023 16:01
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.

Standardize the sync/suspend/edit buttons across WGE

4 participants