feat: add workflow run logs page and retrieval API#911
feat: add workflow run logs page and retrieval API#911mertilginoglu wants to merge 11 commits intostagingfrom
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
4e22087 to
435d434
Compare
52b3088 to
1cd69bd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cd69bd1e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Optional<WorkflowRunLogManifest> existingManifest = readManifest(runDirectory); | ||
| if (existingManifest.isPresent()) { | ||
| return new WorkflowRunLogCacheResult(workflowRun, runDirectory, existingManifest.get(), true); |
There was a problem hiding this comment.
Refresh cached logs when a workflow run gets a new attempt
If a workflow run is rerun, GitHubWorkflowRunSyncService.process updates the existing WorkflowRun row in place and GitHubWorkflowRunConverter.update records the new runAttempt, but cacheLogs() returns any existing manifest without checking either field. In that scenario /api/workflows/runs/{workflowRunId}/logs — and the new “Refresh Logs” button — will keep serving the previous attempt's archive until the daily cleanup removes it, so users can inspect stale logs for up to a day after a rerun.
Useful? React with 👍 / 👎.
| private void deleteQuietly(Path path) { | ||
| try { | ||
| Files.deleteIfExists(path); | ||
| } catch (IOException e) { | ||
| log.warn("Failed to delete temporary workflow log path {}", path, e); |
There was a problem hiding this comment.
Propagate cache-delete failures to the cleanup task
This helper swallows every IOException from Files.deleteIfExists, but WorkflowRunLogCleanupTask.cleanRunDirectory increments summary.deleted unless deleteRecursively() throws. When an expired cache contains a file that cannot be removed (for example due to permissions or transient filesystem errors), the task will report the run as deleted and never increment deleteFailures, leaving partial cache data on disk while the cleanup summary says it succeeded.
Useful? React with 👍 / 👎.
Motivation
Helios currently shows workflow run status, but it does not provide an in-app way to inspect the underlying logs. Reviewing failures still requires switching to GitHub.
Description
/api/workflows/runs/{workflowRunId}/logsTesting Instructions
Prerequisites:
Flow:
/repo/<repositoryId>/workflow-runs/<workflowRunId>/logsfor a recently completed workflow run.Open on GitHub/Refresh Logsactions.[group],[command],[warning], and[error]are rendered in a readable way.cd server && ./gradlew :application-server:test.cd server && ./gradlew :application-server:generateOpenApiDocsandcd client && yarn generate:openapi, then verify no additional generated changes remain.Screenshots
Not attached in this draft.
Checklist
General
Server
Client