che-server icon indicating copy to clipboard operation
che-server copied to clipboard

Remove redundan PATs on refresh mode

Open vinokurig opened this issue 1 year ago • 3 comments

What does this PR do?

Iterate over personal access token secrets on refresh function. Remove outdated token secrets except the latest refreshed token secret.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

fixes https://github.com/eclipse-che/che/issues/23027

How to test this PR?

  • Deploy che with the pr image: quay.io/eclipse/che-server:pr-
  • Configure gitlab oauth
  • Apply refresh mode
  • Start a workspace from gitlab repository with a devfile.
  • Go to Dashboard user preferences -> personal access tokens
  • See: only one personal access token item is present in the list

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

vinokurig avatar Jul 18 '24 11:07 vinokurig

/retest

artaleks9 avatar Jul 19 '24 07:07 artaleks9

The tests on ci-openshift are fail with an error like this:

INFO[2024-07-19T08:48:41Z] Running step bitbucket-no-pat-oauth-flow-ipi-conf. 
INFO[2024-07-19T08:48:41Z] Step phase pre failed after 0s. 

There is some an infrastructure problem.

artaleks9 avatar Jul 19 '24 09:07 artaleks9

/retest

vinokurig avatar Jul 19 '24 11:07 vinokurig

The gitlab-with-oauth-setup-flow test is fail by another infrastructure problem:

level=info msg=Creating infrastructure resources...
level=error
level=error msg=Error: creating EC2 VPC Endpoint (com.amazonaws.us-west-1.s3): VpcEndpointLimitExceeded: The maximum number of VPC endpoints has been reached.
level=error msg=	status code: 400, request id: 4994f22a-87bd-43d9-b0f8-189b45686ca5

Need to rerun it. The rest of ci-openshift tests are success.

artaleks9 avatar Jul 19 '24 14:07 artaleks9

/retest

artaleks9 avatar Jul 19 '24 14:07 artaleks9

Verified on Eclipse Che with quay.io/eclipse/che-server:pr-703 - the functionality works properly. Waiting for restart gitlab-with-oauth-setup-flow test till approving.

artaleks9 avatar Jul 19 '24 14:07 artaleks9

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: artaleks9, ibuziuk, 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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Jul 22 '24 13:07 openshift-ci[bot]

Build 3.16 :: server_3.x/347: SUCCESS

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

devstudio-release avatar Jul 23 '24 09:07 devstudio-release

Build 3.16 :: sync-to-downstream_3.x/7295: SUCCESS

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

devstudio-release avatar Jul 23 '24 09:07 devstudio-release

Build 3.16 :: operator-bundle_3.x/3350: SUCCESS

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

devstudio-release avatar Jul 23 '24 09:07 devstudio-release

Build 3.16 :: update-digests_3.x/7117: SUCCESS

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

devstudio-release avatar Jul 23 '24 09:07 devstudio-release

Build 3.16 :: dsc_3.x/1947: SUCCESS

3.16.0-CI

devstudio-release avatar Jul 23 '24 09:07 devstudio-release