-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Swift Package Manager Publishing using commandline throws error (#33990) #34068
Draft
wgr1984
wants to merge
2
commits into
go-gitea:main
Choose a base branch
from
wgr1984:swift-package-manager-publishing-using-commandline-throws-error
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Swift Package Manager Publishing using commandline throws error (#33990) #34068
wgr1984
wants to merge
2
commits into
go-gitea:main
from
wgr1984:swift-package-manager-publishing-using-commandline-throws-error
+116
−11
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alternative fix with minimal changes: @@ -304,10 +304,18 @@ func UploadPackageFile(ctx *context.Context) {
packageVersion := v.Core().String()
- file, _, err := ctx.Req.FormFile("source-archive")
+ var file io.ReadCloser
+ multipartFile, _, err := ctx.Req.FormFile("source-archive")
if err != nil {
- apiError(ctx, http.StatusBadRequest, err)
- return
+ content := ctx.Req.FormValue("source-archive")
+ if content != "" {
+ file = io.NopCloser(strings.NewReader(content))
+ } else {
+ apiError(ctx, http.StatusBadRequest, err)
+ return
+ }
+ } else {
+ file = multipartFile
}
defer file.Close() + tests |
hi @wgr1984, would you be interested in continuing to complete the pr? |
sure, will finish it once i find a minute to get local build running, in
order to confirm impl. and update test (in case needed)
Am Do., 3. Apr. 2025 um 12:04 Uhr schrieb hiifong ***@***.***
…:
hi @wgr1984 <https://github.com/wgr1984>, would you be interested in
continuing to complete the pr?
—
Reply to this email directly, view it on GitHub
<#34068 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADEBZPEB6PIYRVWM734MXD2XUBRZAVCNFSM6AAAAAB2B5CUJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZVGE3DQNZYGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: hiifong]*hiifong* left a comment (go-gitea/gitea#34068)
<#34068 (comment)>
hi @wgr1984 <https://github.com/wgr1984>, would you be interested in
continuing to complete the pr?
—
Reply to this email directly, view it on GitHub
<#34068 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADEBZPEB6PIYRVWM734MXD2XUBRZAVCNFSM6AAAAAB2B5CUJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZVGE3DQNZYGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
a2a92fb
to
6ded601
Compare
…ndline-throws-error
hiifong
reviewed
Apr 7, 2025
@@ -304,10 +304,18 @@ func UploadPackageFile(ctx *context.Context) { | |||
|
|||
packageVersion := v.Core().String() | |||
|
|||
file, _, err := ctx.Req.FormFile("source-archive") | |||
var file io.ReadCloser | |||
multipartFile, _, err := ctx.Req.FormFile("source-archive") | |||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error here I think may need to be handled separately, if it's a http.ErrMissingFile error then we need to get the file content from FromValue, otherwise it just returns an error.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
backport/v1.23
This PR should be backported to Gitea 1.23
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
modifies/api
This PR adds API routes or modifies them
modifies/go
Pull requests that update Go code
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
topic/packages
type/bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #33990