Skip to content

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

Open
Kevin-CB wants to merge 1 commit intojenkinsci:masterfrom
Kevin-CB:JENKINS-70035
Open

[JENKINS-70035] Use User.getById() instead of User.get()#194
Kevin-CB wants to merge 1 commit intojenkinsci:masterfrom
Kevin-CB:JENKINS-70035

Conversation

@Kevin-CB
Copy link
Copy Markdown
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
containsString(WILL_TRY_NEXT_CONFIGURATION),
containsString(planetExpress.getUrl())),
CoreMatchers.<Throwable>instanceOf(UserMayOrMayNotExistException2.class)));
CoreMatchers.<Throwable>instanceOf(AuthenticationServiceException.class)));
Copy link
Copy Markdown
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
Copy Markdown
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