Skip to content
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

Feature Request: Have an auto update ttl for downloaded taskfiles #1402

Open
c-ameron opened this issue Nov 17, 2023 · 3 comments · May be fixed by #1702
Open

Feature Request: Have an auto update ttl for downloaded taskfiles #1402

c-ameron opened this issue Nov 17, 2023 · 3 comments · May be fixed by #1702
Labels
area: remote Changes related to remote taskfiles. type: feature A new feature or functionality.

Comments

@c-ameron
Copy link

As discussed here, it would be great to have an auto-cache-ttl setting for downloaded taskfiles.

Context:
I am wanting to use the remote features to have a standard set of taskfile includes across my org.

For me, I would like it to download first, then by default always use the cache. I run taskfile a lot, (multiple times a minute if I'm running a debugging command like task test -- feature/a ), so having extra network overhead wouldn't be useful.
I understand that there is work on on offline flag, but using that would mean my taskfiles would need manual updating.
Having some kind of auto-update-ttl would allow users to have the fast latency of not fetching every task run, but also allow automatic updates in a soft manner.

Thanks for all your hard work on this great tool!

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Nov 17, 2023
@pd93 pd93 added type: feature A new feature or functionality. area: remote Changes related to remote taskfiles. and removed state: needs triage Waiting to be triaged by a maintainer. labels Nov 17, 2023
@jlucktay
Copy link

jlucktay commented Jun 27, 2024

Hihi, I'm wondering if I can take a shot at implementing something here to help out.
The remote taskfiles feature would be of great use in my current role.
Would this else branch be the right place to start?

@andreynering @pd93 any notes? 🙏

@pd93
Copy link
Member

pd93 commented Jun 27, 2024

Hihi, I'm wondering if I can take a shot at implementing something here to help out. The remote taskfiles feature would be of great use in my current role. Would this else branch be the right place to start?

@andreynering @pd93 any notes? 🙏

Hi @jlucktay. You're welcome to give this a go. This should probably be implemented in the Taskfile cache. Adding a TTL to that struct and then checking the files last modified time. or possibly adding a timestamp to the cached filename? --remote-cache-ttl should be a CLI flag and we might want a TASK_REMOTE_CACHE_TTL env var too.

The OP says that they'd like to change the default behaviour to use the cache first (instead of using the remote first). However I think this is outside the scope of the TTL work and is a separate decision that needs to be made before remote Taskfiles are made generally available. I don't think that setting a TTL by itself should modify this behaviour.

jlucktay added a commit to jlucktay/task that referenced this issue Jun 28, 2024
Mapped out a flowchart to describe the behaviour of taskfile.Cache, so as to aid technical design and implementation.

re go-task#1402
@jlucktay
Copy link

Thanks for the steer! I sketched out a flowchart on my fork's branch and will see how I go getting something built.

jlucktay added a commit to jlucktay/task that referenced this issue Jun 30, 2024
Mapped out a flowchart to describe the behaviour of taskfile.Cache, so as to aid technical design and implementation.

re go-task#1402
@jlucktay jlucktay linked a pull request Jun 30, 2024 that will close this issue
jlucktay added a commit to jlucktay/task that referenced this issue Jul 4, 2024
Mapped out a flowchart to describe the behaviour of taskfile.Cache, so as to aid technical design and implementation.

re go-task#1402
jlucktay added a commit to jlucktay/task that referenced this issue Jul 11, 2024
Mapped out a flowchart to describe the behaviour of taskfile.Cache, so as to aid technical design and implementation.

re go-task#1402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: remote Changes related to remote taskfiles. type: feature A new feature or functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants