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

[JENKINS-70035] Use User.getById() instead of User.get() #194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kevin-CB
Copy link
Contributor

@Kevin-CB Kevin-CB commented Nov 8, 2022

You can find more information in JENKINS-70035

I had to adapt LdapMultiEmbeddedTest#when_first_is_unavailable_and_ignorable_and_login_on_second_then_login & LdapMultiEmbeddedTest#when_first_is_wrong_and_ignorable_and_login_on_second_then_login to match AuthenticationServiceException and not UserMayOrMayNotExistException2 because they were not thrown anymore.

As I did not fully understand their uses, I would ask you to review this part carefully to make sure that I didn't broke them.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@Kevin-CB Kevin-CB requested a review from a team as a code owner November 8, 2022 13:11
@@ -340,7 +340,7 @@ public void when_first_is_wrong_and_ignorable_and_login_on_second_then_login() t
allOf(containsString(FAILED_COMMUNICATION_WITH_LDAP_SERVER),
containsString(WILL_TRY_NEXT_CONFIGURATION),
containsString(planetExpress.getUrl())),
CoreMatchers.<Throwable>instanceOf(UserMayOrMayNotExistException2.class)));
CoreMatchers.<Throwable>instanceOf(AuthenticationServiceException.class)));
Copy link
Member

@dwnusbaum dwnusbaum Nov 8, 2022

Choose a reason for hiding this comment

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

Sorry, but I do not remember if the specific exception type here is important (I would assume it does not matter though, and I doubt that the multi-server mode is used very frequently anyways). What is the full stack trace in the logs before and after the change? Maybe the only difference is that there is a new outermost exception?

Copy link
Member

Choose a reason for hiding this comment

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

UserMayOrMayNotExistException2 seems important as it is used to say "I can not tell you that this users exists. or not" and as such can allow the use of a token (wheras another excpetion would be treated as the form - this user does not exist).

At the very least I think some manual testing with user impersonation needs to occur when the server is down (before and after this change)

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.

3 participants