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

[Feature] GitLab kref for Netkan #2554

Closed
HebaruSan opened this issue Oct 25, 2018 · 5 comments · Fixed by #3661
Closed

[Feature] GitLab kref for Netkan #2554

HebaruSan opened this issue Oct 25, 2018 · 5 comments · Fixed by #3661
Labels
Enhancement New features or functionality Netkan Issues affecting the netkan data

Comments

@HebaruSan
Copy link
Member

Netkan currently supports directly querying mods from GitHub with this format:

    "$kref": "#/ckan/github/HebaruSan/Astrogator",

The best known alternative to GitHub is GitLab. Currently I don't know of any KSP mods hosted on GitLab, but it could happen any day now. It would be nice if we could support it with something like:

    "$kref": "#/ckan/gitlab/HebaruSan/Astrogator",

GitLab's API docs are here:

Apparently they treat releases as just a kind of tag, like GitHub but even moreso:

Looks like there may not be support for a discrete list of assets, since they show the download as a manually entered link in markdown. However, the example link goes to a relative link starting at /uploads/, so it looks like GitLab does support hosting releases.

@HebaruSan HebaruSan added Enhancement New features or functionality Netkan Issues affecting the netkan data labels Oct 25, 2018
@HebaruSan HebaruSan changed the title [Netkan feature] GitLab kref [Feature] GitLab kref for Netkan Sep 26, 2019
@HebaruSan
Copy link
Member Author

HebaruSan commented Feb 15, 2020

@HebaruSan
Copy link
Member Author

HebaruSan commented Sep 8, 2022

$ curl -s 'https://gitlab.com/api/v4/projects/Ailex-%2Fstarilex-mk1-iva/releases' | jq
[
  {
    "name": "MK1 Pod ''Needle' V 1.0",
    "tag_name": "v1.0",
    "description": "",
    "created_at": "2022-08-22T13:56:03.936Z",
    "released_at": "2022-08-22T13:53:56.162Z",
    "upcoming_release": false,
    "author": {
      "id": 8293968,
      "username": "Ailex-",
      "name": "Alex P",
      "state": "active",
      "avatar_url": "https://secure.gravatar.com/avatar/d6ed63df836147e9221342d2d92a77f3?s=80&d=identicon",
      "web_url": "https://gitlab.com/Ailex-"
    },
    "commit": {
      "id": "c5c9f1aab03b4355782d6230bd2d5e2c1770531d",
      "short_id": "c5c9f1aa",
      "created_at": "2022-08-22T15:27:02.000+02:00",
      "parent_ids": [
        "ea62344879405f6665740b1c2a1017f5b11afbcf"
      ],
      "title": "uploaded to repo",
      "message": "uploaded to repo\n",
      "author_name": "Alex",
      "author_email": "[email protected]",
      "authored_date": "2022-08-22T15:27:02.000+02:00",
      "committer_name": "Alex",
      "committer_email": "[email protected]",
      "committed_date": "2022-08-22T15:27:02.000+02:00",
      "trailers": {},
      "web_url": "https://gitlab.com/Ailex-/starilex-mk1-iva/-/commit/c5c9f1aab03b4355782d6230bd2d5e2c1770531d"
    },
    "commit_path": "/Ailex-/starilex-mk1-iva/-/commit/c5c9f1aab03b4355782d6230bd2d5e2c1770531d",
    "tag_path": "/Ailex-/starilex-mk1-iva/-/tags/v1.0",
    "assets": {
      "count": 4,
      "sources": [
        {
          "format": "zip",
          "url": "https://gitlab.com/Ailex-/starilex-mk1-iva/-/archive/v1.0/starilex-mk1-iva-v1.0.zip"
        },
        {
          "format": "tar.gz",
          "url": "https://gitlab.com/Ailex-/starilex-mk1-iva/-/archive/v1.0/starilex-mk1-iva-v1.0.tar.gz"
        },
        {
          "format": "tar.bz2",
          "url": "https://gitlab.com/Ailex-/starilex-mk1-iva/-/archive/v1.0/starilex-mk1-iva-v1.0.tar.bz2"
        },
        {
          "format": "tar",
          "url": "https://gitlab.com/Ailex-/starilex-mk1-iva/-/archive/v1.0/starilex-mk1-iva-v1.0.tar"
        }
      ],
      "links": []
    },
    "evidences": [
      {
        "sha": "2afcaf5ecdb0781122ac637e13a634a7a864d90b374d",
        "filepath": "https://gitlab.com/Ailex-/starilex-mk1-iva/-/releases/v1.0/evidences/3206286.json",
        "collected_at": "2022-08-22T14:00:04.551Z"
      }
    ],
    "_links": {
      "self": "https://gitlab.com/Ailex-/starilex-mk1-iva/-/releases/v1.0"
    }
  }
]

@HebaruSan
Copy link
Member Author

$ curl -s 'https://gitlab.com/api/v4/projects/Ailex-%2Fstarilex-mk1-iva'|jq
{
  "id": 38781495,
  "description": null,
  "name": "Starilex MK1 IVA",
  "name_with_namespace": "Alex P / Starilex MK1 IVA",
  "path": "starilex-mk1-iva",
  "path_with_namespace": "Ailex-/starilex-mk1-iva",
  "created_at": "2022-08-22T13:13:46.126Z",
  "default_branch": "main",
  "tag_list": [],
  "topics": [],
  "ssh_url_to_repo": "[email protected]:Ailex-/starilex-mk1-iva.git",
  "http_url_to_repo": "https://gitlab.com/Ailex-/starilex-mk1-iva.git",
  "web_url": "https://gitlab.com/Ailex-/starilex-mk1-iva",
  "readme_url": null,
  "avatar_url": null,
  "forks_count": 0,
  "star_count": 0,
  "last_activity_at": "2022-08-22T13:13:46.126Z",
  "namespace": {
    "id": 11130846,
    "name": "Alex P",
    "path": "Ailex-",
    "kind": "user",
    "full_path": "Ailex-",
    "parent_id": null,
    "avatar_url": "https://secure.gravatar.com/avatar/d6ed63df836147e9221342d2d92a77f3?s=80&d=identicon",
    "web_url": "https://gitlab.com/Ailex-"
  }
}

@HebaruSan
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New features or functionality Netkan Issues affecting the netkan data
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant