Skip to content
Snippets Groups Projects
Unverified Commit 31988947 authored by Sebastian Poxhofer's avatar Sebastian Poxhofer Committed by GitHub
Browse files

fix(manager/ansible-galaxy): handle collections with http git references (#25568)

parent 01c9ccc4
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,12 @@ collections:
version: 1.2.2
type: git
# explicit git repo
- name: namespace.mycollection
version: 3.0.0
type: git
source: https://example.com/organization/repo_name.git
# appendix style version definition
- name: https://example.com/organization/repo_name.git,1.2.2
......
......@@ -32,6 +32,13 @@ exports[`modules/manager/ansible-galaxy/extract extractPackageFile() check colle
"depType": "galaxy-collection",
"packageName": "https://example.com/organization/repo_name.git",
},
{
"currentValue": "3.0.0",
"datasource": "git-tags",
"depName": "namespace.mycollection",
"depType": "galaxy-collection",
"packageName": "https://example.com/organization/repo_name.git",
},
{
"currentValue": "1.2.2",
"datasource": "git-tags",
......
......@@ -30,7 +30,7 @@ function interpretLine(
}
case 'source': {
localDependency.managerData.source = value;
if (value?.startsWith('git@')) {
if (value?.startsWith('git@') || value?.endsWith('.git')) {
localDependency.packageName = value;
} else {
localDependency.registryUrls = value
......
......@@ -66,7 +66,7 @@ describe('modules/manager/ansible-galaxy/extract', () => {
it('check collection style requirements file', () => {
const res = extractPackageFile(collections1, 'requirements.yml');
expect(res?.deps).toMatchSnapshot();
expect(res?.deps).toHaveLength(13);
expect(res?.deps).toHaveLength(14);
expect(res?.deps.filter((value) => value.skipReason)).toHaveLength(6);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment