Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

feat: add pagination for all GET apis' of git providers #776

Merged
merged 24 commits into from
Oct 11, 2024

Conversation

abhishek818
Copy link
Contributor

@abhishek818 abhishek818 commented Jul 15, 2024

Enhancement: add pagination for all GET apis' of git providers (#761)

Description

Almost every GET api results have been limited by a value of 100 items. Hence, we must enable pagination.

  • This change requires a documentation update
  • I have made corresponding changes to the documentation

Related Issue(s)

This PR addresses issue #761
closes #761
/claim #761

Screenshots

If relevant, please add screenshots.

Notes

Please add any relevant notes if necessary.

@abhishek818 abhishek818 requested a review from a team as a code owner July 15, 2024 22:03
@abhishek818
Copy link
Contributor Author

abhishek818 commented Jul 15, 2024

@Tpuljak @idagelic Up for review.

PS: I had added pagination (for bitbucketserver) when I implemented bitbucketserver support. 😏 :p

@abhishek818
Copy link
Contributor Author

abhishek818 commented Jul 15, 2024

I dont think we will require rate limiting here, but who knows. There are always some extreme users..
Open to suggestions obviously.

@Tpuljak
Copy link
Member

Tpuljak commented Jul 16, 2024

@Tpuljak @idagelic Up for review.

As I said, no need for tagging us separately cause we automatically get 3 emails per PR 😄

Your solution by itself does not influence nor solve #761 since the pagination can not be used. The scope of solving this issue is not only to add pagination to git providers on the backend, but to expose that functionality via the API and make the TUI lists paginate properly.

I'll place the PR in draft since you did part of the work on the backend. Mark it for review when you applied the required changes or let us know if you don't want to continue solving this.

@Tpuljak Tpuljak marked this pull request as draft July 16, 2024 07:22
@abhishek818
Copy link
Contributor Author

abhishek818 commented Jul 16, 2024

do you mean adding pagination for frontend TUI here?

func selectRepositoryPrompt(repositories []apiclient.GitRepository, index int, choiceChan chan<- string, parentId string, selectedReposParentMap map[string]bool, selectedRepos map[string]bool) {
	items := []list.Item{}
	disabledReposCount := 0

	// Populate items with titles and descriptions from workspaces.
	for _, repository := range repositories {         <-------------------------
		url := *repository.Url
		title := *repository.Name
		isDisabled := false

                .....
		newItem := item[string]{id: url, title: title, choiceProperty: url, desc: url, isDisabled: isDisabled}
		items = append(items, newItem)
	}

      ......
	l := views.GetStyledSelectList(items)

}

Or support an argument like 'page' which comes from the backend and then applying pagination?
providerRepos, _, err = apiClient.GitProviderAPI.GetRepositories(ctx, providerId, namespaceId, page).Execute() <---------

@Tpuljak
Copy link
Member

Tpuljak commented Jul 16, 2024

@abhishek818 both 😄

In order for the TUI pagination to work, you need to implement it on the API as well.

@abhishek818
Copy link
Contributor Author

update: if not urgently needed to be merged, will come back to this after a couple of days.

@abhishek818
Copy link
Contributor Author

I am back since you guys posted many bounties lol!

@abhishek818 abhishek818 marked this pull request as ready for review July 19, 2024 13:05
@abhishek818 abhishek818 marked this pull request as draft July 19, 2024 14:01
@Tpuljak Tpuljak closed this in #809 Jul 19, 2024
@abhishek818
Copy link
Contributor Author

@Tpuljak closed? this pr is related to another issue..

@lbrecic
Copy link
Contributor

lbrecic commented Jul 19, 2024

Hi @abhishek818 !
So sorry for this inconvenience on our part, the issue and the PR number similarity (766 & 776) got the best of us in the referenced merged PR #809 😅
You can continue with your development!

@lbrecic lbrecic reopened this Jul 19, 2024
@abhishek818
Copy link
Contributor Author

Up for review!

@abhishek818 abhishek818 marked this pull request as ready for review July 19, 2024 16:25
@abhishek818
Copy link
Contributor Author

Similar changes needed for get branches, namespaces etc. but want to confirm first since this is a api signature change..

Copy link
Member

@Tpuljak Tpuljak left a comment

Choose a reason for hiding this comment

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

@abhishek818 the direction seems good but I see that a check is failing. Please address that and my comment below.

From what I can see, this direction is good and you can implement it for other methods as well. I'll place the PR in draft.

pkg/gitprovider/azure-devops.go Outdated Show resolved Hide resolved
@Tpuljak Tpuljak marked this pull request as draft July 22, 2024 07:46
@abhishek818 abhishek818 marked this pull request as ready for review July 22, 2024 21:25
@abhishek818 abhishek818 requested a review from a team as a code owner July 22, 2024 21:25
@abhishek818 abhishek818 requested a review from Tpuljak July 22, 2024 21:25
@abhishek818
Copy link
Contributor Author

abhishek818 commented Jul 22, 2024

can you help with the swagger error? Everytime I make the suggested changes, it fails with a different change. Tried running hack/swagger.sh file..

…io#761)

Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
Signed-off-by: Abhishek Kumar Gupta <abhishekguptaatweb17@gmail.com>
Signed-off-by: abhishek kumar gupta <abhishekguptaatweb17@gmail.com>
…io#761)

Signed-off-by: abhishek818 <abhishekguptaatweb17@gmail.com>
Signed-off-by: abhishek818 <abhishekguptaatweb17@gmail.com>
Signed-off-by: abhishek818 <abhishekguptaatweb17@gmail.com>
Signed-off-by: abhishek818 <abhishekguptaatweb17@gmail.com>
Signed-off-by: abhishek818 <abhishekguptaatweb17@gmail.com>
Signed-off-by: abhishek818 <abhishekguptaatweb17@gmail.com>
Signed-off-by: abhishek818 <abhishekguptaatweb17@gmail.com>
Signed-off-by: abhishek818 <abhishekguptaatweb17@gmail.com>
Signed-off-by: abhishek818 <abhishekguptaatweb17@gmail.com>
@Tpuljak Tpuljak merged commit c1ea0c1 into daytonaio:main Oct 11, 2024
12 checks passed
@Tpuljak Tpuljak changed the title Enhancement: add pagination for all GET apis' of git providers (#761) feat: add pagination for all GET apis' of git providers Oct 11, 2024
@Tpuljak
Copy link
Member

Tpuljak commented Oct 11, 2024

/tip $50

Copy link

algora-pbc bot commented Oct 11, 2024

🎉🎈 @abhishek818 has been awarded $50! 🎈🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Github provider only lists 100 repositories
4 participants