Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Github Graphql improvements (#281)
Browse files Browse the repository at this point in the history
Co-authored-by: j1-internal-automation <[email protected]>
  • Loading branch information
RonaldEAM and j1-internal-automation authored Nov 20, 2023
1 parent 8bff8e4 commit ad7c0bf
Show file tree
Hide file tree
Showing 142 changed files with 14,722 additions and 143,837 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,17 @@
"@octokit/request": "^5.6.3",
"@octokit/rest": "^19.0.3",
"date-fns": "^2.29.3",
"p-map": "^4.0.0",
"lodash": "^4.17.21",
"semver": "^7.3.7"
},
"peerDependencies": {
"@jupiterone/integration-sdk-core": "^11.0.3"
"@jupiterone/integration-sdk-core": "^11.2.0"
},
"devDependencies": {
"@jupiterone/integration-sdk-core": "^11.0.3",
"@jupiterone/integration-sdk-dev-tools": "^11.0.3",
"@jupiterone/integration-sdk-testing": "^11.0.3",
"@jupiterone/integration-sdk-core": "^11.2.0",
"@jupiterone/integration-sdk-dev-tools": "^11.2.0",
"@jupiterone/integration-sdk-testing": "^11.2.0",
"@octokit/graphql-schema": "^13.4.0",
"@types/lodash.omit": "^4.5.6",
"@types/node": "^20.8.2",
"@types/semver": "^7.3.13",
"auto": "^10.36.5"
Expand Down
142 changes: 71 additions & 71 deletions src/actions/__recordings__/partialIngest_1257640542/recording.har

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions src/actions/partialIngestActionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
IntegrationError,
IntegrationLogger,
} from '@jupiterone/integration-sdk-core';
import { PullRequestResponse } from '../client/GraphQLClient';

interface EntityToIngest {
_type: string; // e.g. - github_pullrequest
Expand Down Expand Up @@ -104,7 +105,7 @@ const buildEntity = async (
await buildUserLoginMaps(client, repoName);

return toPullRequestEntity({
pullRequest,
pullRequest: pullRequest as unknown as PullRequestResponse,
commits: pullRequest.commits ?? [],
reviews: pullRequest.reviews ?? [],
labels: pullRequest.labels ?? [],
Expand All @@ -121,7 +122,12 @@ const buildUserLoginMaps = async (client: APIClient, repoName: string) => {
// There's not a good way to fetch a single member from an organization
// We can use a REST endpoint, but it pulls back different data.
await client.iterateOrgMembers((member) => {
memberByLoginMap.set(member.login, toOrganizationMemberEntity(member)._key);
if (member.login) {
memberByLoginMap.set(
member.login,
toOrganizationMemberEntity(member)._key,
);
}
});

await client.iterateRepoCollaborators(repoName, (collaborator) => {
Expand Down
Loading

0 comments on commit ad7c0bf

Please sign in to comment.