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

Release API does not expose attachments #711

Closed
bkcsoft opened this issue Jan 20, 2017 · 3 comments · Fixed by #3478
Closed

Release API does not expose attachments #711

bkcsoft opened this issue Jan 20, 2017 · 3 comments · Fixed by #3478
Labels
modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality
Milestone

Comments

@bkcsoft
Copy link
Member

bkcsoft commented Jan 20, 2017

  • Gitea version (or commit ref): 7e401b9

Description

Releases can now have attachments #673 🎉 But the API was not updated to reflect this 🙁

The bare minumum for basic functionality are:

  • update /repos/:owner/:repo/releases[/:id] with
    {
     "assets_url": "https://api.github.com/repos/octocat/Hello-World/releases/1/assets",
     "assets": [
        {
          "url": "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
          "browser_download_url": "https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip",
          "id": 1,
          "name": "example.zip",
          "label": "short description",
          "state": "uploaded",
          "content_type": "application/zip",
          "size": 1024,
          "download_count": 42,
          "created_at": "2013-02-27T19:35:32Z",
          "updated_at": "2013-02-27T19:35:32Z",
          "uploader": {
            "login": "octocat",
            "id": 1,
            "avatar_url": "https://github.com/images/error/octocat_happy.gif",
            "gravatar_id": "",
            "url": "https://api.github.com/users/octocat",
            "html_url": "https://github.com/octocat",
            "followers_url": "https://api.github.com/users/octocat/followers",
            "following_url": "https://api.github.com/users/octocat/following{/other_user}",
            "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
            "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
            "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
            "organizations_url": "https://api.github.com/users/octocat/orgs",
            "repos_url": "https://api.github.com/users/octocat/repos",
            "events_url": "https://api.github.com/users/octocat/events{/privacy}",
            "received_events_url": "https://api.github.com/users/octocat/received_events",
            "type": "User",
            "site_admin": false
          }
        }
      ]
     }
    
  • List assets: GET /repos/:owner/:repo/releases/:id/assets
  • Get single asset: GET /repos/:owner/:repo/releases/assets/:id

Nice to have but could be it's own PR

  • Edit asset: PATCH /repos/:owner/:repo/releases/assets/:id
  • Delete asset: DELETE /repos/:owner/:repo/releases/assets/:id
  • Upload asset: POST /repos/:owner/:repo/releases/:id/assets?name=foo.zip

Ref: https://developer.github.com/v3/repos/releases/#list-assets-for-a-release

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/41166037-release-api-does-not-expose-attachments?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github).
@bkcsoft bkcsoft added modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality labels Jan 20, 2017
@lunny lunny added this to the 1.1.0 milestone Jan 21, 2017
@esell
Copy link
Contributor

esell commented Jan 26, 2017

Curious, since POSTing files to releases isn't supported yet, is there any work around to create releases with files attached to them? I am looking at automating a release process via jenkins.

EDIT: looks like you can do this in two steps currently.

  1. POST https://gitea/attachments
    1a. get uuid from response

  2. POST https://gitea/:user/:repo/releases/new
    2a. as part of the form data put the uuid from above into the files value

@lunny lunny modified the milestones: 1.2.0, 1.1.0 Feb 5, 2017
@lunny lunny modified the milestones: 1.x.x, 1.2.0 Apr 19, 2017
@jonasfranz
Copy link
Member

jonasfranz commented Feb 8, 2018

I'am currently working on this issue. We are calling assets currently attachments should this be also taken over to the api? Or should I use assets as @bkcsoft suggested?

@jonasfranz jonasfranz mentioned this issue Feb 8, 2018
1 task
@bkcsoft
Copy link
Member Author

bkcsoft commented Feb 10, 2018

@JonasFranzDEV It should be whatever GitHub API is calling it 🙂

@lunny lunny modified the milestones: 1.x.x, 1.5.0 Mar 9, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants