[PR #2084] [CLOSED] Added attachments to the releases API #16221

Closed
opened 2025-11-02 12:05:10 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2084
Author: @stefan-lacatus
Created: 6/29/2017
Status: Closed

Base: masterHead: master


📝 Commits (10+)

  • 23f0728 Don't ignore gravatar error
  • 05e3726 Use default avatar on error
  • 2b410e4 lint
  • 49f5ddc Added attachments to the releases API
  • 935b40f Merge pull request #2083 from ethantkoenig/check_err/org_avatar
  • 789188f Reduce number of layer (#2078)
  • b187b79 Revert changes done to vendor package gitea-sdk
  • 8fd43f2 Revert "Reduce number of layer" (#2086)
  • bfd3b7d Added size of the attachment to the api format
  • 270098c Added two utility methods on attachment, to get an attachment by id and to get all the attachments associated with a given release

📊 Changes

7 files changed (+164 additions, -13 deletions)

View changed files

📝 models/attachment.go (+47 -0)
📝 models/pull.go (+1 -1)
📝 models/release.go (+20 -3)
📝 models/user.go (+2 -3)
📝 modules/base/tool.go (+11 -3)
📝 routers/api/v1/api.go (+10 -3)
📝 routers/api/v1/repo/release.go (+73 -0)

📄 Description

Very simple initial fix for #711.
It's also my first interaction with GO so i'm sorry for stupid mistakes.

Includes changes to the endpoints:

  • Get releases GET /repos/:owner/:repo/releases[/:id] - now includes assets
  • List assets: GET /repos/:owner/:repo/releases/:id/assets
  • Get single asset: GET /repos/:owner/:repo/releases/assets/:id

If the API for github must be followed, where attachments are "assets", with a lot of additional metadata then this PR can be skipped, but for my limited usecase this is all I need.

Depends on https://github.com/go-gitea/go-sdk/pull/63


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2084 **Author:** [@stefan-lacatus](https://github.com/stefan-lacatus) **Created:** 6/29/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (10+) - [`23f0728`](https://github.com/go-gitea/gitea/commit/23f072887935a6aa81634ef487432ff2b5fa250a) Don't ignore gravatar error - [`05e3726`](https://github.com/go-gitea/gitea/commit/05e37264154bbcb375b358798c7a8f9b499c4881) Use default avatar on error - [`2b410e4`](https://github.com/go-gitea/gitea/commit/2b410e44b2813648d670feb2fd543638bd8a4c80) lint - [`49f5ddc`](https://github.com/go-gitea/gitea/commit/49f5ddca5b9e32b62bc1e92b2695b86dd43684d4) Added attachments to the releases API - [`935b40f`](https://github.com/go-gitea/gitea/commit/935b40fd8e5bbdc2a1ce1c64b72e1d3fcd9ba147) Merge pull request #2083 from ethantkoenig/check_err/org_avatar - [`789188f`](https://github.com/go-gitea/gitea/commit/789188f13c93e47b8a758c379bd463f7c2792f13) Reduce number of layer (#2078) - [`b187b79`](https://github.com/go-gitea/gitea/commit/b187b791a71287f2ece19efa0b311b83e0fa13fd) Revert changes done to vendor package gitea-sdk - [`8fd43f2`](https://github.com/go-gitea/gitea/commit/8fd43f215c72ecfd175b4bae3ffb0b5e16170e6e) Revert "Reduce number of layer" (#2086) - [`bfd3b7d`](https://github.com/go-gitea/gitea/commit/bfd3b7d746c5191174bfc4552c9ea3fe50f5c054) Added size of the attachment to the api format - [`270098c`](https://github.com/go-gitea/gitea/commit/270098c056501fdcfb4f4f279ecb8dbfb4e2a6b4) Added two utility methods on attachment, to get an attachment by id and to get all the attachments associated with a given release ### 📊 Changes **7 files changed** (+164 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `models/attachment.go` (+47 -0) 📝 `models/pull.go` (+1 -1) 📝 `models/release.go` (+20 -3) 📝 `models/user.go` (+2 -3) 📝 `modules/base/tool.go` (+11 -3) 📝 `routers/api/v1/api.go` (+10 -3) 📝 `routers/api/v1/repo/release.go` (+73 -0) </details> ### 📄 Description Very simple initial fix for #711. It's also my first interaction with GO so i'm sorry for stupid mistakes. Includes changes to the endpoints: * Get releases `GET /repos/:owner/:repo/releases[/:id]` - now includes assets * List assets: `GET /repos/:owner/:repo/releases/:id/assets` * Get single asset: `GET /repos/:owner/:repo/releases/assets/:id` If the API for github must be followed, where attachments are "assets", with a lot of additional metadata then this PR can be skipped, but for my limited usecase this is all I need. Depends on https://github.com/go-gitea/go-sdk/pull/63 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:05:10 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16221