mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-24 18:25:22 +00:00
fix(gitlab): Better error logs for gitlab config sync (#692)
This commit is contained in:
parent
84e53c8576
commit
1e5cf7c8bf
2 changed files with 19 additions and 13 deletions
|
|
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Changed
|
### Changed
|
||||||
- Bake Sourcebot version into code rather than relying on build arg. [#680](https://github.com/sourcebot-dev/sourcebot/pull/680)
|
- Bake Sourcebot version into code rather than relying on build arg. [#680](https://github.com/sourcebot-dev/sourcebot/pull/680)
|
||||||
- Fix issue with `/repos` page pagination. [#689](https://github.com/sourcebot-dev/sourcebot/pull/689)
|
- Fix issue with `/repos` page pagination. [#689](https://github.com/sourcebot-dev/sourcebot/pull/689)
|
||||||
|
- Add better logs for gitlab config sync fails. [#692](https://github.com/sourcebot-dev/sourcebot/pull/692)
|
||||||
|
|
||||||
## [4.10.4] - 2025-12-18
|
## [4.10.4] - 2025-12-18
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,14 +97,16 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
|
||||||
logger.error(`Failed to fetch projects for group ${group}.`, e);
|
logger.error(`Failed to fetch projects for group ${group}.`, e);
|
||||||
|
|
||||||
const status = e?.cause?.response?.status;
|
const status = e?.cause?.response?.status;
|
||||||
if (status === 404) {
|
if (status !== undefined) {
|
||||||
const warning = `Group ${group} not found or no access`;
|
const warning = `GitLab API returned ${status}`
|
||||||
logger.warn(warning);
|
logger.warning(warning);
|
||||||
return {
|
return {
|
||||||
type: 'warning' as const,
|
type: 'warning' as const,
|
||||||
warning
|
warning
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.error("No API response status returned");
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
@ -135,14 +137,16 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
|
||||||
logger.error(`Failed to fetch projects for user ${user}.`, e);
|
logger.error(`Failed to fetch projects for user ${user}.`, e);
|
||||||
|
|
||||||
const status = e?.cause?.response?.status;
|
const status = e?.cause?.response?.status;
|
||||||
if (status === 404) {
|
if (status !== undefined) {
|
||||||
const warning = `User ${user} not found or no access`;
|
const warning = `GitLab API returned ${status}`
|
||||||
logger.warn(warning);
|
logger.warning(warning);
|
||||||
return {
|
return {
|
||||||
type: 'warning' as const,
|
type: 'warning' as const,
|
||||||
warning
|
warning
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.error("No API response status returned");
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
@ -171,15 +175,16 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
|
||||||
logger.error(`Failed to fetch project ${project}.`, e);
|
logger.error(`Failed to fetch project ${project}.`, e);
|
||||||
|
|
||||||
const status = e?.cause?.response?.status;
|
const status = e?.cause?.response?.status;
|
||||||
|
if (status !== undefined) {
|
||||||
if (status === 404) {
|
const warning = `GitLab API returned ${status}`
|
||||||
const warning = `Project ${project} not found or no access`;
|
logger.warning(warning);
|
||||||
logger.warn(warning);
|
|
||||||
return {
|
return {
|
||||||
type: 'warning' as const,
|
type: 'warning' as const,
|
||||||
warning
|
warning
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.error("No API response status returned");
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue