Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2026-02-16 16:24:49 +01:00
parent c66e434b8e
commit d9e1ef22a5
2 changed files with 19 additions and 12 deletions
@@ -90,8 +90,8 @@ export class GitlabUrlReader implements UrlReaderService {
...(etag && !isArtifact && { 'If-None-Match': etag }),
...(lastModifiedAfter &&
!isArtifact && {
'If-Modified-Since': lastModifiedAfter.toUTCString(),
}),
'If-Modified-Since': lastModifiedAfter.toUTCString(),
}),
},
// TODO(freben): The signal cast is there because pre-3.x versions of
// node-fetch have a very slightly deviating AbortSignal type signature.
@@ -208,10 +208,11 @@ export class GitlabUrlReader implements UrlReaderService {
archiveReqParams.set('path', filepath);
}
// https://docs.gitlab.com/ee/api/repositories.html#get-file-archive
const reqUrl = `${this.integration.config.apiBaseUrl
}/projects/${encodeURIComponent(
repoFullName,
)}/repository/archive?${archiveReqParams.toString()}`;
const reqUrl = `${
this.integration.config.apiBaseUrl
}/projects/${encodeURIComponent(
repoFullName,
)}/repository/archive?${archiveReqParams.toString()}`;
const archiveGitLabResponse = await this.integration.fetch(reqUrl, {
...getGitLabRequestOptions(this.integration.config, token),
// TODO(freben): The signal cast is there because pre-3.x versions of
@@ -312,8 +312,10 @@ describe('GitLabClient', () => {
describe('listFiles', () => {
it('should call group search API with correct scope parameter', async () => {
const client = new GitLabClient({
config: readGitLabIntegrationConfig(
new ConfigReader(mock.config_self_managed),
integration: new GitLabIntegration(
readGitLabIntegrationConfig(
new ConfigReader(mock.config_self_managed),
),
),
logger: mockServices.logger.mock(),
});
@@ -341,8 +343,10 @@ describe('GitLabClient', () => {
it('should return empty items when group is missing', async () => {
const client = new GitLabClient({
config: readGitLabIntegrationConfig(
new ConfigReader(mock.config_self_managed),
integration: new GitLabIntegration(
readGitLabIntegrationConfig(
new ConfigReader(mock.config_self_managed),
),
),
logger: mockServices.logger.mock(),
});
@@ -356,8 +360,10 @@ describe('GitLabClient', () => {
it('should return empty items when search is missing', async () => {
const client = new GitLabClient({
config: readGitLabIntegrationConfig(
new ConfigReader(mock.config_self_managed),
integration: new GitLabIntegration(
readGitLabIntegrationConfig(
new ConfigReader(mock.config_self_managed),
),
),
logger: mockServices.logger.mock(),
});