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

Use HTTP response status code to check gitlab repositories accessibility #741

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Nov 18, 2024

What does this PR do?

Improve the isPublicRepository() function in the GitlabAuthorizingFileContentProvider class to check the http response status code. The previous way with the urlFetcher does not work because gitlab server returns a content of an html page with credentials input instead of an error.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-7608

How to test this PR?

  1. Deploy che with the pull request image: quay.io/eclipse/che-server:pr-741
  2. Start a workspace from a private gitlab server repository.

See: workspace start fails with the expected error message:
screenshot-eclipse-che_apps_rosa_p9t96-996tb-ydw_ylq7_p3_openshiftapps_com-2024_11_18-12_43_37

PR Checklist

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

Release Notes

With this fix workspace start from a private gitlab repository will interrupt with an error if no token is present.

Reviewers

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

@vinokurig
Copy link
Contributor Author

/retest

@artaleks9
Copy link
Contributor

Verified on Eclipse Che with quay.io/eclipse/che-server:pr-741

The functionality works properly.

Copy link

openshift-ci bot commented Nov 19, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@openshift-ci openshift-ci bot removed the lgtm label Nov 19, 2024
Copy link

openshift-ci bot commented Nov 19, 2024

New changes are detected. LGTM label has been removed.

@vinokurig
Copy link
Contributor Author

/retest

@vinokurig vinokurig merged commit b49283d into main Nov 19, 2024
28 checks passed
@vinokurig vinokurig deleted the CRW-7608 branch November 19, 2024 15:19
@devspacesbuild
Copy link

Build 3.18 :: server_3.x/373: Console, Changes, Git Data

vinokurig added a commit that referenced this pull request Nov 19, 2024
…ity (#741)

Improve the isPublicRepository() function in the GitlabAuthorizingFileContentProvider class to check the http response status code. The previous way with the urlFetcher does not work because gitlab server returns a content of an html page with credentials input instead of an error.
vinokurig added a commit that referenced this pull request Nov 19, 2024
…ity (#741)

Improve the isPublicRepository() function in the GitlabAuthorizingFileContentProvider class to check the http response status code. The previous way with the urlFetcher does not work because gitlab server returns a content of an html page with credentials input instead of an error.
vinokurig added a commit that referenced this pull request Nov 19, 2024
…ity (#741)

Improve the isPublicRepository() function in the GitlabAuthorizingFileContentProvider class to check the http response status code. The previous way with the urlFetcher does not work because gitlab server returns a content of an html page with credentials input instead of an error.
@devspacesbuild
Copy link

@devspacesbuild
Copy link

vinokurig added a commit that referenced this pull request Nov 19, 2024
…ity (#741)

Improve the isPublicRepository() function in the GitlabAuthorizingFileContentProvider class to check the http response status code. The previous way with the urlFetcher does not work because gitlab server returns a content of an html page with credentials input instead of an error.
dmytro-ndp pushed a commit that referenced this pull request Nov 19, 2024
…ity (#741) (#742)

Improve the isPublicRepository() function in the GitlabAuthorizingFileContentProvider class to check the http response status code. The previous way with the urlFetcher does not work because gitlab server returns a content of an html page with credentials input instead of an error.
dmytro-ndp pushed a commit that referenced this pull request Nov 19, 2024
…ity (#741) (#743)

Improve the isPublicRepository() function in the GitlabAuthorizingFileContentProvider class to check the http response status code. The previous way with the urlFetcher does not work because gitlab server returns a content of an html page with credentials input instead of an error.
@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.18 :: server_3.x/373: SUCCESS

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

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.18 :: get-sources-rhpkg-container-build_3.x/8190: FAILURE

devspaces-operator-bundle : 3.x :: Failed in 65956395 : BREW:BUILD/STATUS:UNKNOWN
FAILURE:; copied to quay

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

Successfully merging this pull request may close these issues.

4 participants