mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-11 15:29:46 +00:00
Improve messaging
This commit is contained in:
@@ -141,7 +141,6 @@ export const registerGithubOrgSyncRouter = async (server: FastifyZodProvider) =>
|
||||
response: {
|
||||
200: z.object({
|
||||
syncedUsersCount: z.number(),
|
||||
skippedUsersCount: z.number(),
|
||||
totalUsers: z.number(),
|
||||
errors: z.array(z.string()),
|
||||
createdTeams: z.array(z.string()),
|
||||
@@ -159,7 +158,6 @@ export const registerGithubOrgSyncRouter = async (server: FastifyZodProvider) =>
|
||||
|
||||
return {
|
||||
syncedUsersCount: result.syncedUsersCount,
|
||||
skippedUsersCount: result.skippedUsersCount,
|
||||
totalUsers: result.totalUsers,
|
||||
errors: result.errors,
|
||||
createdTeams: result.createdTeams,
|
||||
|
||||
@@ -417,7 +417,9 @@ export const githubOrgSyncServiceFactory = ({
|
||||
}
|
||||
});
|
||||
|
||||
await octokitGraphQL.graphql(`query { organization(login: $org) { id name } }`, { org: config.githubOrgName });
|
||||
await octokitGraphQL.graphql(`query($org: String!) { organization(login: $org) { id name } }`, {
|
||||
org: config.githubOrgName
|
||||
});
|
||||
|
||||
return {
|
||||
valid: true,
|
||||
@@ -550,7 +552,6 @@ export const githubOrgSyncServiceFactory = ({
|
||||
|
||||
const startTime = Date.now();
|
||||
let syncedUsersCount = 0;
|
||||
let skippedUsersCount = 0;
|
||||
const syncErrors: string[] = [];
|
||||
const createdTeams = new Set<string>();
|
||||
const updatedTeams = new Set<string>();
|
||||
@@ -765,8 +766,6 @@ export const githubOrgSyncServiceFactory = ({
|
||||
for (const member of activeMembers) {
|
||||
try {
|
||||
if (!member.userId) {
|
||||
skippedUsersCount += 1;
|
||||
syncErrors.push("Member without userId found, skipping");
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
@@ -774,8 +773,6 @@ export const githubOrgSyncServiceFactory = ({
|
||||
const githubUsername = githubUsernameMap.get(member.userId);
|
||||
|
||||
if (!githubUsername) {
|
||||
skippedUsersCount += 1;
|
||||
syncErrors.push(`User ${member.userId}: No GitHub username found. User needs to log in at least once.`);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
@@ -811,7 +808,6 @@ export const githubOrgSyncServiceFactory = ({
|
||||
{
|
||||
orgId: orgPermission.orgId,
|
||||
syncedUsersCount,
|
||||
skippedUsersCount,
|
||||
totalUsers: activeMembers.length,
|
||||
createdTeams: createdTeams.size,
|
||||
updatedTeams: updatedTeams.size,
|
||||
@@ -824,7 +820,6 @@ export const githubOrgSyncServiceFactory = ({
|
||||
|
||||
return {
|
||||
syncedUsersCount,
|
||||
skippedUsersCount,
|
||||
totalUsers: activeMembers.length,
|
||||
errors: syncErrors,
|
||||
createdTeams: Array.from(createdTeams),
|
||||
|
||||
@@ -29,7 +29,6 @@ export interface TSyncAllTeamsDTO {
|
||||
|
||||
export interface TSyncResult {
|
||||
syncedUsersCount: number;
|
||||
skippedUsersCount: number;
|
||||
totalUsers: number;
|
||||
errors: string[];
|
||||
createdTeams: string[];
|
||||
|
||||
Reference in New Issue
Block a user