Skip to content

Commit

Permalink
Adds language to the github-repos resolver (#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenac95 authored May 20, 2024
1 parent 6514f58 commit 5560b42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export interface Repository {
name: string;
spdxId: string;
};
language: string;
}

export type FullRepository = Repository & {
Expand Down Expand Up @@ -247,6 +248,7 @@ export async function getOwnerReposRest(
spdxId: r.license?.spdx_id || "",
name: r.license?.name || "",
},
language: r.language || "",
};
});
} catch (err) {
Expand Down Expand Up @@ -275,6 +277,7 @@ export async function getOwnerReposRest(
spdxId: r.license?.spdx_id || "",
name: r.license?.name || "",
},
language: r.language || "",
};
});
} catch (tryUserErr) {
Expand Down Expand Up @@ -337,6 +340,7 @@ function restRepoDataToFullRepository(r: RestRepoData): FullRepository {
spdxId: r.license?.spdx_id || "",
name: r.license?.name || "",
},
language: r.language || "",
};
}

Expand Down
4 changes: 4 additions & 0 deletions warehouse/cloudquery-github-resolve-repos/src/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ const getRepositories = async (
newColumn("license_name", {
notNull: false,
}),
newColumn("language", {
notNull: false,
}),
];

const tableResolver: TableResolver = async (clientMeta, parent, stream) => {
Expand Down Expand Up @@ -128,6 +131,7 @@ const getRepositories = async (
license_spdx_id:
repo.license.spdxId == "" ? null : repo.license.spdxId,
license_name: repo.license.name == "" ? null : repo.license.name,
language: repo.language,
};
stream.write(record);
}
Expand Down

0 comments on commit 5560b42

Please sign in to comment.