Skip to content

1064 get user by login#1065

Merged
1 commit merged intogooddata:masterfrom
cipous:1064_get_user_by_login
Sep 1, 2021
Merged

1064 get user by login#1065
1 commit merged intogooddata:masterfrom
cipous:1064_get_user_by_login

Conversation

@cipous
Copy link
Copy Markdown

@cipous cipous commented Aug 26, 2021

fixes 1064
Its work in progress, please comment what tests are missing, not sure how to handle response in case of array of items.

@ghost
Copy link
Copy Markdown

ghost commented Aug 26, 2021

Build succeeded (check pipeline).

@cipous
Copy link
Copy Markdown
Author

cipous commented Aug 26, 2021

fixes #1065

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 26, 2021

Codecov Report

Merging #1065 (9026b52) into master (2aeea4a) will decrease coverage by 0.00%.
The diff coverage is 82.35%.

❗ Current head 9026b52 differs from pull request most recent head 6a55e1c. Consider uploading reports for the commit 6a55e1c to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1065      +/-   ##
============================================
- Coverage     83.12%   83.11%   -0.01%     
- Complexity     2597     2603       +6     
============================================
  Files           343      345       +2     
  Lines          6641     6658      +17     
  Branches        477      478       +1     
============================================
+ Hits           5520     5534      +14     
- Misses          925      927       +2     
- Partials        196      197       +1     
Impacted Files Coverage Δ
...n/java/com/gooddata/sdk/model/account/Account.java 78.84% <ø> (ø)
...m/gooddata/sdk/service/account/AccountService.java 77.61% <66.66%> (-1.70%) ⬇️
.../java/com/gooddata/sdk/model/account/Accounts.java 100.00% <100.00%> (ø)
...oddata/sdk/model/account/AccountsDeserializer.java 100.00% <100.00%> (ø)
.../sdk/service/account/AccountNotFoundException.java 85.71% <100.00%> (+10.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2aeea4a...6a55e1c. Read the comment docs.

Comment thread gooddata-java-model/src/main/java/com/gooddata/sdk/model/account/Accounts.java Outdated
Comment thread gooddata-java/src/main/java/com/gooddata/sdk/service/account/AccountService.java Outdated
@liry liry linked an issue Aug 27, 2021 that may be closed by this pull request
Comment thread gooddata-java-model/src/main/java/com/gooddata/sdk/model/account/Accounts.java Outdated
@ghost
Copy link
Copy Markdown

ghost commented Aug 27, 2021

Build succeeded (check pipeline).

Comment thread gooddata-java-model/src/main/java/com/gooddata/sdk/model/account/Accounts.java Outdated
Comment thread gooddata-java-model/src/main/java/com/gooddata/sdk/model/account/Accounts.java Outdated
Comment thread gooddata-java-model/src/main/java/com/gooddata/sdk/model/account/Accounts.java Outdated
@ghost
Copy link
Copy Markdown

ghost commented Aug 27, 2021

Build succeeded (check pipeline).

1 similar comment
@ghost
Copy link
Copy Markdown

ghost commented Aug 27, 2021

Build succeeded (check pipeline).

@cipous
Copy link
Copy Markdown
Author

cipous commented Aug 27, 2021

@liry not sure about AT, should I write something similar what is in IT?

@cipous cipous force-pushed the 1064_get_user_by_login branch from 60b54b0 to 1edd31f Compare August 27, 2021 07:15
@ghost
Copy link
Copy Markdown

ghost commented Aug 27, 2021

Build succeeded (check pipeline).

@cipous cipous force-pushed the 1064_get_user_by_login branch from 1edd31f to b987726 Compare August 27, 2021 07:16
@ghost
Copy link
Copy Markdown

ghost commented Aug 27, 2021

Build succeeded (check pipeline).

@cipous cipous force-pushed the 1064_get_user_by_login branch from b987726 to 0bb0bea Compare August 27, 2021 07:36
@ghost
Copy link
Copy Markdown

ghost commented Aug 27, 2021

Build succeeded (check pipeline).

@cipous
Copy link
Copy Markdown
Author

cipous commented Aug 27, 2021

@liry please any feedback? Thanks.

Copy link
Copy Markdown
Contributor

@liry liry left a comment

Choose a reason for hiding this comment

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

@liry not sure about AT, should I write something similar what is in IT?

@cipous I'm sorry for the delay, I somehow missed this comment.

In ATs, we usually verify the happy path of the service against real backend - i.e. I would add there similar test case to AccountServiceAT.getAccount. (We want to verify we haven't done a mistake in API mocks in IT's.)

We will also try to explain various test types better in the contributing guide: #1068 ;)

Comment thread gooddata-java/src/main/java/com/gooddata/sdk/service/account/AccountService.java Outdated
notNull(email, "email");
notNull(organizationName, "organizationName");
try {
return restTemplate.getForObject(Account.ACCOUNT_BY_EMAIL_URI, Accounts.class, organizationName, email);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here, we're trying to get exactly one account by specific email, right? So I would add check that exactly one account is in the response and then return only that one Account. (Throw if no user is returned.)

BTW, this resource is also able to list all domain accounts (w/o login filter), but such a service method can be added later.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ohh, I was thinking why it returns collection. ok will address your comments soon.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great, thank you

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I did not throw any error on more than one, as login should be unique.

Also could I use this PR to add constructor to Account with all values - like login?

public Account(final String login, final String email, final String password, final String firstName, final String lastName, final List<String> ipWhitelist, final List<String> authenticationModes) { this(login, email, password, password, firstName, lastName, ipWhitelist, authenticationModes, null); }

or should I create separate issue for this.

ALso please when do you expect release of both changes?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@liry please ^ I would like to merge asap so hopefully there is release soon, thanks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And what's the use case of such a constructor? If you're talking about some new service method, I would create separate issuer for that.

We can release new version for you right after this PR is merged ;)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have created separate PR https://github.com/gooddata/gooddata-java/pull/1071/files and issue.

It would be great, if you could release it together with these two changes. What we are aiming is to create user(get by login if does not exist) for given project, assign him some roles. We call it provisioning, with those 2 PR this should be possible with SDK only...

@ghost
Copy link
Copy Markdown

ghost commented Aug 31, 2021

Build succeeded (check pipeline).

Comment thread gooddata-java/src/main/java/com/gooddata/sdk/service/account/AccountService.java Outdated
Comment thread gooddata-java/src/main/java/com/gooddata/sdk/service/account/AccountService.java Outdated
Comment thread gooddata-java/src/main/java/com/gooddata/sdk/service/account/AccountService.java Outdated
@liry
Copy link
Copy Markdown
Contributor

liry commented Aug 31, 2021

And please squash your commits into one in the end because they are all about implementation of one service method. We will then merge it and release new version.

@ghost
Copy link
Copy Markdown

ghost commented Sep 1, 2021

Build succeeded (check pipeline).

Co-authored-by: Libor Ryšavý <liry@users.noreply.github.com>
@cipous cipous force-pushed the 1064_get_user_by_login branch from 9026b52 to 6a55e1c Compare September 1, 2021 06:52
@ghost
Copy link
Copy Markdown

ghost commented Sep 1, 2021

Build succeeded (check pipeline).

@cipous
Copy link
Copy Markdown
Author

cipous commented Sep 1, 2021

Thanks for fixing javadoc, I accepted your suggestions. Is there something else? (please with release wait for https://github.com/gooddata/gooddata-java/pull/1071/files). Thank you!

@liry liry added this to the next milestone Sep 1, 2021
@liry liry added the merge label Sep 1, 2021
@ghost ghost removed the merge label Sep 1, 2021
@ghost ghost merged commit ce310d6 into gooddata:master Sep 1, 2021
@ghost
Copy link
Copy Markdown

ghost commented Sep 1, 2021

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support get user by login email

3 participants