Skip to content

fix: refactor action log path resolution to a pure configuration helper - #164

Merged
cdsap merged 1 commit into
mainfrom
issue/163-hermes-refactor-action-log-path-resolution-a1
Aug 31, 2026
Merged

fix: refactor action log path resolution to a pure configuration helper#164
cdsap merged 1 commit into
mainfrom
issue/163-hermes-refactor-action-log-path-resolution-a1

Conversation

@cdsap

@cdsap cdsap commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

Problem

src/index_with_backend.ts:16-33 mixes GitHub Action I/O, filesystem setup, default log-file collision handling, workspace-relative path resolution, and runtime orchestration in the run() entrypoint. The project already separates remote monitoring feature decisions into the pure resolveMonitoringFeatureFlags helper in src/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_file handling.

Proposed change

Introduce a small pure helper, for example resolveActionLogFileTarget, that accepts logFileInput, runId, workspaceDir, runnerTempRoot, and a boolean indicating whether the default log path already exists. Return runnerTempDir, logFilePath, defaultLogFile, and whether the collision fallback was used. Keep fs.mkdirSync, fs.existsSync, and core.info in src/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 resolveMonitoringFeatureFlags pattern without changing runtime behavior.

Fixes #163

Changes

  • __tests__/action-config.test.ts
  • __tests__/index-with-backend-flags.test.ts
  • src/action_config.ts
  • src/index_with_backend.ts
  • src/monitoring_features.ts

Verification

  • npm test -- --runInBand

@cdsap

cdsap commented Aug 29, 2026

Copy link
Copy Markdown
Owner Author

@cdsap PR Judge blocked this PR for manual review.

State: BLOCKED_DANGEROUS_DIFF
Reason: test removals: tests/index-with-backend-flags.test.ts

The judge will not auto-merge this PR until the risky diff is reviewed manually.

@cdsap
cdsap merged commit a27a7ba into main Aug 31, 2026
22 checks passed
@cdsap
cdsap deleted the issue/163-hermes-refactor-action-log-path-resolution-a1 branch August 31, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor action log path resolution to a pure configuration helper

1 participant