Use pagination option of API calls #278

Open
opened 3 years ago by 6543 · 11 comments
6543 commented 3 years ago
Collaborator

Need Gitea 1.12 and above.

  • repos (my repos, repos by org, all user repos, starred repos) [have pagination]
  • issues [have pagination]
  • pull requests [have pagination]
  • commits [have pagination]
  • branches (don't have pagination?)
  • milestones [have pagination] #384
  • organizations [have pagination]
  • Admin Users [have pagination]
  • Releases [have pagination] #1002
  • Explore repos [have pagination] #979
  • Explore issues [have pagination] #979
  • Notifications [have pagination] #979
  • Followers(user profile screen) [have pagination] #979
  • Following(user profile screen) [have pagination] #979
Need Gitea 1.12 and above. - [x] repos (my repos, repos by org, all user repos, starred repos) [have pagination] - [x] issues [have pagination] - [x] pull requests [have pagination] - [x] commits [have pagination] - [ ] branches (don't have pagination?) - [x] milestones [have pagination] #384 - [x] organizations [have pagination] - [x] Admin Users [have pagination] - [x] Releases [have pagination] #1002 - [x] Explore repos [have pagination] #979 - [x] Explore issues [have pagination] #979 - [x] Notifications [have pagination] #979 - [x] Followers(user profile screen) [have pagination] #979 - [x] Following(user profile screen) [have pagination] #979
6543 added the
🎯 Enhancement
label 3 years ago
Poster
Collaborator

came up in #273 and usable with gitea 1.12.0 -> https://github.com/go-gitea/gitea/pull/9452

came up in #273 and usable with gitea 1.12.0 -> https://github.com/go-gitea/gitea/pull/9452
Owner

Issues, closed issues, PRs already using pagination.

Only repositories and organization does not have implementation yet.

Issues, closed issues, PRs already using pagination. Only repositories and organization does not have implementation yet.
mmarif added this to the 4.0.0 milestone 1 year ago
mmarif self-assigned this 1 year ago
mmarif modified the milestone from 4.0.0 to 4.1.0 1 year ago
mmarif referenced this issue from a commit 1 year ago
mmarif modified the milestone from 4.1.0 to 4.2.0 1 year ago
Poster
Collaborator

branches do have pagination at least from >= v1.16.0 I'm sure with

branches do have pagination at least from >= v1.16.0 I'm sure with
mmarif modified the milestone from 4.2.0 to 4.3.0 10 months ago
mmarif referenced this issue from a commit 8 months ago
mmarif closed this issue 8 months ago
mmarif closed this issue 8 months ago
qwerty287 reopened this issue 8 months ago
Collaborator

There are still some things not using this
We can look at tea4j-autodeploy once merged to find them (just examples: label selection lists, branch selection)

There are still some things not using this We can look at tea4j-autodeploy once merged to find them (just examples: label selection lists, branch selection)
mmarif modified the milestone from 4.3.0 to 4.4.0 8 months ago
Poster
Collaborator

auto got merged :)

auto got merged :)
Collaborator

You can easily find usages which really ignore pagination by running grep -r "null, null)" app/src/main/java/org/mian/gitnex. Outputs right now for me:

app/src/main/java/org/mian/gitnex/actions/LabelsActions.java:                   .issueListLabels(repoOwner, repoName, null, null);
app/src/main/java/org/mian/gitnex/actions/LabelsActions.java:                                           .orgListLabels(repoOwner, null, null);
app/src/main/java/org/mian/gitnex/helpers/ssl/MemorizingTrustManager.java:                      keyStore.load(null, null);
app/src/main/java/org/mian/gitnex/activities/CreateReleaseActivity.java:                .repoListBranches(repoOwner, repoName, null, null);
app/src/main/java/org/mian/gitnex/activities/CreateLabelActivity.java:                              organizationLabelsViewModel.loadOrgLabelsList(getIntent().getStringExtra("orgName"), ctx, null, null);
app/src/main/java/org/mian/gitnex/activities/LoginActivity.java:                        call = RetrofitClient.getApiInterface(ctx, instanceUrl.toString(), credential, null).userGetTokens(loginOTP, loginUid, null, null);
app/src/main/java/org/mian/gitnex/activities/LoginActivity.java:                        call = RetrofitClient.getApiInterface(ctx, instanceUrl.toString(), credential, null).userGetTokens(loginUid, null, null);
app/src/main/java/org/mian/gitnex/activities/CreateFileActivity.java:                .repoListBranches(repoOwner, repoName, null, null);
app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java:                   .repoListBranches(repository.getOwner(), repository.getName(), null, null);
app/src/main/java/org/mian/gitnex/activities/CreatePullRequestActivity.java:                    .repoListBranches(repoOwner, repoName, null, null);
app/src/main/java/org/mian/gitnex/fragments/OrganizationTeamInfoMembersFragment.java:                   .orgListTeamMembers(team.getId(), null, null);
app/src/main/java/org/mian/gitnex/viewmodels/OrganizationLabelsViewModel.java:                  .orgListLabels(owner, null, null);
app/src/main/java/org/mian/gitnex/viewmodels/LabelsViewModel.java:                .issueListLabels(owner, repo, null, null);
app/src/main/java/org/mian/gitnex/viewmodels/CollaboratorsViewModel.java:                .repoListCollaborators(owner, repo, null, null);
app/src/main/java/org/mian/gitnex/viewmodels/MembersByOrgViewModel.java:                .orgListMembers(owner, null, null);
app/src/main/java/org/mian/gitnex/viewmodels/RepoWatchersViewModel.java:                .repoListSubscribers(repoOwner, repoName, null, null);
app/src/main/java/org/mian/gitnex/viewmodels/TeamsByOrgViewModel.java:                .orgListTeams(orgName, null, null);
app/src/main/java/org/mian/gitnex/viewmodels/IssueCommentsViewModel.java:                .issueGetComments(owner, repo, (long) index, null, null);
app/src/main/java/org/mian/gitnex/viewmodels/RepoStargazersViewModel.java:                .repoListStargazers(repoOwner, repoName, null, null);
app/src/main/java/org/mian/gitnex/views/ReactionList.java:                                                      .issueGetIssueReactions(repoOwner, repoName, (long) id, null, null)
app/src/main/java/org/mian/gitnex/views/ReactionSpinner.java:                                   .issueGetIssueReactions(repoOwner, repoName, (long) id, null, null)
app/src/main/java/org/mian/gitnex/adapters/TeamsByOrgAdapter.java:                  .orgListTeamMembers(currentItem.getId(), null, null)

Only the one in app/src/main/java/org/mian/gitnex/helpers/ssl/MemorizingTrustManager.java is not an API call.
However, there might be more endpoints that use variables but do not change them. These one you can't find with grep 🙃.

You can easily find usages which really ignore pagination by running `grep -r "null, null)" app/src/main/java/org/mian/gitnex`. Outputs right now for me: ``` app/src/main/java/org/mian/gitnex/actions/LabelsActions.java: .issueListLabels(repoOwner, repoName, null, null); app/src/main/java/org/mian/gitnex/actions/LabelsActions.java: .orgListLabels(repoOwner, null, null); app/src/main/java/org/mian/gitnex/helpers/ssl/MemorizingTrustManager.java: keyStore.load(null, null); app/src/main/java/org/mian/gitnex/activities/CreateReleaseActivity.java: .repoListBranches(repoOwner, repoName, null, null); app/src/main/java/org/mian/gitnex/activities/CreateLabelActivity.java: organizationLabelsViewModel.loadOrgLabelsList(getIntent().getStringExtra("orgName"), ctx, null, null); app/src/main/java/org/mian/gitnex/activities/LoginActivity.java: call = RetrofitClient.getApiInterface(ctx, instanceUrl.toString(), credential, null).userGetTokens(loginOTP, loginUid, null, null); app/src/main/java/org/mian/gitnex/activities/LoginActivity.java: call = RetrofitClient.getApiInterface(ctx, instanceUrl.toString(), credential, null).userGetTokens(loginUid, null, null); app/src/main/java/org/mian/gitnex/activities/CreateFileActivity.java: .repoListBranches(repoOwner, repoName, null, null); app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java: .repoListBranches(repository.getOwner(), repository.getName(), null, null); app/src/main/java/org/mian/gitnex/activities/CreatePullRequestActivity.java: .repoListBranches(repoOwner, repoName, null, null); app/src/main/java/org/mian/gitnex/fragments/OrganizationTeamInfoMembersFragment.java: .orgListTeamMembers(team.getId(), null, null); app/src/main/java/org/mian/gitnex/viewmodels/OrganizationLabelsViewModel.java: .orgListLabels(owner, null, null); app/src/main/java/org/mian/gitnex/viewmodels/LabelsViewModel.java: .issueListLabels(owner, repo, null, null); app/src/main/java/org/mian/gitnex/viewmodels/CollaboratorsViewModel.java: .repoListCollaborators(owner, repo, null, null); app/src/main/java/org/mian/gitnex/viewmodels/MembersByOrgViewModel.java: .orgListMembers(owner, null, null); app/src/main/java/org/mian/gitnex/viewmodels/RepoWatchersViewModel.java: .repoListSubscribers(repoOwner, repoName, null, null); app/src/main/java/org/mian/gitnex/viewmodels/TeamsByOrgViewModel.java: .orgListTeams(orgName, null, null); app/src/main/java/org/mian/gitnex/viewmodels/IssueCommentsViewModel.java: .issueGetComments(owner, repo, (long) index, null, null); app/src/main/java/org/mian/gitnex/viewmodels/RepoStargazersViewModel.java: .repoListStargazers(repoOwner, repoName, null, null); app/src/main/java/org/mian/gitnex/views/ReactionList.java: .issueGetIssueReactions(repoOwner, repoName, (long) id, null, null) app/src/main/java/org/mian/gitnex/views/ReactionSpinner.java: .issueGetIssueReactions(repoOwner, repoName, (long) id, null, null) app/src/main/java/org/mian/gitnex/adapters/TeamsByOrgAdapter.java: .orgListTeamMembers(currentItem.getId(), null, null) ``` Only the one in app/src/main/java/org/mian/gitnex/helpers/ssl/MemorizingTrustManager.java is not an API call. However, there might be more endpoints that use variables but do not change them. These one you can't find with `grep` 🙃.
qwerty287 modified the milestone from 4.4.0 to 4.5.0 5 months ago
Collaborator

There are at least three more you can find with grep -r "1, 50)" app/src/main/java/org/mian/gitnex:

app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java:                   .issueGetMilestonesList(repository.getOwner(), repository.getName(), "open", null, 1, 50);
app/src/main/java/org/mian/gitnex/activities/CreateRepoActivity.java:                .orgListCurrentUserOrgs(1, 50);
app/src/main/java/org/mian/gitnex/adapters/TeamRepositoriesAdapter.java:                                .orgListTeamRepos((long) teamId, 1, 50);
There are at least three more you can find with `grep -r "1, 50)" app/src/main/java/org/mian/gitnex`: ``` app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java: .issueGetMilestonesList(repository.getOwner(), repository.getName(), "open", null, 1, 50); app/src/main/java/org/mian/gitnex/activities/CreateRepoActivity.java: .orgListCurrentUserOrgs(1, 50); app/src/main/java/org/mian/gitnex/adapters/TeamRepositoriesAdapter.java: .orgListTeamRepos((long) teamId, 1, 50); ```
Poster
Collaborator

that sounds like this issue is near to be resolved completly 🎉

that sounds like this issue is near to be resolved completly :tada:
Collaborator

@6543 it looks like you didn't see #278 and #278

@6543 it looks like you didn't see https://codeberg.org/gitnex/GitNex/issues/278#issuecomment-520698 and https://codeberg.org/gitnex/GitNex/issues/278#issuecomment-455717
Poster
Collaborator

I thought #278 was an update to #278 ...

I thought https://codeberg.org/gitnex/GitNex/issues/278#issuecomment-520698 was an update to https://codeberg.org/gitnex/GitNex/issues/278#issuecomment-455717 ...
Collaborator

Unfortunately not, it's an extension.

Unfortunately not, it's an extension.
mmarif removed this from the 4.5.0 milestone 3 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: gitnex/GitNex#278
Loading…
There is no content yet.