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

issue #12450: return original URL in original_url JSON field #13885

Merged
merged 1 commit into from
Dec 7, 2020
Merged

issue #12450: return original URL in original_url JSON field #13885

merged 1 commit into from
Dec 7, 2020

Conversation

eric-belhomme
Copy link
Contributor

As related in issue #12450, the field original_url is always empty when requesting the API route GET repos/{orga}/{project}, even when the project is a mirror repo.

In such case I would excpect to get in original_url the URL of the origin repository used to initiate the project.

This PR is my attempt to fix this :

curl -s -X GET "http://127.0.0.1:3000/api/v1/repos/rico/input-event-daemon?access_token=$TOKKEN" -H "accept: application/json" | jq
{
  "id": 1,
...
  "html_url": "http://localhost:3000/rico/input-event-daemon",
  "ssh_url": "rico@localhost:rico/input-event-daemon.git",
  "clone_url": "http://localhost:3000/rico/input-event-daemon.git",
  "original_url": "https://github.com/eric-belhomme/input-event-daemon.git",
 ...
}

I tested my patch with mysql and sqlite3 database backends with no errors.

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 7, 2020
@6543 6543 added the modifies/api This PR adds API routes or modifies them label Dec 7, 2020
@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 Dec 7, 2020
@6543
Copy link
Member

6543 commented Dec 7, 2020

ping

@6543 6543 merged commit 6ddf881 into go-gitea:master Dec 7, 2020
6543 added a commit to 6543-forks/gitea that referenced this pull request Dec 7, 2020
@6543 6543 added the backport/done All backports for this PR have been created label Dec 7, 2020
@6543
Copy link
Member

6543 commented Dec 7, 2020

Backport: #13886

@6543 6543 added this to the 1.14.0 milestone Dec 7, 2020
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants