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

Implemented an ability to reject the authorisation opt-out flag from the dashboard #972

Merged
merged 5 commits into from Nov 21, 2023

Conversation

olexii4
Copy link
Contributor

@olexii4 olexii4 commented Nov 2, 2023

What does this PR do?

This PR adds the ability to reject the authorization opt-out flag from the dashboard. It revamps the Git Services tab on the User Preferences page to show the Git providers current authorization state (accepted, rejected, or neither), and adds a way to clear the rejected authorization flag for a provider.

Screencast
Git.providers.authorization.mp4
Screenshots

Screenshot 2023-11-14 at 11 38 31

Screenshot 2023-11-14 at 13 04 23

Screenshot 2023-11-14 at 13 04 36

Screenshot 2023-11-14 at 13 05 31

Screenshot 2023-11-14 at 13 05 41

What issues does this PR fix or reference?

fixes eclipse-che/che#22600

Is it tested? How?

  1. Deploy Eclipse Che and configure OAuth 2.0 for a Git provider
  2. Open the Git Services tab and check the Git provider authorization state, it should be neither accepted nor rejected.
  3. Start creating a new workspace from the remote repository, and reject the authorization request.
  4. Open the Git Services tab and check the provider authorization state, it should be rejected.
  5. Open the actions list and click the Clear button to remove the authorization flag for the selected provider.
  6. Start creating a new workspace from the remote repository, and accept the authorization request.
  7. Open the Git Services tab and the provider authorization state, it should be accepted.

Copy link

openshift-ci bot commented Nov 2, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@che-bot
Copy link
Contributor

che-bot commented Nov 2, 2023

Click here to review and test in web IDE: Contribute

Copy link

github-actions bot commented Nov 8, 2023

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-972

2 similar comments
Copy link

github-actions bot commented Nov 8, 2023

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-972

Copy link

github-actions bot commented Nov 8, 2023

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-972

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@olexii4 olexii4 force-pushed the CHE-22600 branch 2 times, most recently from 2fbcad0 to c57ec26 Compare November 10, 2023 13:34
@eclipse-che eclipse-che deleted a comment from codecov bot Nov 10, 2023
@olexii4 olexii4 force-pushed the CHE-22600 branch 2 times, most recently from f438348 to f4114b8 Compare November 10, 2023 13:54
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Attention: 195 lines in your changes are missing coverage. Please review.

Comparison is base (4e2738d) 85.15% compared to head (1abef30) 84.96%.
Report is 7 commits behind head on main.

Files Patch % Lines
...shboard-frontend/src/store/GitOauthConfig/index.ts 61.25% 62 Missing ⚠️
...spaceClient/services/devWorkspacePreferencesApi.ts 37.89% 59 Missing ⚠️
...d-frontend/src/services/backend-client/oAuthApi.ts 26.08% 17 Missing ⚠️
...src/pages/UserPreferences/GitServicesTab/index.tsx 80.26% 15 Missing ⚠️
...ard-backend/src/routes/api/workspacePreferences.ts 79.03% 13 Missing ⚠️
...rPreferences/GitServicesTab/ProviderIcon/index.tsx 93.51% 7 Missing ⚠️
...hboard-frontend/src/store/FactoryResolver/index.ts 0.00% 7 Missing ⚠️
...ackages/dashboard-backend/src/models/restParams.ts 0.00% 5 Missing ⚠️
...s/UserPreferences/ContainerRegistriesTab/index.tsx 66.66% 3 Missing ⚠️
...frontend/src/services/backend-client/factoryApi.ts 0.00% 3 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #972      +/-   ##
==========================================
- Coverage   85.15%   84.96%   -0.20%     
==========================================
  Files         380      384       +4     
  Lines       39189    39723     +534     
  Branches     2522     2545      +23     
==========================================
+ Hits        33373    33752     +379     
- Misses       5789     5944     +155     
  Partials       27       27              
Flag Coverage Δ
unittests 84.96% <70.27%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-972

Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
@ibuziuk ibuziuk requested a review from tolusha November 13, 2023 13:55
@ibuziuk
Copy link
Member

ibuziuk commented Nov 13, 2023

@olexii4 could you please provide more details in the PR description e.g. demo / mockups / how to verify etc?
we might be able to address eclipse-che/che#22631 as part of this PR cc: @tolusha PR needs your approval

  • all configured git services should be shown under the GitServices Tab and persist after che-server restarts
  • if the service is authorized we should probably show some indicator e.g. green check mark

Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
@akurinnoy
Copy link
Contributor

@ibuziuk Since Oleksii is on PTO I'm going to update the description

Copy link

Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-972

Copy link
Contributor

@dmytro-ndp dmytro-ndp left a comment

Choose a reason for hiding this comment

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

PR looks good to merge, because I was able to reject GitLab OAuth access token using Che > Dashboard > User Preferences > Git Services tab, which is the goal of the PR.

@akurinnoy
Copy link
Contributor

@dmytro-ndp

Do you know which Git provider token the Che Dashboard is able to revoke?

GitHub and Bitbucket should be able to.

Copy link

openshift-ci bot commented Nov 21, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akurinnoy, dmytro-ndp, ibuziuk, olexii4, tolusha

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@olexii4 olexii4 merged commit e5c7031 into main Nov 21, 2023
15 of 17 checks passed
@olexii4 olexii4 deleted the CHE-22600 branch November 21, 2023 12:11
@devstudio-release
Copy link

Build 3.11 :: dashboard_3.x/400: Console, Changes, Git Data

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.11 :: dashboard_3.x/400: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/5336 triggered

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

@devstudio-release
Copy link

Build 3.11 :: copyIIBsToQuay/2176: Console, Changes, Git Data

@devstudio-release
Copy link

Build 3.11 :: sync-to-downstream_3.x/5338: SUCCESS

Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/5199 triggered; /job/DS_CI/job/dsc_3.x triggered;

@devstudio-release
Copy link

Build 3.11 :: operator-bundle_3.x/2306: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/5338 triggered

@devstudio-release
Copy link

Build 3.11 :: dsc_3.x/1572: Console, Changes, Git Data

@devstudio-release
Copy link

Build 3.11 :: update-digests_3.x/4966: SUCCESS

Detected new images: rebuild operator-bundle
* dashboard; /DS_CI/operator-bundle_3.x/2306 triggered

@devstudio-release
Copy link

Build 3.11 :: dsc_3.x/1572: SUCCESS

3.11.0-CI

@devstudio-release
Copy link

Build 3.11 :: copyIIBsToQuay/2176: SUCCESS

3.11
arches = x86_64, s390x, ppc64le;
  * LATEST DS OPERATOR BUNDLE = <a href=https://quay.io/repository/devspaces/devspaces-operator-bundle?tab=tags>registry-proxy.engineering.redhat.com/rh-osbs/devspaces-operator-bundle:3.11-81
  * LATEST DWO OPERATOR BUNDLE = <a href=https://quay.io/repository/devworkspace/devworkspace-operator-bundle?tab=tags>registry-proxy.engineering.redhat.com/rh-osbs/devworkspace-operator-bundle:0.21-7
+ s390x-rhel8 IIB(s) copied:
  + quay.io/devspaces/iib:3.11-v4.14-625582-533291-s390x
  + quay.io/devspaces/iib:3.11-v4.14-s390x
  + quay.io/devspaces/iib:next-v4.14-s390x
  + quay.io/devspaces/iib:3.11-v4.13-625734-533286-s390x
  + quay.io/devspaces/iib:3.11-v4.13-s390x
  + quay.io/devspaces/iib:next-v4.13-s390x
  + quay.io/devspaces/iib:3.11-v4.12-625721-533281-s390x
  + quay.io/devspaces/iib:3.11-v4.12-s390x
  + quay.io/devspaces/iib:next-v4.12-s390x
  + quay.io/devspaces/iib:3.11-v4.11-625713-533277-s390x
  + quay.io/devspaces/iib:3.11-v4.11-s390x
  + quay.io/devspaces/iib:next-v4.11-s390x
+ x86_64-rhel8 IIB(s) copied:
  + quay.io/devspaces/iib:3.11-v4.14-625582-533291-x86_64
  + quay.io/devspaces/iib:3.11-v4.14-x86_64
  + quay.io/devspaces/iib:next-v4.14-x86_64
  + quay.io/devspaces/iib:3.11-v4.13-625734-533286-x86_64
  + quay.io/devspaces/iib:3.11-v4.13-x86_64
  + quay.io/devspaces/iib:next-v4.13-x86_64
  + quay.io/devspaces/iib:3.11-v4.12-625721-533281-x86_64
  + quay.io/devspaces/iib:3.11-v4.12-x86_64
  + quay.io/devspaces/iib:next-v4.12-x86_64
  + quay.io/devspaces/iib:3.11-v4.11-625713-533277-x86_64
  + quay.io/devspaces/iib:3.11-v4.11-x86_64
  + quay.io/devspaces/iib:next-v4.11-x86_64
+ ppc64le-rhel8 IIB(s) copied:
  + quay.io/devspaces/iib:3.11-v4.14-625736-533291-ppc64le
  + quay.io/devspaces/iib:3.11-v4.14-ppc64le
  + quay.io/devspaces/iib:next-v4.14-ppc64le
  + quay.io/devspaces/iib:3.11-v4.13-625734-533286-ppc64le
  + quay.io/devspaces/iib:3.11-v4.13-ppc64le
  + quay.io/devspaces/iib:next-v4.13-ppc64le
  + quay.io/devspaces/iib:3.11-v4.12-625721-533281-ppc64le
  + quay.io/devspaces/iib:3.11-v4.12-ppc64le
  + quay.io/devspaces/iib:next-v4.12-ppc64le
  + quay.io/devspaces/iib:3.11-v4.11-625713-533277-ppc64le
  + quay.io/devspaces/iib:3.11-v4.11-ppc64le
  + quay.io/devspaces/iib:next-v4.11-ppc64le

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
7 participants