-
Notifications
You must be signed in to change notification settings - Fork 332
Fs 897 partial success for list users #3117
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
Merged
mdimjasevic
merged 14 commits into
wireapp:develop
from
lepsa:FS-897-partial-success-for-list-users
Apr 3, 2023
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7ce12e0
FS-879 Adding a new list-users route that can return partial successes
lepsa fd50d79
Merge remote-tracking branch 'origin/develop' into FS-897-partial-suc…
lepsa 5a16c53
HI CI
elland 761f2a5
Lint+format
elland f12495d
FS-897: Updates before pulling in upstream changes
lepsa d00881d
Merge remote-tracking branch 'origin' into FS-897-partial-success-for…
lepsa a734dab
FS-897: Merging in upstream changes and adding golden tests
lepsa 2e17c53
FS-897: Updating an integration test, setting API version.
lepsa 8b92905
FS-897: Updating tests and types to remove an edge case in output.
lepsa e171a3c
FS-897: Fixing tests and moving files
lepsa 0b99b16
Merge remote-tracking branch 'origin/develop' into FS-897-partial-suc…
lepsa 2a1f51f
Merge remote-tracking branch 'origin/develop' into FS-897-partial-suc…
lepsa 9e274cc
FS-897: PR formatting
lepsa 9abda4b
FS-897: Updating names to reflect their api version
lepsa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Adding a new version of /list-users that allows for partial success. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/ListUsersById.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| {-# LANGUAGE OverloadedLists #-} | ||
|
|
||
| -- This file is part of the Wire Server implementation. | ||
| -- | ||
| -- Copyright (C) 2022 Wire Swiss GmbH <opensource@wire.com> | ||
| -- | ||
| -- This program is free software: you can redistribute it and/or modify it under | ||
| -- the terms of the GNU Affero General Public License as published by the Free | ||
| -- Software Foundation, either version 3 of the License, or (at your option) any | ||
| -- later version. | ||
| -- | ||
| -- This program is distributed in the hope that it will be useful, but WITHOUT | ||
| -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| -- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
| -- details. | ||
| -- | ||
| -- You should have received a copy of the GNU Affero General Public License along | ||
| -- with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
|
||
| module Test.Wire.API.Golden.Manual.ListUsersById where | ||
|
|
||
| import Data.Domain | ||
| import Data.Id | ||
| import Data.LegalHold | ||
| import Data.Qualified | ||
| import qualified Data.UUID as UUID | ||
| import Imports | ||
| import Wire.API.User | ||
|
|
||
| domain1, domain2 :: Domain | ||
| domain1 = Domain "example.com" | ||
| domain2 = Domain "test.net" | ||
|
|
||
| user1, user2 :: UserId | ||
| user1 = Id . fromJust $ UUID.fromString "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
| user2 = Id . fromJust $ UUID.fromString "eb48b095-d96f-4a94-b4ec-2a1d61447e13" | ||
|
|
||
| profile1, profile2 :: UserProfile | ||
| profile1 = | ||
| UserProfile | ||
| { profileQualifiedId = Qualified user1 domain1, | ||
| profileName = Name "user1", | ||
| profilePict = Pict [], | ||
| profileAssets = [], | ||
| profileAccentId = ColourId 0, | ||
| profileDeleted = False, | ||
| profileService = Nothing, | ||
| profileHandle = Nothing, | ||
| profileExpire = Nothing, | ||
| profileTeam = Nothing, | ||
| profileEmail = Nothing, | ||
| profileLegalholdStatus = UserLegalHoldDisabled | ||
| } | ||
| profile2 = | ||
| UserProfile | ||
| { profileQualifiedId = Qualified user2 domain2, | ||
| profileName = Name "user2", | ||
| profilePict = Pict [], | ||
| profileAssets = [], | ||
| profileAccentId = ColourId 0, | ||
| profileDeleted = False, | ||
| profileService = Nothing, | ||
| profileHandle = Nothing, | ||
| profileExpire = Nothing, | ||
| profileTeam = Nothing, | ||
| profileEmail = Nothing, | ||
| profileLegalholdStatus = UserLegalHoldDisabled | ||
| } | ||
|
|
||
| testObject_ListUsersById_user_1 :: ListUsersById | ||
| testObject_ListUsersById_user_1 = ListUsersById mempty Nothing | ||
|
|
||
| testObject_ListUsersById_user_2 :: ListUsersById | ||
| testObject_ListUsersById_user_2 = | ||
| ListUsersById | ||
| { listUsersByIdFound = [profile1, profile2], | ||
| listUsersByIdFailed = Nothing | ||
| } | ||
|
|
||
| testObject_ListUsersById_user_3 :: ListUsersById | ||
| testObject_ListUsersById_user_3 = | ||
| ListUsersById | ||
| { listUsersByIdFound = [profile1], | ||
| listUsersByIdFailed = pure $ [Qualified user2 domain2] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| { "found" : [] } |
25 changes: 25 additions & 0 deletions
25
libs/wire-api/test/golden/testObject_ListUsersById_user_2.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { "found" : | ||
| [ { "qualified_id" : | ||
| { "domain" : "example.com" | ||
| , "id" : "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
| } | ||
| , "id" : "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
| , "name" : "user1" | ||
| , "picture" : [] | ||
| , "assets" : [] | ||
| , "accent_id" : 0 | ||
| , "legalhold_status" : "disabled" | ||
| } | ||
| , { "qualified_id" : | ||
| { "domain" : "test.net" | ||
| , "id" : "eb48b095-d96f-4a94-b4ec-2a1d61447e13" | ||
| } | ||
| , "id" : "eb48b095-d96f-4a94-b4ec-2a1d61447e13" | ||
| , "name" : "user2" | ||
| , "picture" : [] | ||
| , "assets" : [] | ||
| , "accent_id" : 0 | ||
| , "legalhold_status" : "disabled" | ||
| } | ||
| ] | ||
| } |
19 changes: 19 additions & 0 deletions
19
libs/wire-api/test/golden/testObject_ListUsersById_user_3.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { "found" : | ||
| [ { "qualified_id" : | ||
| { "domain" : "example.com" | ||
| , "id" : "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
| } | ||
| , "id" : "4f201a43-935e-4e19-8fe0-0a878d3d6e74" | ||
| , "name" : "user1" | ||
| , "picture" : [] | ||
| , "assets" : [] | ||
| , "accent_id" : 0 | ||
| , "legalhold_status" : "disabled" | ||
| } | ||
| ] | ||
| , "failed" : | ||
| [ { "domain" : "test.net" | ||
| , "id" : "eb48b095-d96f-4a94-b4ec-2a1d61447e13" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.