Skip to content

feat: remote taskfile improvements (cache/expiry) #2176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: package-api-docs
Choose a base branch
from

Conversation

pd93
Copy link
Member

@pd93 pd93 commented Apr 11, 2025

Fixes #1402

This PR makes a series of changes to the remote taskfiles experiment:

  • Prioritise cached files over remote ones as per Feature Request: Have an auto update ttl for downloaded taskfiles #1402 Remote Taskfiles experiment #1317 (comment) (and other comments).
  • Refactored and simplified taskfile/reader.go and related error handling.
  • Added the RemoteNode interface which distinguishes between a regular Node and remote ones. This replaces the existing func Remote() bool method.
  • Pass a ctx into the Reader.Read method to use for cancellation instead of a timeout functional option. The CLI will set the context with a timeout according to the current timeout flag
  • Added an --expriy flag which will set the expiry duration for the cache.
    • By default this is currently set to 0s (Essentially caching is disabled as it will always be expired)
    • In offline mode, an expired cache will still be used as we have no way to download a fresh copy.
    • If downloads fail we will also fallback on the cache

Future work: .taskrc/env var setting for cache expiry duration

This is based on the package-api-docs branch for now. It will need a rebase. It also conflicts heavily with other in progress work.

@pd93 pd93 changed the title Remote taskfile improvements feat: remote taskfile improvements (cache/expiry) Apr 11, 2025
@pd93 pd93 linked an issue Apr 13, 2025 that may be closed by this pull request
@pd93 pd93 force-pushed the remote-taskfile-improvements branch from 4c90f95 to 900f83b Compare April 13, 2025 00:14
@pd93 pd93 marked this pull request as ready for review April 13, 2025 00:22
@pd93 pd93 requested review from vmaerten and andreynering April 13, 2025 00:22
@pd93 pd93 mentioned this pull request Apr 13, 2025
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.

Feature Request: Have an auto update ttl for downloaded taskfiles
1 participant