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

Factories for private Gitlab repository with pre-created personal access token #19351

Merged
merged 8 commits into from
Mar 30, 2021
Merged

Factories for private Gitlab repository with pre-created personal access token #19351

merged 8 commits into from
Mar 30, 2021

Conversation

mshaposhnik
Copy link
Contributor

What does this PR do?

This PR allows to accept factories to private Gitlab repositories using pre-created personal access tokens stored as a secret inside the user namespace. Secret example is provided below:

kind: Secret
apiVersion: v1
metadata:
  annotations:
    che.eclipse.org/che-userid: 73a27d90-3d63-4d8c-a8c6-9b4a716c702a
    che.eclipse.org/expired-after: '-1'
    che.eclipse.org/scm-url: 'https://gitlab.apps.cluster-2ab2.2ab2.example.opentlc.com'
    che.eclipse.org/scm-userid: '1'
    che.eclipse.org/scm-username: root
  name: gitlab-personal-access-token-secret
  labels:
    app.kubernetes.io/component: scms-personal-access-token
    app.kubernetes.io/part-of: che.eclipse.org
data:
  token: Yzh5cEt6cURxUWVCa3FKazhtaHg=
type: Opaque

Screenshot/screencast of this PR

What issues does this PR fix or reference?

#19170

How to test this PR?

Prepare private Gitblab repository;
Create and save personal access token on Gitlab side;
Configure Che server to use Gitlab instance and prepare secret in user namespace;
Run factory to prevate repo. Factory should work.

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.

@mshaposhnik mshaposhnik requested review from sparkoo and removed request for nickboldt March 22, 2021 08:58
@che-bot che-bot added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/task Internal things, technical debt, and to-do tasks to be performed. labels Mar 22, 2021
@che-bot
Copy link
Contributor

che-bot commented Mar 22, 2021

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Copy link
Member

@sparkoo sparkoo left a comment

Choose a reason for hiding this comment

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

lgtm, few minor comments

new StringJoiner("/")
.add(hostName)
.add("api/v4/projects")
.add(username + "%2f" + project)
Copy link
Member

Choose a reason for hiding this comment

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

why this needs to be encoded as %2f ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's requirement of API:
image

@che-bot
Copy link
Contributor

che-bot commented Mar 24, 2021

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 24, 2021

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 25, 2021

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 25, 2021

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 25, 2021

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@mshaposhnik
Copy link
Contributor Author

[crw-ci-test]

@che-bot
Copy link
Contributor

che-bot commented Mar 29, 2021

❌ E2E Happy path tests failed ❗

See Details

Tested with Eclipse Che Multiuser User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@mshaposhnik mshaposhnik merged commit e99fcd7 into eclipse-che:master Mar 30, 2021
@mshaposhnik mshaposhnik deleted the gitlab_with_tokens branch March 30, 2021 11:19
@che-bot che-bot removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Mar 30, 2021
@che-bot che-bot added this to the 7.29 milestone Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants