-
Notifications
You must be signed in to change notification settings - Fork 70
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
Respect the ScmComunicationException on token validation step #715
Conversation
99a8bc0
to
a914f58
Compare
/retest |
@vinokurig |
So, there are no restrictions related tests to merge PR. |
@@ -79,7 +83,7 @@ public void configure(NamespaceResolutionContext namespaceResolutionContext, Str | |||
| ScmConfigurationPersistenceException | |||
| UnsatisfiedScmPreconditionException | |||
| ScmUnauthorizedException e) { | |||
throw new RuntimeException(e); | |||
LOG.error(e.getMessage(), e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the benefits of logging error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not interrupt the workspace start in this case.
@@ -228,6 +235,8 @@ private <T> T executeRequest( | |||
throw new ScmBadRequestException(body); | |||
case HTTP_NOT_FOUND: | |||
throw new ScmItemNotFoundException(body); | |||
case HTTP_UNAUTHORIZED: | |||
throw new ScmUnauthorizedException(body, "github", "v1", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move constant somewhere else?
Copy/paste from github?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/paste from github?
right, fixed
Can we move constant somewhere else?
Could you please elaborate on this?
@@ -290,6 +296,8 @@ private <T> T executeRequest( | |||
throw new ScmBadRequestException(body); | |||
case HTTP_NOT_FOUND: | |||
throw new ScmItemNotFoundException(body); | |||
case HTTP_UNAUTHORIZED: | |||
throw new ScmUnauthorizedException(body, "github", "v1", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why v1 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to v2
corresponds to oauth version.
@@ -159,6 +163,8 @@ private <T> T executeRequest( | |||
throw new ScmBadRequestException(body); | |||
case HTTP_NOT_FOUND: | |||
throw new ScmItemNotFoundException(body); | |||
case HTTP_UNAUTHORIZED: | |||
throw new ScmUnauthorizedException(body, "github", "v1", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy/paste from github ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vinokurig great job, but can we make UX more informative - Error message should say that Github might be down + add a link to the statuspage - https://www.githubstatus.com/
76f172d
to
9d496cb
Compare
9d496cb
to
deda774
Compare
I've improved the notification text but unfortunately there is no quick way to have the link clickable in the warning notification, would that be ok in the scope of the issue? cc @olexii4 @akurinnoy |
We should either make the link clickable or just reword the warning without the link - |
@ibuziuk I have removed the links from the notification and opened an issue to be able to add links |
/retest |
@vinokurig: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: artaleks9, ibuziuk, tolusha, vinokurig The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Build 3.17 :: server_3.x/359: Console, Changes, Git Data |
Build 3.17 :: sync-to-downstream_3.x/7701: Console, Changes, Git Data |
Build 3.17 :: get-sources-rhpkg-container-build_3.x/7693: server : 3.x :: Failed in 64203004 : BREW:BUILD/STATUS:UNKNOWN |
What does this PR do?
ScmCommunicationException
on token validation step instead of returning invalid result.ScmCommunicationException
to the dashboard as anApiException
.ScmUnauthorizedException
on each scm api request with invalid token.RuntimeException
on workspace provision steps.Screenshot/screencast of this PR
What issues does this PR fix or reference?
eclipse-che/che#23076
How to test this PR?
quay.io/ivinokur/che-server:che-23076
The image is built with a modification: to simulate the unreachable SCM server I changed the api endpoint url in the GitHub api client:che-server/wsmaster/che-core-api-factory-github-common/src/main/java/org/eclipse/che/api/factory/server/github/GithubApiClient.java
Line 57 in e04d787
quay.io/eclipse/che-dashboard:pr-1179
See: a warning notification appears during workspace startup:
The workspace starts successfully.
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedRelease Notes
Reviewers
Reviewers, please comment how you tested the PR when approving it.