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

SPM: Cannot install package with null release name field #2401

Closed
jagreenwood opened this issue Jul 25, 2024 · 0 comments · Fixed by #2419
Closed

SPM: Cannot install package with null release name field #2401

jagreenwood opened this issue Jul 25, 2024 · 0 comments · Fixed by #2419
Labels
bug Something isn't working

Comments

@jagreenwood
Copy link

Describe the bug
Attempting to install a package whose name field in the GitHub releases payload is null fails.

To Reproduce
Issue command:

mise use spm:danger/swift

Resulting error text:

Error: 
   0: error decoding response body
   1: invalid type: null, expected a string at line 1 column 1511

Location:
   src/http.rs:105

Version:
   2024.7.4 linux-arm64 (b9bc7df 2024-07-19)

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Snippet of Github releases api:

  {
    "url": "https://api.github.com/repos/danger/swift/releases/151791989",
    "assets_url": "https://api.github.com/repos/danger/swift/releases/151791989/assets",
    "upload_url": "https://uploads.github.com/repos/danger/swift/releases/151791989/assets{?name,label}",
    "html_url": "https://github.com/danger/swift/releases/tag/3.18.1",
    "id": 151791989,
    "author": {
      "login": "github-actions[bot]",
      "id": 41898282,
      "node_id": "MDM6Qm90NDE4OTgyODI=",
      "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/github-actions%5Bbot%5D",
      "html_url": "https://github.com/apps/github-actions",
      "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
      "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
      "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
      "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
      "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
      "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
      "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
      "type": "Bot",
      "site_admin": false
    },
    "node_id": "RE_kwDOBgpQTM4JDCl1",
    "tag_name": "3.18.1",
    "target_commitish": "master",
    "name": null,
    "draft": false,
    "prerelease": false,
    "created_at": "2024-04-18T17:10:38Z",
    "published_at": "2024-04-18T17:10:52Z",
    "assets": [

    ],
    "tarball_url": "https://api.github.com/repos/danger/swift/tarball/3.18.1",
    "zipball_url": "https://api.github.com/repos/danger/swift/zipball/3.18.1",
    "body": "\n- Update Node version to 18.x [@hasanabuzayed] - [#607](https://github.com/danger/swift/pull/607)",
    "mentions_count": 1
  }

Note the null name field.

Expected behavior
Github's schema for this field shows it is nullable:

"name": {
  "type": [
    "string",
    "null"
  ]
}

I don't know the conditions why the name would be nullable, but it would be great if it were handled. Maybe if the name is null, then use the tag_name value instead? This field is not nullable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant