Skip to content

Automate worker cache management and improve CLI output formatting#13

Merged
berggren merged 1 commit intomainfrom
worker-cache
Apr 3, 2026
Merged

Automate worker cache management and improve CLI output formatting#13
berggren merged 1 commit intomainfrom
worker-cache

Conversation

@berggren
Copy link
Copy Markdown
Contributor

@berggren berggren commented Apr 3, 2026

Summary

Automated worker cache refreshing with TTL support, standardized CLI output formatting, and added output directory validation.

Technical Details:

  • Automated Cache Management: Introduced a workersCacheTTL (1 hour) and updated the workersCacheEntry struct to track timestamps. The new LoadOrRefreshWorkersCache function centralizes cache logic, automatically fetching fresh data from the API if the local cache is missing or stale.
  • CLI Output Refactoring: Standardized the output format for file, folder, user, and workflow commands. This removes redundant labels and colons in favor of a cleaner, more concise display.
  • Run Command Validation: Added a pre-execution check to the run command to verify the existence of the output directory when a download policy is active. A corresponding test case TestRunCmdOutputDirValidation was added to ensure correct error handling.
  • Test Isolation: Updated several test suites to use t.TempDir() and config.SetBaseDir(). This prevents test execution from creating or modifying configuration files in the user's home directory.
  • Command Cleanup: Removed the manual --refresh flag from the worker list command as the cache layer now handles updates automatically.

@berggren berggren merged commit 7efceed into main Apr 3, 2026
3 checks passed
@berggren berggren deleted the worker-cache branch April 3, 2026 09:46
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.

1 participant