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

Make servicenow faster - more resilient #51

Merged
merged 3 commits into from
Jun 18, 2024
Merged

Conversation

Gonzalo-Avalos-Ribas
Copy link
Contributor

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

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.

@Gonzalo-Avalos-Ribas Gonzalo-Avalos-Ribas requested a review from a team as a code owner June 18, 2024 13:17
@@ -122,20 +122,6 @@ export class ServiceNowClient {
const response = await this.request({ url });
const result = response?.data?.result;

const redactedResponse = {
Copy link
Contributor Author

@Gonzalo-Avalos-Ribas Gonzalo-Avalos-Ribas Jun 18, 2024

Choose a reason for hiding this comment

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

Removed log

for (const r of paginatedResponse.result) {
await callback(r);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed log

@@ -13,10 +13,6 @@ export const Steps = {
GROUP_MEMBERS: 'step-group-members',
INCIDENTS: 'step-incidents',
CMDB: 'step-cmdb',
USER_OWNS_CMDB: 'step_user_owns_cmdb',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merged this 4 steps into the cmdb step to make the whole process faster

@@ -35,113 +35,80 @@ export async function fetchCMDB(

await client.iterateTableResources({
table: parent,
limit: 3_000,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Default for table api is 10_000 so the api is really good at handling large amounts of data. I bumped by x6 to be careful with our memory usage

@@ -106,7 +107,7 @@ export function createIncidentAssigneeRelationship(
fromType: Entities.INCIDENT._type,
fromKey: incident.sys_id,
toType: Entities.USER._type,
toKey: incident.assigned_to.value,
toKey: incident.assigned_to?.value,
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't the toKey need to always be present?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, I'll remove the optional chaining there

RonaldEAM
RonaldEAM previously approved these changes Jun 18, 2024
Copy link
Contributor

@RonaldEAM RonaldEAM left a comment

Choose a reason for hiding this comment

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

LGTM!

@Gonzalo-Avalos-Ribas Gonzalo-Avalos-Ribas merged commit 0530f9d into main Jun 18, 2024
8 checks passed
@Gonzalo-Avalos-Ribas Gonzalo-Avalos-Ribas deleted the INT-11064 branch June 18, 2024 13:29
@j1-internal-automation
Copy link
Collaborator

🚀 PR was released in v1.4.0 🚀

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

Successfully merging this pull request may close these issues.

None yet

4 participants