-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
errors getting raw url as part of RO Bundle for not GitHub / GitLab repos #488
Comments
Perhaps GitLab style hosts could be detected by a well known path or API? |
Oh, that sounds like an interesting problem. Let me check if I can find a way to tell whether a URL is GitHub, BitBucket, or GitLab (I have an idea on how to find it 😬 ) |
Alright, my first idea flopped. I remembered that in Jenkins you could use GitLab, BitBucket, or GitHub. I thought they had already found a way to identify the server for a given URL, but looks like they only identify the cloud versions (i.e. github.com/, gitlab.com/, and bitbucket.org/*). |
Second idea was to identify the repository based on refs. Pull requests generate a refs/pull/$ID, and merge requests generate something like refs/merge-requests/$ID. I think in bitbucket it's something else like refs/pull-requests/$ID. But if you have pull/merge requests disabled, or if you have no open requests, then I believe the Maybe we could query for commits? In a GitHub repository, the URL will be something like: I think the logic would be to first check the host name for GitHub.com, GitLab.com, or BitBucket.org. If that fails, then curl for this commits URL. Finally throw an error as we couldn't identify the server type. WDYT @mr-c? |
Github is only github.com (I know of no other public installations); likewise for bitbucket. Therefore it is just self-hosted GitLab that needs detecting; so maybe try |
At NIWA we thought about the enterprise option, but it was too expensive at the time (some of the code was for-profit, or mixed). Unis and not for profit had a special price for the enterprise if I recall? I remember we had access to the silver plan as we were a research institution (at that time only silver gave private repos, nowadays everybody has access to it), so that's what we got. Now I think besides the big FAANG companies, not for profit and some unis might have github enterprise installed, e.g. But I think we can skip it and implement it later if needed, especially as I am not sure if any of these unis host public repositories (in GitLab I can choose whether my projects are public/private/internal, no idea about github enterprise).
A telco I worked with briefly in New Zealand used the BitBucket server (I think other NZ companies used it due to Atlassian being from Aus - the complete Atlassian suite with confluence/jira/bitbucket/bamboo/etc wasn't very expensive some time ago).
Oh, using the API is a good idea, didn't think about that one. Could be too. Not sure if everybody is on v4. I assume when a v5 is available, v4 will keep working too (? or maybe users can enable/disable older api versions?), so this might be a good idea.
I think they may be using an older version of GitLab? Note, however, that v2 does not work 😄 My URL |
TIL! I thought all hosted or on-premise GitHub/Bitbucket services were private
There could be enough signal even in "failed" attempts. For example For GitLab detection, I suggest trying a variety of endpoints, checking for a gitlab cooke, valid response, or other signal; |
Sounds good to me! We can then iterate and improve based on used feedback. |
{'url': 'https://gitlab.bsc.es/lrodrig1/structuralvariants_poc.git', 'branch': '1.0.7', 'path': 'structuralvariants/cwl/subworkflows/bwa_index.cwl'}
Due to not detecting that https://gitlab.bsc.es is a GitLab based host
cwlviewer/src/main/java/org/commonwl/view/git/GitDetails.java
Line 98 in 91a06b9
cwlviewer/src/main/java/org/commonwl/view/git/GitDetails.java
Lines 195 to 196 in 91a06b9
A harder example:
{'url': 'https://git.wur.nl/unlock/cwl.git', 'branch': 'master', 'path': 'cwl/workflows/workflow_indexbuilder.cwl'}
(also GitLab based host)This raw URL is needed to pack the workflow; why aren't we using the local git checkout?
cwlviewer/src/main/java/org/commonwl/view/researchobject/ROBundleService.java
Lines 203 to 204 in 91a06b9
The text was updated successfully, but these errors were encountered: