diff --git a/lib/modules/datasource/galaxy/__fixtures__/timezone b/lib/modules/datasource/galaxy/__fixtures__/timezone deleted file mode 100644 index c926af82dd17f6206fee8ad8787d63421a86d0ab..0000000000000000000000000000000000000000 --- a/lib/modules/datasource/galaxy/__fixtures__/timezone +++ /dev/null @@ -1,138 +0,0 @@ -{ - "count": 1, - "next": null, - "next_link": null, - "previous": null, - "previous_link": null, - "results": [ - { - "id": 1429, - "url": "/api/v1/roles/1429/", - "related": { - "content_type": "/api/v1/content_types/11/", - "dependencies": "/api/v1/roles/1429/dependencies/", - "imports": "/api/v1/roles/1429/imports/" - }, - "summary_fields": { - "content_type": { - "id": 11, - "name": "role", - "description": "Role" - }, - "dependencies": [], - "namespace": { - "id": 2193, - "name": "yatesr", - "avatar_url": "https://avatars1.githubusercontent.com/u/3984903?v=4", - "location": null, - "company": null, - "email": null, - "html_url": "https://github.com/yatesr", - "is_vendor": false - }, - "platforms": [ - { - "name": "Debian", - "release": "jessie" - }, - { - "name": "Debian", - "release": "squeeze" - }, - { - "name": "Debian", - "release": "wheezy" - }, - { - "name": "EL", - "release": "6" - }, - { - "name": "EL", - "release": "7" - }, - { - "name": "Fedora", - "release": "19" - }, - { - "name": "Fedora", - "release": "20" - }, - { - "name": "Ubuntu", - "release": "precise" - }, - { - "name": "Ubuntu", - "release": "trusty" - } - ], - "provider_namespace": { - "id": 2174, - "name": "yatesr" - }, - "repository": { - "id": 27861, - "name": "timezone", - "original_name": "ansible-timezone", - "stargazers_count": 18, - "watchers_count": 3, - "forks_count": 15, - "open_issues_count": 3, - "travis_status_url": "", - "travis_build_url": "", - "format": "role", - "deprecated": false, - "community_score": null, - "quality_score": 5.0, - "community_survey_count": 0 - }, - "tags": [ - "system" - ], - "versions": [ - { - "id": 7863, - "name": "1.0.0", - "release_date": "2015-11-17T00:43:42Z" - }, - { - "id": 38901, - "name": "1.1.0", - "release_date": "2017-09-25T00:27:37Z" - }, - { - "id": 107503, - "name": "1.2.0", - "release_date": "2019-10-28T01:40:43Z" - } - ], - "videos": [] - }, - "created": "2014-08-21T17:01:14.940065Z", - "modified": "2019-10-28T01:51:11.167031Z", - "name": "timezone", - "role_type": "ANS", - "is_valid": true, - "min_ansible_version": "1.9", - "license": "license (Apache 2.0)", - "company": "", - "description": "Role for managing timezone.", - "travis_status_url": "", - "download_count": 871145, - "imported": "2019-10-27T21:51:11.157558-04:00", - "active": true, - "github_user": "yatesr", - "github_repo": "ansible-timezone", - "github_branch": "master", - "stargazers_count": 18, - "forks_count": 15, - "open_issues_count": 3, - "commit": "02845a002839261295b99f508d9ad989bc611cb7", - "commit_message": "Code quality with molecule, tox, and Travis. (#9)\n\n* Set role_name explicitly to avoid using repo name\r\n\r\n* Remove symlinks\r\n\r\nThe symlinks in this role do not play nicely with PBR, which is a\r\ndependency of Kayobe, a project that uses this role.\r\n\r\n* yam", - "commit_url": "https://api.github.com/repos/yatesr/ansible-timezone/git/commits/02845a002839261295b99f508d9ad989bc611cb7", - "issue_tracker_url": "https://github.com/yatesr/ansible-timezone/issues" - } - ] -} diff --git a/lib/modules/datasource/galaxy/__fixtures__/timezone.json b/lib/modules/datasource/galaxy/__fixtures__/timezone.json new file mode 100644 index 0000000000000000000000000000000000000000..9c21d0640f91679ba63af219539bc8ff646d65dc --- /dev/null +++ b/lib/modules/datasource/galaxy/__fixtures__/timezone.json @@ -0,0 +1,86 @@ +{ + "count": 1, + "next": null, + "previous": null, + "results": [ + { + "id": 31412, + "upstream_id": 1429, + "created": "2023-05-08T21:52:11.755598Z", + "modified": "2023-05-08T21:52:11.758345Z", + "github_user": "yatesr", + "username": "yatesr", + "github_repo": "ansible-timezone", + "github_branch": "master", + "commit": "02845a002839261295b99f508d9ad989bc611cb7", + "commit_message": "Code quality with molecule, tox, and Travis. (#9)\n\n* Set role_name explicitly to avoid using repo name\r\n\r\n* Remove symlinks\r\n\r\nThe symlinks in this role do not play nicely with PBR, which is a\r\ndependency of Kayobe, a project that uses this role.\r\n\r\n* yam", + "name": "timezone", + "description": "Role for managing timezone.", + "summary_fields": { + "dependencies": [], + "namespace": { + "id": 7669, + "name": "yatesr", + "avatar_url": "https://github.com/yatesr.png" + }, + "provider_namespace": { + "id": 19542, + "name": "yatesr", + "pulp_href": "/api/pulp/api/v3/pulp_ansible/namespaces/19542/" + }, + "repository": { + "name": "timezone", + "original_name": "ansible-timezone" + }, + "tags": [ + "system" + ], + "versions": [ + { + "id": 7863, + "url": "", + "name": "1.0.0", + "active": null, + "created": "2015-11-17T00:47:51.891999Z", + "related": {}, + "version": "1.0.0", + "modified": "2018-04-14T05:17:23.871524Z", + "commit_sha": null, + "commit_date": "2015-11-16T19:43:42-05:00", + "download_url": "https://github.com/yatesr/ansible-timezone/archive/1.0.0.tar.gz", + "summary_fields": {} + }, + { + "id": 38901, + "url": "", + "name": "1.1.0", + "active": null, + "created": "2017-09-25T00:31:23.862851Z", + "related": {}, + "version": "1.1.0", + "modified": "2018-04-14T05:17:23.806464Z", + "commit_sha": null, + "commit_date": "2017-09-24T20:27:37-04:00", + "download_url": "https://github.com/yatesr/ansible-timezone/archive/1.1.0.tar.gz", + "summary_fields": {} + }, + { + "id": 107503, + "url": "", + "name": "1.2.0", + "active": null, + "created": "2019-10-28T01:51:11.502959Z", + "related": {}, + "version": "1.2.0", + "modified": "2019-10-28T01:51:11.502988Z", + "commit_sha": "02845a002839261295b99f508d9ad989bc611cb7", + "commit_date": "2019-10-27T21:40:43-04:00", + "download_url": "https://github.com/yatesr/ansible-timezone/archive/1.2.0.tar.gz", + "summary_fields": {} + } + ] + }, + "download_count": 1579792 + } + ] +} diff --git a/lib/modules/datasource/galaxy/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/galaxy/__snapshots__/index.spec.ts.snap index 0503963c3f0542f12a97fa2c2ae6376b61cedb22..241b4b9f46de51cdaf33a1952863f7caf01687d0 100644 --- a/lib/modules/datasource/galaxy/__snapshots__/index.spec.ts.snap +++ b/lib/modules/datasource/galaxy/__snapshots__/index.spec.ts.snap @@ -6,15 +6,15 @@ exports[`modules/datasource/galaxy/index getReleases processes real data 1`] = ` "registryUrl": "https://galaxy.ansible.com/", "releases": [ { - "releaseTimestamp": "2015-11-17T00:43:42.000Z", + "releaseTimestamp": "2015-11-17T00:47:51.891Z", "version": "1.0.0", }, { - "releaseTimestamp": "2017-09-25T00:27:37.000Z", + "releaseTimestamp": "2017-09-25T00:31:23.862Z", "version": "1.1.0", }, { - "releaseTimestamp": "2019-10-28T01:40:43.000Z", + "releaseTimestamp": "2019-10-28T01:51:11.502Z", "version": "1.2.0", }, ], diff --git a/lib/modules/datasource/galaxy/index.spec.ts b/lib/modules/datasource/galaxy/index.spec.ts index 7654329befef6cebbff1ee80576a9eb373161d06..49c37c37f74abe91358728597ef965b80ffe552a 100644 --- a/lib/modules/datasource/galaxy/index.spec.ts +++ b/lib/modules/datasource/galaxy/index.spec.ts @@ -77,7 +77,7 @@ describe('modules/datasource/galaxy/index', () => { httpMock .scope(baseUrl) .get('/api/v1/roles/?owner__username=yatesr&name=timezone') - .reply(200, Fixtures.get('timezone')); + .reply(200, Fixtures.get('timezone.json')); const res = await getPkgReleases({ datasource: GalaxyDatasource.id, packageName: 'yatesr.timezone', diff --git a/lib/modules/datasource/galaxy/index.ts b/lib/modules/datasource/galaxy/index.ts index 26cdf87b5483a7013a9b14f85fa8aa494c902cae..479f4d889269addd2100feb22735e46d658990a9 100644 --- a/lib/modules/datasource/galaxy/index.ts +++ b/lib/modules/datasource/galaxy/index.ts @@ -73,10 +73,10 @@ export class GalaxyDatasource extends Datasource { } result.releases = versions.map( - (version: { name: string; release_date: string }) => { + (version: { name: string; created: string }) => { const release: Release = { version: version.name, - releaseTimestamp: version.release_date, + releaseTimestamp: version.created, }; return release; diff --git a/lib/modules/datasource/galaxy/schema.ts b/lib/modules/datasource/galaxy/schema.ts index 3cfbe6a9cc873d3fc7d201f816987180eb3c8fda..8580c319904a8133244b67fe48d7c9592a8e5b88 100644 --- a/lib/modules/datasource/galaxy/schema.ts +++ b/lib/modules/datasource/galaxy/schema.ts @@ -8,7 +8,7 @@ export const GalaxyV1 = z.object({ versions: z.array( z.object({ name: z.string(), - release_date: z.string(), + created: z.string(), }) ), }),