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

[API] Only Return Json #13511

Merged

Conversation

6543
Copy link
Member

@6543 6543 commented Nov 10, 2020

close #13502

@6543 6543 added modifies/api This PR adds API routes or modifies them type/bug backport/v1.13 labels Nov 10, 2020
@6543 6543 added this to the 1.14.0 milestone Nov 10, 2020
@6543 6543 changed the title Fix 13502 api return json error [API] Let GetBranch return json error if not found Nov 10, 2020
@6543 6543 changed the title [API] Let GetBranch return json error if not found [API] Let Branch and Raw endpoint return json error if not found Nov 10, 2020
@6543 6543 changed the title [API] Let Branch and Raw endpoint return json error if not found [API] Let Branch and Raw Endpoint return json error if not found Nov 10, 2020
@6543 6543 added the pr/wip This PR is not ready for review label Nov 11, 2020
modules/context/repo.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 11, 2020
@6543 6543 removed the pr/wip This PR is not ready for review label Nov 11, 2020
@6543 6543 force-pushed the fix-13502_api_return-json-error branch from 7b945f6 to 4e278b5 Compare November 11, 2020 00:58
…directly"

This reverts commit d826d08577b23765cb3c257e7a861191d1aa9a04.
modules/context/api.go Outdated Show resolved Hide resolved
@6543 6543 added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Nov 11, 2020
@6543 6543 changed the title [API] Let Branch and Raw Endpoint return json error if not found [API] Only Return json Nov 11, 2020
@codecov-io
Copy link

codecov-io commented Nov 11, 2020

Codecov Report

Merging #13511 (3b3e089) into master (3f3447a) will decrease coverage by 0.01%.
The diff coverage is 70.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13511      +/-   ##
==========================================
- Coverage   42.16%   42.15%   -0.02%     
==========================================
  Files         696      696              
  Lines       76447    76480      +33     
==========================================
+ Hits        32234    32239       +5     
- Misses      38923    38947      +24     
- Partials     5290     5294       +4     
Impacted Files Coverage Δ
modules/context/api.go 70.00% <54.05%> (-5.23%) ⬇️
routers/api/v1/api.go 79.50% <86.95%> (ø)
routers/api/v1/repo/branch.go 38.02% <90.00%> (+1.16%) ⬆️
modules/context/repo.go 54.83% <100.00%> (-1.14%) ⬇️
modules/indexer/stats/queue.go 64.70% <0.00%> (-11.77%) ⬇️
modules/indexer/stats/db.go 43.47% <0.00%> (-8.70%) ⬇️
modules/charset/charset.go 68.53% <0.00%> (-4.50%) ⬇️
models/unit.go 46.57% <0.00%> (-2.74%) ⬇️
routers/repo/view.go 37.47% <0.00%> (-0.65%) ⬇️
... and 4 more

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 3f3447a...3b3e089. Read the comment docs.

@6543 6543 changed the title [API] Only Return json [API] Only Return Json Nov 13, 2020
@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 Nov 13, 2020
@6543
Copy link
Member Author

6543 commented Nov 13, 2020

@a1012112796 Is something holding this back?

@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 Nov 14, 2020
@6543
Copy link
Member Author

6543 commented Nov 14, 2020

🚀

@techknowlogick techknowlogick merged commit 7d2700c into go-gitea:master Nov 14, 2020
@6543 6543 deleted the fix-13502_api_return-json-error branch November 14, 2020 16:14
6543 added a commit to 6543-forks/gitea that referenced this pull request Nov 14, 2020
* Let Branch and Raw Endpoint return json error if not found

* Revert "RM RepoRefByTypeForAPI and move needed parts into GetRawFile directly"

This reverts commit d826d08577b23765cb3c257e7a861191d1aa9a04.

* more similar to RepoRefByType

* dedub-code

* API should just speak JSON

* nice name

Co-authored-by: zeripath <art27@cantab.net>
6543 added a commit to 6543-forks/gitea that referenced this pull request Nov 14, 2020
* Let Branch and Raw Endpoint return json error if not found

* Revert "RM RepoRefByTypeForAPI and move needed parts into GetRawFile directly"

This reverts commit d826d08577b23765cb3c257e7a861191d1aa9a04.

* more similar to RepoRefByType

* dedub-code

* API should just speak JSON

* nice name

Co-authored-by: zeripath <art27@cantab.net>
@6543 6543 added the backport/done All backports for this PR have been created label Nov 14, 2020
@6543
Copy link
Member Author

6543 commented Nov 14, 2020

zeripath added a commit that referenced this pull request Nov 15, 2020
Backport #13511

Co-authored-by: zeripath <art27@cantab.net>
zeripath added a commit that referenced this pull request Nov 15, 2020
Backport #13511 

Co-authored-by: zeripath <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created 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/bug type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API] [Bug] /repos/{owner}/{repo}/branches/{branch} return html page on 404
7 participants