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

gateway: add api to get authenticated user organizations #299

Merged

Conversation

tulliobotti64
Copy link
Contributor

Added in the Gateway the API /user/{userref}/orgs

Added some integration tests. Unit tests were done already

To fix the issue #292

@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch 2 times, most recently from 7cdad59 to 5411a9a Compare February 8, 2022 09:34
@tulliobotti64
Copy link
Contributor Author

Hi Simone, I've just rollback the API's name from /user/{userref}/orgs to /users/{userref}/orgs in configstore and fixed some lint issues on setup_test.go. It is ready to be reviewed. thanks

@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch 3 times, most recently from a5e0e90 to d8f42b8 Compare February 14, 2022 08:23
tests/setup_test.go Outdated Show resolved Hide resolved
tests/setup_test.go Outdated Show resolved Hide resolved
tests/setup_test.go Outdated Show resolved Hide resolved
internal/services/gateway/action/user.go Show resolved Hide resolved
@sgotti sgotti changed the title added API to get user organizations gateway: add api to get authenticated user organizations Feb 15, 2022
@sgotti
Copy link
Member

sgotti commented Feb 15, 2022

@tulliobotti64 Please also rename the commit to gateway: add api to get authenticated user organizations

@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch from e03912c to c01b943 Compare February 17, 2022 09:47
tests/setup_test.go Outdated Show resolved Hide resolved
tests/setup_test.go Outdated Show resolved Hide resolved
tests/setup_test.go Outdated Show resolved Hide resolved
tests/setup_test.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch 5 times, most recently from 6ba293f to 7dfc12c Compare February 18, 2022 10:58
tests/setup_test.go Outdated Show resolved Hide resolved
tests/setup_test.go Outdated Show resolved Hide resolved
@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch from 7dfc12c to ec4eab8 Compare February 18, 2022 11:34
@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch from ec4eab8 to d0d219c Compare February 18, 2022 11:37
@sgotti sgotti reopened this Feb 21, 2022
@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch 4 times, most recently from 60f075a to 5c737fd Compare February 21, 2022 09:47
@tulliobotti64
Copy link
Contributor Author

i've run both tests on my pc and I got no error. Can you try to restart Agola's run ? thanks

@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch 3 times, most recently from c5c3982 to bc7d9e1 Compare February 22, 2022 15:16
@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch from bc7d9e1 to 9e32d65 Compare February 23, 2022 11:54
}

if diff := cmp.Diff(expectedOrgs, orgs); diff != "" {
t.Fatalf("user orgs mismatch (-expected +got):\n%s", diff)
Copy link
Member

@sgotti sgotti Feb 23, 2022

Choose a reason for hiding this comment

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

For consistency use (-want +got)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, please review 👍

@@ -40,6 +40,7 @@ import (
gwapitypes "agola.io/agola/services/gateway/api/types"
gwclient "agola.io/agola/services/gateway/client"
rstypes "agola.io/agola/services/runservice/types"
"github.com/google/go-cmp/cmp"
Copy link
Member

Choose a reason for hiding this comment

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

Move this below with external packages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

gateway: add api to get authenticated user organizations

gateway: add api to get authenticated user organizations
@tulliobotti64 tulliobotti64 force-pushed the 16277-filter_user_by_organization branch from 9e32d65 to 7160194 Compare February 23, 2022 14:31
Copy link
Member

@sgotti sgotti left a comment

Choose a reason for hiding this comment

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

@tulliobotti64 Thanks! Merging.

@sgotti sgotti merged commit a199749 into agola-io:master Feb 23, 2022
@tulliobotti64 tulliobotti64 deleted the 16277-filter_user_by_organization branch March 14, 2022 08:39
tulliobotti64 pushed a commit to tulliobotti64/agola that referenced this pull request Oct 19, 2022
…by_organization

gateway: add api to get authenticated user organizations
tulliobotti64 pushed a commit to tulliobotti64/agola that referenced this pull request Oct 19, 2022
…by_organization

gateway: add api to get authenticated user organizations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants