Loading CONTRIBUTORS.md +1 −0 Original line number Diff line number Diff line Loading @@ -34,3 +34,4 @@ - Lennard Sprong [@X_Sheep](https://gitlab.com/X_Sheep) - Florian Dageförde [@dagefoerde.florian](https://gitlab.com/dagefoerde.florian) - Elian Cordoba [@ElianCordoba](https://gitlab.com/ElianCordoba) - Tim Ryan [@TimRyanUBS](https://gitlab.com/TimRyanUBS) src/desktop/ci/job_log_cache.ts +2 −2 Original line number Diff line number Diff line Loading @@ -63,10 +63,10 @@ export class JobLogCache { if (exists) this.#onDidChangeEmitter.fire(jobId); } startRefreshing(jobId: number) { startRefreshing(projectId: number, jobId: number) { const item = this.#storage[jobId]; if (!item || item.eTag === null || item.refresher) return; item.refresher = new JobLogRefresher(this, jobId); item.refresher = new JobLogRefresher(this, projectId, jobId); } stopRefreshing(jobId: number) { Loading src/desktop/ci/job_log_content_provider.test.ts +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ jest.mock('../gitlab/get_gitlab_service'); jest.mock('../gitlab/gitlab_project_repository'); describe('JobLogContentProvider', () => { const uri = toJobLogUri('/repo', 123); const uri = toJobLogUri('/repo', 123, 123); beforeEach(async () => { const rawTrace = await fs.readFile( Loading src/desktop/ci/job_log_content_provider.ts +6 −3 Original line number Diff line number Diff line Loading @@ -165,7 +165,10 @@ export class JobLogContentProvider implements vscode.TextDocumentContentProvider }); undecoratedJobLogEditors.forEach(e => { doNotAwait(this.#decorateJobTextEditor(e)); jobLogCache.startRefreshing(fromJobLogUri(e.document.uri).job); jobLogCache.startRefreshing( fromJobLogUri(e.document.uri).projectId, fromJobLogUri(e.document.uri).job, ); }); } Loading Loading @@ -224,13 +227,13 @@ export class JobLogContentProvider implements vscode.TextDocumentContentProvider } async provideTextDocumentContent(uri: vscode.Uri): Promise<string | undefined> { const { repositoryRoot, job: id } = fromJobLogUri(uri); const { repositoryRoot, projectId, job: id } = fromJobLogUri(uri); if (!jobLogCache.get(id)) { const projectInRepository = getProjectRepository().getProjectOrFail(repositoryRoot); const gitlabService = getGitLabService(projectInRepository); const response = await gitlabService.getJobTrace(projectInRepository.project, id); const response = await gitlabService.getJobTrace(projectInRepository.project, projectId, id); assert(response); const { rawTrace, eTag } = response; Loading src/desktop/ci/job_log_refresher.test.ts +2 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ describe('JobLogRefresher', () => { jobLogCache.setForRunning('root', 123, 'raw trace', 'eTag'); jobLogCache.startRefreshing(123); jobLogCache.startRefreshing(123, 123); jest.advanceTimersToNextTimer(); Loading @@ -50,7 +50,7 @@ describe('JobLogRefresher', () => { it('aborts when cache is missing', async () => { // eslint-disable-next-line no-new new JobLogRefresher(jobLogCache, 123); new JobLogRefresher(jobLogCache, 123, 123); expect(jest.getTimerCount()).toBe(1); Loading Loading
CONTRIBUTORS.md +1 −0 Original line number Diff line number Diff line Loading @@ -34,3 +34,4 @@ - Lennard Sprong [@X_Sheep](https://gitlab.com/X_Sheep) - Florian Dageförde [@dagefoerde.florian](https://gitlab.com/dagefoerde.florian) - Elian Cordoba [@ElianCordoba](https://gitlab.com/ElianCordoba) - Tim Ryan [@TimRyanUBS](https://gitlab.com/TimRyanUBS)
src/desktop/ci/job_log_cache.ts +2 −2 Original line number Diff line number Diff line Loading @@ -63,10 +63,10 @@ export class JobLogCache { if (exists) this.#onDidChangeEmitter.fire(jobId); } startRefreshing(jobId: number) { startRefreshing(projectId: number, jobId: number) { const item = this.#storage[jobId]; if (!item || item.eTag === null || item.refresher) return; item.refresher = new JobLogRefresher(this, jobId); item.refresher = new JobLogRefresher(this, projectId, jobId); } stopRefreshing(jobId: number) { Loading
src/desktop/ci/job_log_content_provider.test.ts +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ jest.mock('../gitlab/get_gitlab_service'); jest.mock('../gitlab/gitlab_project_repository'); describe('JobLogContentProvider', () => { const uri = toJobLogUri('/repo', 123); const uri = toJobLogUri('/repo', 123, 123); beforeEach(async () => { const rawTrace = await fs.readFile( Loading
src/desktop/ci/job_log_content_provider.ts +6 −3 Original line number Diff line number Diff line Loading @@ -165,7 +165,10 @@ export class JobLogContentProvider implements vscode.TextDocumentContentProvider }); undecoratedJobLogEditors.forEach(e => { doNotAwait(this.#decorateJobTextEditor(e)); jobLogCache.startRefreshing(fromJobLogUri(e.document.uri).job); jobLogCache.startRefreshing( fromJobLogUri(e.document.uri).projectId, fromJobLogUri(e.document.uri).job, ); }); } Loading Loading @@ -224,13 +227,13 @@ export class JobLogContentProvider implements vscode.TextDocumentContentProvider } async provideTextDocumentContent(uri: vscode.Uri): Promise<string | undefined> { const { repositoryRoot, job: id } = fromJobLogUri(uri); const { repositoryRoot, projectId, job: id } = fromJobLogUri(uri); if (!jobLogCache.get(id)) { const projectInRepository = getProjectRepository().getProjectOrFail(repositoryRoot); const gitlabService = getGitLabService(projectInRepository); const response = await gitlabService.getJobTrace(projectInRepository.project, id); const response = await gitlabService.getJobTrace(projectInRepository.project, projectId, id); assert(response); const { rawTrace, eTag } = response; Loading
src/desktop/ci/job_log_refresher.test.ts +2 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ describe('JobLogRefresher', () => { jobLogCache.setForRunning('root', 123, 'raw trace', 'eTag'); jobLogCache.startRefreshing(123); jobLogCache.startRefreshing(123, 123); jest.advanceTimersToNextTimer(); Loading @@ -50,7 +50,7 @@ describe('JobLogRefresher', () => { it('aborts when cache is missing', async () => { // eslint-disable-next-line no-new new JobLogRefresher(jobLogCache, 123); new JobLogRefresher(jobLogCache, 123, 123); expect(jest.getTimerCount()).toBe(1); Loading