Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Increase paging limit #2166

Merged

Conversation

DhritiShikhar
Copy link
Contributor

@DhritiShikhar DhritiShikhar commented Jul 13, 2018

temporarily fixes openshiftio/openshift.io#3973

@alien-ike
Copy link

alien-ike commented Jul 13, 2018

Ike Plugins (test-keeper)

Thank you @DhritiShikhar for this contribution!

It seems that this PR already contains some added or changed tests. Good job!

For more information please head over to official documentation. You can find there how to configure the plugin.

@DhritiShikhar DhritiShikhar changed the title Increase paging limit WIP: Increase paging limit Jul 13, 2018
@DhritiShikhar DhritiShikhar changed the title WIP: Increase paging limit Increase paging limit Jul 13, 2018
@codecov-io
Copy link

codecov-io commented Jul 13, 2018

Codecov Report

Merging #2166 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2166   +/-   ##
=======================================
  Coverage   69.45%   69.45%           
=======================================
  Files         166      166           
  Lines       15446    15446           
=======================================
  Hits        10728    10728           
  Misses       3748     3748           
  Partials      970      970
Impacted Files Coverage Δ
controller/paging.go 97.53% <ø> (ø) ⬆️

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 cb85aa7...22e6c1f. Read the comment docs.

@baijum
Copy link
Contributor

baijum commented Jul 13, 2018

Please create an issue to revert this after fixing it in the UI.

@DhritiShikhar
Copy link
Contributor Author

Created an issue to track the discussion related to pagination openshiftio/openshift.io#3978

@DhritiShikhar
Copy link
Contributor Author

Created an issue to revert the change -> #2167

Copy link
Contributor

@baijum baijum left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -198,7 +198,7 @@ func (s *WorkItemSuite) TestPagingDefaultAndMaxSize() {
limit = 1000
_, result = test.ListWorkitemsOK(s.T(), context.Background(), nil, s.workitemsCtrl, space.SystemSpace, nil, nil, nil, nil, nil, nil, nil, nil, &limit, &offset, nil, nil, nil)
// then
if !strings.Contains(*result.Links.First, "page[limit]=100") {
if !strings.Contains(*result.Links.First, "page[limit]=500") {
assert.Fail(s.T(), "Limit is more than max", "Expected limit to be %d, got %v", 100, *result.Links.First)
Copy link

Choose a reason for hiding this comment

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

I know it's just a test but shouldn't the 100 in this line be 500? Since you went to the trouble of creating pageSizeMax constant why not use it here and in the string check on the previous line so this code doesn't have to change again when our page size changes to something else? A test should never have to change once it's created

Choose a reason for hiding this comment

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

What happens in 2 weeks when we have more than 500 work items?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stevengutz As mentioned in the description this is a temporary fix in backend. The actual fix would lie in the front-end. The UI does not support pagination as of now. Loading all the data from db at once would lead to performance issues in planner. This PR would be reverted once we have proper pagination in the UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stevengutz thanks for pointing out. The 100 should actually be 1000 because that is the expected limit as mentioned in line number 198

Copy link
Collaborator

Choose a reason for hiding this comment

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

@stevengutz I think this is what you're looking for: DhritiShikhar#3

Copy link
Collaborator

@kwk kwk left a comment

Choose a reason for hiding this comment

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

Please see my PR: DhritiShikhar#3

If limit is above MaxPageSize, expect MaxPageSize
@DhritiShikhar DhritiShikhar merged commit eae146f into fabric8-services:master Jul 13, 2018
kwk added a commit to openshiftio/saas-openshiftio that referenced this pull request Jul 16, 2018
**commit** fabric8-services/fabric8-wit@cefe36a
**Author:** Rohit Kumar Rai <rohitkrai03@gmail.com>
**Date:**   Wed Jul 11 17:54:40 2018 +0530

Changed SHA checksum for dep-darwin-amd64 and setting UNAME_S variable (fabric8-services/fabric8-wit#2163)

- For macOS dep package was updated with a new SHA. This SHA value is checked in `Makefile` with a hardcoded SHA checksum to verify dep package.
- Updated the SHA value to new one.
- Added initialization of `$(UNAME_S)` variable `UNAME_S=$(shell uname -s)` since it was being used but never set which lead to explicitly exporting the variable from shell.

Similar PR for fabric8-auth - fabric8-services/fabric8-auth#549

Note: We can probably look into automating the process where SHA value is fetched dynamically instead of hard coding.

**commit** fabric8-services/fabric8-wit@f13e094
**Author:** Elliott Baron <ebaron@redhat.com>
**Date:**   Wed Jul 11 13:46:08 2018 -0400

Add parameter to Delete Space to skip deleting OpenShift resources (fabric8-services/fabric8-wit#2121)

When a user resets their environment, the front-end makes calls to the Delete Space API and Clean Tenant API. It makes these calls asynchronously, and due to both APIs acting on the same resources, I suspect this is the reason we are seeing a variety of errors in openshiftio/openshift.io#3500.

Since the Clean Tenant API cleans out the user's entire namespaces, it is not necessary in this case for Delete Space to delete anything from OpenShift. This PR adds an optional parameter skipCluster, to the Delete Space API, which if true, will not attempt to delete any deployments from OpenShift. The front-end could then use this parameter only when resetting the user's environment. An alternative would be for the front-end to synchronize between deleting spaces and calling Clean Tenant, but this would be less efficient.

Fixes (partially): openshiftio/openshift.io#3500

**commit** fabric8-services/fabric8-wit@cb85aa7
**Author:** Ibrahim Jarif <jarifibrahim@gmail.com>
**Date:**   Fri Jul 13 12:57:43 2018 +0530

Refactor search_blackbox_test.go (fabric8-services/fabric8-wit#2148)

**commit** eae146f7d3cdf1d6c40588608e60d688aaf6ad83
**Author:** Dhriti Shikhar <dhriti.shikhar.rokz@gmail.com>
**Date:**   Fri Jul 13 16:55:40 2018 +0530

Increase paging limit (fabric8-services/fabric8-wit#2166)

**commit** fabric8-services/fabric8-wit@d198813
**Author:** Baiju Muthukadan <baiju.m.mail@gmail.com>
**Date:**   Fri Jul 13 17:46:12 2018 +0530

Revert "List work items part of child iterations (fabric8-services/fabric8-wit#2146)" (fabric8-services/fabric8-wit#2168)

This reverts commit 68996d1555a29a9ef310403403855b47559d5a71.


This is required to address #3974

**commit** fabric8-services/fabric8-wit@a4d9061
**Author:** Michael Kleinhenz <kleinhenz@redhat.com>
**Date:**   Fri Jul 13 16:24:37 2018 +0200

feat(boardview): Board View for WIT. (fabric8-services/fabric8-wit#2111)
aslakknutsen pushed a commit to openshiftio/saas-openshiftio that referenced this pull request Jul 17, 2018
**commit** fabric8-services/fabric8-wit@cefe36a
**Author:** Rohit Kumar Rai <rohitkrai03@gmail.com>
**Date:**   Wed Jul 11 17:54:40 2018 +0530

Changed SHA checksum for dep-darwin-amd64 and setting UNAME_S variable (fabric8-services/fabric8-wit#2163)

- For macOS dep package was updated with a new SHA. This SHA value is checked in `Makefile` with a hardcoded SHA checksum to verify dep package.
- Updated the SHA value to new one.
- Added initialization of `$(UNAME_S)` variable `UNAME_S=$(shell uname -s)` since it was being used but never set which lead to explicitly exporting the variable from shell.

Similar PR for fabric8-auth - fabric8-services/fabric8-auth#549

Note: We can probably look into automating the process where SHA value is fetched dynamically instead of hard coding.

**commit** fabric8-services/fabric8-wit@f13e094
**Author:** Elliott Baron <ebaron@redhat.com>
**Date:**   Wed Jul 11 13:46:08 2018 -0400

Add parameter to Delete Space to skip deleting OpenShift resources (fabric8-services/fabric8-wit#2121)

When a user resets their environment, the front-end makes calls to the Delete Space API and Clean Tenant API. It makes these calls asynchronously, and due to both APIs acting on the same resources, I suspect this is the reason we are seeing a variety of errors in openshiftio/openshift.io#3500.

Since the Clean Tenant API cleans out the user's entire namespaces, it is not necessary in this case for Delete Space to delete anything from OpenShift. This PR adds an optional parameter skipCluster, to the Delete Space API, which if true, will not attempt to delete any deployments from OpenShift. The front-end could then use this parameter only when resetting the user's environment. An alternative would be for the front-end to synchronize between deleting spaces and calling Clean Tenant, but this would be less efficient.

Fixes (partially): openshiftio/openshift.io#3500

**commit** fabric8-services/fabric8-wit@cb85aa7
**Author:** Ibrahim Jarif <jarifibrahim@gmail.com>
**Date:**   Fri Jul 13 12:57:43 2018 +0530

Refactor search_blackbox_test.go (fabric8-services/fabric8-wit#2148)

**commit** eae146f7d3cdf1d6c40588608e60d688aaf6ad83
**Author:** Dhriti Shikhar <dhriti.shikhar.rokz@gmail.com>
**Date:**   Fri Jul 13 16:55:40 2018 +0530

Increase paging limit (fabric8-services/fabric8-wit#2166)

**commit** fabric8-services/fabric8-wit@d198813
**Author:** Baiju Muthukadan <baiju.m.mail@gmail.com>
**Date:**   Fri Jul 13 17:46:12 2018 +0530

Revert "List work items part of child iterations (fabric8-services/fabric8-wit#2146)" (fabric8-services/fabric8-wit#2168)

This reverts commit 68996d1555a29a9ef310403403855b47559d5a71.


This is required to address #3974

**commit** fabric8-services/fabric8-wit@a4d9061
**Author:** Michael Kleinhenz <kleinhenz@redhat.com>
**Date:**   Fri Jul 13 16:24:37 2018 +0200

feat(boardview): Board View for WIT. (fabric8-services/fabric8-wit#2111)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WIT Pagination not working correctly: "hides" Work Items that are beyond position 102
6 participants