-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
add Upload URL to release API #26663
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2a8e4e2
add Upload URL to release API
Gusted 969cfe9
Removing the copyright holder
earl-warren 24335d2
Merge branch 'main' into wip-gitea-upload-link
GiteaBot ffa406f
Merge branch 'main' into wip-gitea-upload-link
GiteaBot b10e695
Merge branch 'main' into wip-gitea-upload-link
GiteaBot f780ccd
Merge branch 'main' into wip-gitea-upload-link
GiteaBot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2023 The Gitea Authors. All rights reserved. | ||
// Copyright 2023 The Forgejo Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package convert | ||
|
||
import ( | ||
"testing" | ||
|
||
"code.gitea.io/gitea/models/db" | ||
repo_model "code.gitea.io/gitea/models/repo" | ||
"code.gitea.io/gitea/models/unittest" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestRelease_ToRelease(t *testing.T) { | ||
assert.NoError(t, unittest.PrepareTestDatabase()) | ||
|
||
repo1 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}) | ||
release1 := unittest.AssertExistsAndLoadBean(t, &repo_model.Release{ID: 1}) | ||
release1.LoadAttributes(db.DefaultContext) | ||
|
||
apiRelease := ToAPIRelease(db.DefaultContext, repo1, release1) | ||
assert.NotNil(t, apiRelease) | ||
assert.EqualValues(t, 1, apiRelease.ID) | ||
assert.EqualValues(t, "https://try.gitea.io/api/v1/repos/user2/repo1/releases/1", apiRelease.URL) | ||
assert.EqualValues(t, "https://try.gitea.io/api/v1/repos/user2/repo1/releases/1/assets", apiRelease.UploadURL) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
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.
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.
Hi @earl-warren please remove this line, we have given this feedback to you previously, and also is stated what new files should have in our contributing.md. This is following advice given to us from The Linux Foundation.
Many others are able to contribute to the project following the contributing.md, and we don't have // Copyright Allspice, //Copyright Blender, //Copyright ... etc.. there are literally hundreds of orgs that contribute to this project.
The project appreciates you upstreaming some of the code, however, if you aren't able to follow the contribution documentation we can't make a special exception just for you. By continuously knowingly ignoring the contributing documentation we may need to take action.
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.
Without wishing to comment on this particular instance, I should note that the one requirement of the MIT license is that the copyright notice is preserved. It is forbidden to remove it without permission from the author.
If the author chooses to contribute directly to Gitea under Gitea's copyright notice, that's obviously their choice. If they contribute under a different copyright notice, it is illegal to remove it as by doing so you are no longer covered by the license and are therefore violating that author's copyright by copying their code.