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

Create tests to check 'Git zero-config' flow as PR checks #494

Merged
merged 58 commits into from
May 22, 2023
Merged

Conversation

artaleks9
Copy link
Contributor

@artaleks9 artaleks9 commented Apr 10, 2023

What does this PR do?

  1. there are created test accounts with a public and private repositories with a simple devfile.yaml inside, like:
schemaVersion: 2.1.0
metadata:
  name: public-repo-wksp-testname

or

schemaVersion: 2.1.0
metadata:
  name: private-repo-wksp-testname
  1. a check of factory resolver by API for public/private repository git providers with NO setup PAT/OAuth
  2. launch a workspace with test git provider Url repository and check of clone a project as git flow with NO setup PAT/OAuth
  • Adds additional file htpasswd Provider.yaml needed to configure environment
  • Adds additional file devworkspace-test.yaml needed to create a test workspace:
kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: ws-name
spec:
  started: true
  template:
    projects:
      - name: project-name
        git:
          remotes:
            origin: git-repo-url
  contributions:
    - name: che-code
      uri: https://eclipse-che.github.io/che-plugin-registry/main/v3/plugins/che-incubator/che-code/latest/devfile.yaml
      components:
        - name: che-code-runtime-description
          container:
            env:
              - name: CODE_HOST
                value: 0.0.0.0
  • Upadtes 'build-pr-check.yml' GitHub action to get che-server docker image with PR changes:

eclipse-che-server-·-Quay

Screenshot/screencast of this PR

ci-pr-checks-che-server

What issues does this PR fix or reference?

eclipse-che/che#21753

How to test this PR?

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.

@artaleks9
Copy link
Contributor Author

/retest

@artaleks9 artaleks9 requested a review from ScrewTSW April 21, 2023 08:08
@artaleks9 artaleks9 changed the title [WIP]: Create tests to check 'Git zero-config' flow as PR checks Create tests to check 'Git zero-config' flow as PR checks Apr 21, 2023
@dmytro-ndp
Copy link
Contributor

dmytro-ndp commented Apr 21, 2023

@artaleks9 : do you have logs of successful and failed PR check execution to share?
It's needed to review test scenario execution, and make sure there is no false positive / negative test verdict at the end.

It's also not clear which particular scenario the test is executing:

  • which test repo is used to run the test
  • which factory URL is used to run the test
  • will there PAT or OAuth flow (accepted, refused) scenario be covered?

@artaleks9
Copy link
Contributor Author

artaleks9 commented Apr 21, 2023

Updated: I can carefully say, it seems, there is possible to execute setup PAT and check appropriate clone a public/private repository already with PAT.

Copy link
Contributor

@svor svor left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci openshift-ci bot added the lgtm label May 2, 2023
@dmytro-ndp
Copy link
Contributor

@artaleks9: thanks for the answers!
I would suggest to express it somewhere, that this MR is introducing some kind of smoke test of factory resolver, to avoid confusing.
E.g., it could be expressed in test name, like test-github-without-oauth-pat-setup-flow.sh

@ibuziuk
Copy link
Member

ibuziuk commented May 17, 2023

@artaleks9 @dmytro-ndp folks, can we merge this PR now?

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.

Looks good to merge.

@openshift-ci openshift-ci bot removed the lgtm label May 19, 2023
@artaleks9
Copy link
Contributor Author

artaleks9 commented May 19, 2023

The last updates includes:

  • rename exist tests to no-pat-oauth-flow as proposed by @dmytro-ndp
  • refactor the method testProjectIsCloned as proposed by @dmytro-ndp
  • add the test template pat-secret.yaml to .ci/openshift-ci in che-server repository
  • add new tests to check git-flow with PAT setup in .ci/openshift-ci of che-server repository
  • update configuration in Openshift CI to add new tests -> Update 'che-server' component
  • add new methods to implement PAT setup in the common.sh script :
    -- initialize an <user-che> namespace by che-server API
    -- create the PAT secret in an <user-che> namespace
    -- check the git-credentials in a running workspace

@artaleks9
Copy link
Contributor Author

/retest

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.

New changes look good to merge.

Thanks for the handling feedback, @artaleks9

@openshift-ci openshift-ci bot added the lgtm label May 22, 2023
@openshift-ci
Copy link

openshift-ci bot commented May 22, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: artaleks9, dmytro-ndp, ibuziuk, svor

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

@artaleks9 artaleks9 merged commit 3b74041 into main May 22, 2023
@artaleks9 artaleks9 deleted the che#21753 branch May 22, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants