@@ -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(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user