You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "avanier (via GitHub)" <gi...@apache.org> on 2023/05/16 17:20:56 UTC

[GitHub] [incubator-devlake] avanier opened a new issue, #5212: [Bug][PagerDuty Plugin] Unable to list over 99 services when configuring the Data Scope

avanier opened a new issue, #5212:
URL: https://github.com/apache/incubator-devlake/issues/5212

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   While configuring the data scope of a PagerDuty integration you get to select which PagerDuty services to target. If you scroll down, the list will lazy-load additional services. This bug is that if your organization has more than `99` services, the same first `99` services are lazy-loaded.
   
   This really sounds like an API paging offset bug.
   
   ### What do you expect to happen
   
   When I scroll down the list of services,  I get a continuous list of services.
   
   ### How to reproduce
   
   Have a PagerDuty organization with 101 services.
   
   ### Anything else
   
   I've had a quick sift through the code, but I haven't found where that happens yet.
   
   I'll invoke @keon94 's attention because I get a sense he may know where the issue lies. :grin: 
   
   ### Version
   
   main
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] avanier commented on issue #5212: [Bug][PagerDuty Plugin] Unable to list over 99 services when configuring the Data Scope

Posted by "avanier (via GitHub)" <gi...@apache.org>.
avanier commented on issue #5212:
URL: https://github.com/apache/incubator-devlake/issues/5212#issuecomment-1550252469

   @keon94 Here's the PR! :tada: 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 commented on issue #5212: [Bug][PagerDuty Plugin] Unable to list over 99 services when configuring the Data Scope

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 commented on issue #5212:
URL: https://github.com/apache/incubator-devlake/issues/5212#issuecomment-1550193236

   @avanier Appreciate your digging into this. Let us know if your suggestion above works, and if so, feel free to open a PR and link it here.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 commented on issue #5212: [Bug][PagerDuty Plugin] Unable to list over 99 services when configuring the Data Scope

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 commented on issue #5212:
URL: https://github.com/apache/incubator-devlake/issues/5212#issuecomment-1551967835

   @avanier In my testing, after creating about 250 services, scrolling down would keep repeating the same list of services; it wasn't not capped to 99. At any rate, you code change does fix the bug.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] avanier commented on issue #5212: [Bug][PagerDuty Plugin] Unable to list over 99 services when configuring the Data Scope

Posted by "avanier (via GitHub)" <gi...@apache.org>.
avanier commented on issue #5212:
URL: https://github.com/apache/incubator-devlake/issues/5212#issuecomment-1550119389

   Found it. The bug is [here](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/pagerduty/api/remote.go#L305).
   
   This should be:
   
   ```diff
    func GetQueryFromPageData(pageData *PageData) (url.Values, errors.Error) {
           query := url.Values{}
   -       query.Set("offset", fmt.Sprintf("%v", pageData.Page))
   +       query.Set("offset", fmt.Sprintf("%v", pageData.Page*pageData.PerPage))
           query.Set("limit", fmt.Sprintf("%v", pageData.PerPage))
           return query, nil
    }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 closed issue #5212: [Bug][PagerDuty Plugin] Unable to list over 99 services when configuring the Data Scope

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 closed issue #5212: [Bug][PagerDuty Plugin] Unable to list over 99 services when configuring the Data Scope
URL: https://github.com/apache/incubator-devlake/issues/5212


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] avanier commented on issue #5212: [Bug][PagerDuty Plugin] Unable to list over 99 services when configuring the Data Scope

Posted by "avanier (via GitHub)" <gi...@apache.org>.
avanier commented on issue #5212:
URL: https://github.com/apache/incubator-devlake/issues/5212#issuecomment-1550103258

   After a bit of digging, I think it's happening [here](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/pagerduty/api/remote.go#L158-L180), but I still haven't wrapped my head how the paging happens.
   
   I think it might be [here](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/pagerduty/api/remote.go#L236-L249), but I have yet to understand what this `nextPageToken` is. There's no reference to it in the PagerDuty API documentation, so I'm guessing it's an internal generic for handling paging.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] JoshuaPoddoku commented on issue #5212: [Bug][PagerDuty Plugin] Unable to list over 99 services when configuring the Data Scope

Posted by "JoshuaPoddoku (via GitHub)" <gi...@apache.org>.
JoshuaPoddoku commented on issue #5212:
URL: https://github.com/apache/incubator-devlake/issues/5212#issuecomment-1558065388

   Hi  @avanier  
   Thank you for your contribution!
   
   I’m Joshua Poddoku, Lead Evangelist for Apache DevLake.
   
   We would want to issue you a certificate to honor your contribution on behalf of Apache DevLake and feature you on [contributors page](https://devlake.apache.org/team).
   
   I just wanted to confirm if your full name is “Alexis Vanier”. I suggest if you could join our slack for communication: https://join.slack.com/t/devlake-io/shared_invite/zt-18uayb6ut-cHOjiYcBwERQ8VVPZ9cQQw
   
   Kindly acknowledge! Thanks again


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org