Skip to content

Add List API Endpoint for RemoteRepository and RemoteOrganization #7510

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 15 commits into from
May 27, 2021

Conversation

saadmk11
Copy link
Member

closes #7509

@saadmk11 saadmk11 requested review from agjohnson and a team September 26, 2020 09:20
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

This is a good start. However, I'm not sure if we have to implement this endpoint before #2759 (and #7169) because we are changing how RemoteRepository will behave completely.

Maybe the API response won't change, but would be good to double check that, tho. Want to take a look at this?

Also, we may need to be able to filter by user account (github, gitlab, etc) as we are currently doing on API v2:

(you can see your own API URLs with the org= and own= values at https://readthedocs.org/dashboard/import/)

The idea of using /remote as a namespace may be good as well. I'd call it /remotes/repositories/ in the new APIv3.

In APIv2 we also have /remote/account and /remote/org that I think they will be required here as well (could be done in a different PR, but should be considered in the whole implementation).

If you have the time and energy to work on these things, I'm happy to help you with the process, chat and/or talk about it.

@saadmk11
Copy link
Member Author

saadmk11 commented Sep 28, 2020

This is a good start. However, I'm not sure if we have to implement this endpoint before #2759 (and #7169) because we are changing how RemoteRepository will behave completely.

Maybe the API response won't change, but would be good to double check that, tho. Want to take a look at this?

Sure! 👍 I did not see the changes being done with remote repositories. I'll look into the changes and see if there is anything we need to change about this API.

Also, we may need to be able to filter by user account (github, gitlab, etc) as we are currently doing on API v2:

I was thinking about that, but did not know what are the requirements for API V3 are. Thanks for letting me know 💯

The idea of using /remote as a namespace may be good as well. I'd call it /remotes/repositories/ in the new APIv3.

This sound like a good idea. 👍

In APIv2 we also have /remote/account and /remote/org that I think they will be required here as well (could be done in a different PR, but should be considered in the whole implementation).

Okay, so we need all the API endpoints that are required for the import process.

If you have the time and energy to work on these things, I'm happy to help you with the process, chat and/or talk about it.

Sure, I would love to work on this, recently working with different API's and liking it a lot, and RTD has one of the best designed API 💯

It would be great if you are able to help me with the process, Let me know when you are free to talk or chat about it, maybe on slack?

@humitos
Copy link
Member

humitos commented Sep 29, 2020

It would be great if you are able to help me with the process, Let me know when you are free to talk or chat about it, maybe on slack?

I'm on Slack on Europe time. Feel free to ping me there when you have time.

@saadmk11
Copy link
Member Author

saadmk11 commented Oct 5, 2020

Marking this as blocked as me and @humitos talked, this should be implemented after #2759 (and #7169)

@saadmk11 saadmk11 added the Status: blocked Issue is blocked on another issue label Oct 5, 2020
@humitos
Copy link
Member

humitos commented Mar 17, 2021

@saadmk11 this could be a good pull request to cleanup and finish now we have the new structure deployed.

@saadmk11 saadmk11 marked this pull request as draft March 24, 2021 09:55
@saadmk11 saadmk11 removed the Status: blocked Issue is blocked on another issue label Mar 24, 2021
@saadmk11 saadmk11 changed the title Add List API for Remote Repository Add List API Endpoint for RemoteRepository and RemoteOrganization Mar 24, 2021
@saadmk11 saadmk11 marked this pull request as ready for review March 24, 2021 17:13
@saadmk11 saadmk11 requested a review from humitos March 24, 2021 17:13
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

Looks great! I left some comment with a few changes I'd like to see before merging this PR.

I'm also pinging @agjohnson here who is the one using this endpoint for the search-as-you-type in the new theme.

docs/api/v3.rst Outdated
The ``results`` in response is an array of remote repositories data.

:query string name: return remote repositories with matching name
:query string vcs: return remote repositories for specific vcs (``git``, ``svn``, ``hg`` or ``bzr``)
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove this one. Is there a good use case?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so, vcs_provider should be enough, but I saw it in the API v2, so I added it as I did not know the specific requirements for the API v3. :)

@saadmk11 saadmk11 requested a review from humitos March 27, 2021 16:27
@saadmk11 saadmk11 closed this Mar 28, 2021
@saadmk11 saadmk11 reopened this Mar 28, 2021
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

This is great!

We only need to revert the name__contains 👼

@saadmk11 saadmk11 requested a review from humitos March 29, 2021 11:26
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

🎉

@humitos humitos added the Status: blocked Issue is blocked on another issue label Mar 29, 2021
@humitos
Copy link
Member

humitos commented Mar 29, 2021

I'm blocking this PR only on @agjohnson 's review.

@agjohnson
Copy link
Contributor

agjohnson commented May 26, 2021

I don't have any particular feedback here, the PR looks great. If there is anything that I need changed it can be updated later.

Merge away if this is ready to be merged!

@humitos
Copy link
Member

humitos commented May 27, 2021

Thanks @saadmk11 for all your work here! I'm merging this PR.

@humitos humitos merged commit 4d35b82 into readthedocs:master May 27, 2021
@saadmk11 saadmk11 deleted the remote-repo-api branch May 27, 2021 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: blocked Issue is blocked on another issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add RemoteRepository API v3 endpoint
3 participants