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

feat: Implement public API that will open SpaceBindings to end users through proxy part 1 #797

Merged
merged 9 commits into from
Oct 2, 2023

Conversation

mfrancisc
Copy link
Contributor

Update proxy (spacelister) e2e tests to check for the newly added workspace.Status.AvailableRoles field. The field should contain the Space roles for the NSTemplateTier.
For example in the case of appstudio tier the list should be: admin, maintainer, contributor

Jira story: https://issues.redhat.com/browse/ASC-410

Related PRs:

Paired with:

test/e2e/proxy_test.go Outdated Show resolved Hide resolved
test/e2e/proxy_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

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

I guess the /workspace/:name case will be covered in the following PR(s)?

@mfrancisc
Copy link
Contributor Author

I guess the /workspace/:name case will be covered in the following PR(s)?

@alexeykazakov TBH I thought that updating the TestSpaceLister test and specifically the test cases that are getting a specific (work)space would be enough to cover my changes. But please let me know if I'm missing some tests.

@alexeykazakov
Copy link
Contributor

TBH I thought that updating the TestSpaceLister test and specifically the test cases that are getting a specific (work)space would be enough to cover my changes. But please let me know if I'm missing some tests.

I didn't notice that we already have a test for /workspace/:name. I thought it's only for the list: /workspace. So, you are right. TBH I thought we do not currently support /workspace/:name at all. This is why I wanted to introduce a new handler (and a route) for that instead of modifying the existing handler.

@mfrancisc
Copy link
Contributor Author

/retest

reg-service PR was updated

Copy link
Collaborator

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

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

Nice 👍

@@ -773,7 +774,7 @@ func TestSpaceLister(t *testing.T) {

// then
require.NoError(t, err)
verifyHasExpectedWorkspace(t, expectedWorkspaceFor(t, awaitilities.Host(), users["bicycle"], true), *bicycleWS)
verifyHasExpectedWorkspace(t, expectedWorkspaceFor(t, awaitilities.Host(), users["bicycle"], true, appStudioTierRolesWSOption), *bicycleWS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

it's just a detail, but since you introduced the options, then you could update the function to:

func expectedWorkspaceFor(t *testing.T, hostAwait *wait.HostAwaitility, user *proxyUser, additionalWSOptions ...commonproxy.WorkspaceOption) toolchainv1alpha1.Workspace {

and then call it:

Suggested change
verifyHasExpectedWorkspace(t, expectedWorkspaceFor(t, awaitilities.Host(), users["bicycle"], true, appStudioTierRolesWSOption), *bicycleWS)
verifyHasExpectedWorkspace(t, expectedWorkspaceFor(t, awaitilities.Host(), users["bicycle"], commonproxy.WithType("home"), appStudioTierRolesWSOption), *bicycleWS)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! Thanks!

I've replaced the parameter with the option. Please see: 2fb797d

@openshift-ci
Copy link

openshift-ci bot commented Sep 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, MatousJobanek, mfrancisc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,alexeykazakov]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mfrancisc mfrancisc merged commit e0410f9 into codeready-toolchain:master Oct 2, 2023
@mfrancisc mfrancisc deleted the sbapi branch October 2, 2023 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants