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

package event outdated #2033

Open
mahansky opened this issue Aug 8, 2021 · 3 comments
Open

package event outdated #2033

mahansky opened this issue Aug 8, 2021 · 3 comments

Comments

@mahansky
Copy link

mahansky commented Aug 8, 2021

Package struct seems to be outdated (probably) after the migration from Docker registry to Container registry.
I can't find any information about this GH docs, the example there is still showing the old format.
Here is a small comparison between the two (sent by webhook with Packages event selected):

Old format
{
    "id": 1,
    "name": "packagename",
    "namespace": "org",
    "description": null,
    "ecosystem": "docker",
    "package_type": "docker",
    "html_url": "url",
    "created_at": "2021-06-14T20:58:10Z",
    "updated_at": "2021-06-14T20:58:10Z",
    "owner": {},
    "package_version": {
        "id": 1,
        "version": "v1.0.53",
        "name": "sha256:547ab5a9317ef70c02e7dd50dace3bb3ea5027eda4c20ffee2dcc58547a880e9",
        "description": "",
        "summary": "",
        "body": "",
        "body_html": "",
        "manifest": "{\n   \"schemaVersion\": 2,\n   \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n   \"config\": {\n      \"mediaType\": \"application/vnd.docker.container.image.v1+json\",\n      \"size\": 6601,\n      \"digest\": \"sha256:87077fe40daaecaa723d94ce1ac420d3fcd0aa19349d0a293368777c2ceaf03e\"\n   },\n   \"layers\": [\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 2816246,\n         \"digest\": \"sha256:ddad3d7c1e96adf9153f8921a7c9790f880a390163df453be1566e9ef0d546e0\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 35216756,\n         \"digest\": \"sha256:76a48ad278e6625beb281cb22f58b2ea036c8a06bf64a43f971d01808827dd77\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 2223851,\n         \"digest\": \"sha256:0034d568bb9af8010c99b9730420b249a60960d4dd7e9399711df827d4651120\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 282,\n         \"digest\": \"sha256:2e3259eada9105db5cd0f115f94e76152f1eb979b29af63ff52dbe238bb13b05\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 151,\n         \"digest\": \"sha256:3bb03b74b574e126473d319f2b320d10ceb6abc88b50add44f464e0a69067cb2\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 117075,\n         \"digest\": \"sha256:b8d13243408f3eaf4e44591ebef2679dd795f86585a33aa6cdf0d576b762fca4\"\n      },\n      {\n         \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n         \"size\": 42215001,\n         \"digest\": \"sha256:6739a01fa718d1cb2879bfcff837f0ab9201dc115c2a6ba3ee9b23171d202957\"\n      }\n   ]\n}",
        "html_url": "url",
        "target_commitish": "main",
        "target_oid": "ef8103c7a26def68afef6a9171090de638787cec",
        "created_at": "2021-08-02T23:00:08Z",
        "updated_at": "2021-08-02T23:00:08Z",
        "metadata": [],
        "docker_metadata": [],
        "package_files": [
            {
                "download_url": "url",
                "id": 46741330,
                "name": "41faa066-0b04-4ea1-a03f-033c84d2d942",
                "sha256": "ddad3d7c1e96adf9153f8921a7c9790f880a390163df453be1566e9ef0d546e0",
                "sha1": null,
                "md5": null,
                "content_type": "application/octet-stream",
                "state": "uploaded",
                "size": 2816246,
                "created_at": "2021-06-14T20:58:12Z",
                "updated_at": "2021-08-02T23:00:08Z"
            }
        ],
        "author": {},
        "installation_command": "",
        "package_url": "docker.pkg.github.com/img"
    },
    "registry": {
        "about_url": "https://docs.github.com/about-github-package-registry",
        "name": "GitHub docker registry",
        "type": "docker",
        "url": "https://docker.pkg.github.com/org",
        "vendor": "GitHub Inc"
    }
}
New format
{
    "id": 1,
    "name": "packagename",
    "namespace": "org",
    "description": "",
    "ecosystem": "CONTAINER",
    "package_type": "CONTAINER",
    "html_url": "url",
    "created_at": "2021-06-14T20:58:10Z",
    "updated_at": "2021-06-14T20:58:10Z",
    "owner": {},
    "package_version": {
        "id": 1,
        "version": "sha256:413d61c146706365b0bb605e999af7a3c861740b1c703dc2c00e3ad7a00e118c",
        "name": "sha256:413d61c146706365b0bb605e999af7a3c861740b1c703dc2c00e3ad7a00e118c",
        "description": "",
        "summary": "",
        "body": {
            "repository": {
                "repository": {}
            },
            "info": {
                "type": "blob",
                "oid": "1336cc01db4bab4596f953f087c44f5e0377652e",
                "mode": 33188,
                "name": "README.md",
                "path": "README.md",
                "size": null,
                "collection": true
            },
            "_formatted": true
        },
        "html_url": "url",
        "target_commitish": "main",
        "target_oid": "5315e1e8b2eea898753474ef329a92d658148192",
        "created_at": "0001-01-01T00:00:00Z",
        "updated_at": "0001-01-01T00:00:00Z",
        "metadata": [],
        "container_metadata": {
            "tag": {
                "name": "v2.0.18",
                "digest": "sha256:413d61c146706365b0bb605e999af7a3c861740b1c703dc2c00e3ad7a00e118c"
            },
            "labels": {
                "description": "",
                "source": "",
                "revision": "",
                "image_url": "",
                "licenses": "",
                "all_labels": {}
            },
            "manifest": {
                "digest": "sha256:413d61c146706365b0bb605e999af7a3c861740b1c703dc2c00e3ad7a00e118c",
                "media_type": "application/vnd.docker.distribution.manifest.v2+json",
                "uri": "repositories/org/manifests/sha256:413d61c146706365b0bb605e999af7a3c861740b1c703dc2c00e3ad7a00e118c",
                "size": 1787,
                "config": {
                    "digest": "sha256:1a024179c38f7c6e05942663d4c5c4d34e3c0cc5dc45e740f46217d095953c33",
                    "media_type": "application/vnd.docker.container.image.v1+json",
                    "size": 6927
                },
                "layers": [
                    {
                        "digest": "sha256:ddad3d7c1e96adf9153f8921a7c9790f880a390163df453be1566e9ef0d546e0",
                        "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                        "size": 2816246
                    },
                    {
                        "digest": "sha256:ba53ec923911562996521c2d1d742463e081ffb03db89e1567943bcbf4bb345b",
                        "media_type": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                        "size": 35240951
                    }
                ]
            }
        },
        "package_files": [],
        "author": {},
        "installation_command": "docker pull ghcr.io/img",
        "package_url": "ghcr.io/img"
    },
    "registry": {
        "about_url": "https://docs.github.com/about-github-package-registry",
        "name": "GitHub container registry",
        "type": "container",
        "url": "https://container.pkg.github.com/org",
        "vendor": "GitHub Inc"
    }
}

I'd open up a PR, but since there is no official docs and the fact that no one else is mentioning it makes me wonder if it's something with my repo / feature preview.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 8, 2021

Thank you, @mahansky .
Please contact GitHub technical support and ask them to update their official documentation and report back here with their response.

@gmemstr
Copy link

gmemstr commented Feb 12, 2022

I think it varies based on whether there's a GitHub repository associated with the package. Annoyingly I'm having trouble finding if/where this is documented.

@gmemstr
Copy link

gmemstr commented Nov 19, 2022

@mahansky Looks like the GitHub docs have been updated! :)

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

No branches or pull requests

3 participants