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

Allow API to create file on empty repo #19224

Merged

Conversation

zeripath
Copy link
Contributor

This PR adds the necessary work to make it possible to create files on empty
repos using the API.

Fix #10993

Signed-off-by: Andrew Thornton art27@cantab.net

This PR adds the necessary work to make it possible to create files on empty
repos using the API.

Fix go-gitea#10993

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the type/enhancement An improvement of existing functionality label Mar 26, 2022
@zeripath zeripath added this to the 1.17.0 milestone Mar 26, 2022
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 26, 2022
@lunny

This comment was marked as resolved.

Signed-off-by: Andrew Thornton <art27@cantab.net>
…-run-on-empty-repo' into fix-10993-allow-create-file-to-run-on-empty-repo
@zeripath

This comment was marked as resolved.

@noerw noerw added the modifies/api This PR adds API routes or modifies them label Mar 27, 2022
Copy link
Contributor

@Gusted Gusted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise seems to LGTM.

services/repository/files/update.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 28, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 28, 2022
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@54961f3). Click here to learn what that means.
The diff coverage is 54.33%.

@@           Coverage Diff           @@
##             main   #19224   +/-   ##
=======================================
  Coverage        ?   46.57%           
=======================================
  Files           ?      860           
  Lines           ?   123267           
  Branches        ?        0           
=======================================
  Hits            ?    57409           
  Misses          ?    58908           
  Partials        ?     6950           
Impacted Files Coverage Δ
routers/api/v1/repo/file.go 77.47% <ø> (ø)
services/repository/files/cherry_pick.go 0.00% <0.00%> (ø)
services/repository/files/patch.go 0.00% <0.00%> (ø)
services/repository/files/upload.go 0.00% <0.00%> (ø)
services/repository/files/update.go 36.38% <49.46%> (ø)
services/repository/files/temp_repo.go 60.53% <77.77%> (ø)
services/repository/files/delete.go 51.44% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54961f3...23b9926. Read the comment docs.

@6543 6543 merged commit e69b7a9 into go-gitea:main Mar 28, 2022
@zeripath zeripath deleted the fix-10993-allow-create-file-to-run-on-empty-repo branch March 28, 2022 20:18
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 30, 2022
* giteaoffical/main: (31 commits)
  Add Package Registry (go-gitea#16510)
  Show messages for users if the ROOT_URL is wrong, show JavaScript errors (go-gitea#18971)
  [skip ci] Updated translations via Crowdin
  Make git.OpenRepository accept Context (go-gitea#19260)
  Use full output of git show-ref --tags to get tags for PushUpdateAddTag (go-gitea#19235)
  When conflicts have been previously detected ensure that they can be resolved (go-gitea#19247)
  More commit info from API (go-gitea#19252)
  Move some issue methods as functions (go-gitea#19255)
  Move project files into models/project sub package (go-gitea#17704)
  Granular webhook events in editHook (go-gitea#19251)
  Provide configuration to allow camo-media proxying (go-gitea#12802)
  Move init repository related functions to modules (go-gitea#19159)
  Move organization related structs into sub package (go-gitea#18518)
  Refactor repo clone button and repo clone links, fix JS error on empty repo page (go-gitea#19208)
  Show last cron messages on monitor page (go-gitea#19223)
  Allow API to create file on empty repo (go-gitea#19224)
  Use goproxy.io instead of goproxy.cn (go-gitea#19242)
  New cron task: delete old system notices (go-gitea#19219)
  Let web and API routes have different auth methods group (go-gitea#19168)
  Only send webhook events to active system webhooks and only deliver to active hooks (go-gitea#19234)
  ...
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] [API] Initialize Empty repo if repoCreateFile is used
7 participants