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

Int 11348 increase page size #42

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

Gonzalo-Avalos-Ribas
Copy link
Contributor

@Gonzalo-Avalos-Ribas Gonzalo-Avalos-Ribas commented Jul 29, 2024

Description

Thank you for contributing to a JupiterOne integration!

Please include a summary of the change and which issue is fixed. Please also
include relevant motivation and context. List any dependencies that are required
for this change.

Summary

We are making too many requests for this endpoints, to reduce the number lets increase the number of things we bring per call (page size). This could still be fine-tuned, but 200 is x4 what we used to have

Type of change

Please leave any irrelevant options unchecked.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

Checklist

General Development Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Integration Development Checklist:

Please leave any irrelevant options unchecked.

  • I have checked for additional permissions required to call any new API
    endpoints, and have documented any additional permissions in
    jupiterone.md, where necessary.
  • My changes properly paginate the target service provider's API
  • My changes properly handle rate limiting of the target service provider's
    API
  • My new integration step is instrumented to execute in the correct order
    using dependsOn
  • I have referred to the
    JupiterOne data model
    to ensure that any new entities/relationships, and relevant properties,
    match the recommended model for this class of data
  • I have updated the CHANGELOG.md file to describe my changes
  • When changes include modifications to existing graph data ingestion, I've
    reviewed all existing managed questions referencing the entities,
    relationships, and their property names, to ensure those questions still
    function with my changes.

private async iterateSecurityResource<T>({
resourceUrl,
callback,
limit = 50,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
limit = 50,
limit = ITEMS_PER_PAGE,

'CompactToken parsing failed with error code: 80049217' &&
retries < 5
) {
// Retry a few times to handle sporadic timing issue with this sdk - https://github.com/OneDrive/onedrive-api-docs/issues/785
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Retry a few times to handle sporadic timing issue with this sdk - https://github.com/OneDrive/onedrive-api-docs/issues/785
// Retry without sleeping a few times to handle sporadic timing issue with this sdk - https://github.com/OneDrive/onedrive-api-docs/issues/785

objectsSeen += response.value.length;
}
skip += limit;
} while (skip == objectsSeen);
Copy link
Contributor

Choose a reason for hiding this comment

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

If there were exactly 200 objects to iterate over, could this allow for an extra request that'd fail? Or would it just respond with an empty collection?

@Gonzalo-Avalos-Ribas Gonzalo-Avalos-Ribas merged commit 11e8d84 into main Jul 30, 2024
8 checks passed
@Gonzalo-Avalos-Ribas Gonzalo-Avalos-Ribas deleted the INT-11348-increase-page-size branch July 30, 2024 12:40
@j1-internal-automation
Copy link
Collaborator

🚀 PR was released in v1.7.3 🚀

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.

3 participants