fix: refactor action log path resolution to a pure configuration helper - #164
Merged
cdsap merged 1 commit intoAug 31, 2026
Merged
Conversation
Owner
Author
|
@cdsap PR Judge blocked this PR for manual review. State: The judge will not auto-merge this PR until the risky diff is reviewed manually. |
cdsap
deleted the
issue/163-hermes-refactor-action-log-path-resolution-a1
branch
August 31, 2026 14:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
src/index_with_backend.ts:16-33mixes GitHub Action I/O, filesystem setup, default log-file collision handling, workspace-relative path resolution, and runtime orchestration in therun()entrypoint. The project already separates remote monitoring feature decisions into the pureresolveMonitoringFeatureFlagshelper insrc/monitoring_features.ts:20-56, but the local logging path rules remain embedded in the side-effect-heavy adapter.Why this matters
The log path rules affect cleanup, artifact discovery, and local-vs-workspace behavior. Keeping them inline makes small behavior changes harder to test without exercising the full action entrypoint and increases the chance of breaking default artifact naming or custom
log_filehandling.Proposed change
Introduce a small pure helper, for example
resolveActionLogFileTarget, that acceptslogFileInput,runId,workspaceDir,runnerTempRoot, and a boolean indicating whether the default log path already exists. ReturnrunnerTempDir,logFilePath,defaultLogFile, and whether the collision fallback was used. Keepfs.mkdirSync,fs.existsSync, andcore.infoinsrc/index_with_backend.ts, but move the path decision itself into the helper with focused Jest coverage.Notes
Clean architecture lens: this keeps the GitHub Action entrypoint as an infrastructure adapter and moves deterministic configuration policy into a small core helper, matching the existing
resolveMonitoringFeatureFlagspattern without changing runtime behavior.Fixes #163
Changes
__tests__/action-config.test.ts__tests__/index-with-backend-flags.test.tssrc/action_config.tssrc/index_with_backend.tssrc/monitoring_features.tsVerification
npm test -- --runInBand