-
-
Notifications
You must be signed in to change notification settings - Fork 815
feat: prefer remote taskfiles over cached ones #1345
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7518c77
feat: prefer remote taskfiles over cached ones
pd93 24473ff
feat: implemented cache on network timeout
pd93 d2a633f
feat: --download always downloads, but never executes tasks
pd93 e1639d1
feat: --timeout flag
pd93 b5e41b6
fix: bug with timeout error handling
pd93 dd0ec73
chore: changelog
pd93 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,16 +74,17 @@ you are doing. | |
|
|
||
| ## Caching & Running Offline | ||
|
|
||
| If for whatever reason, you don't have access to the internet, but you still | ||
| need to be able to run your tasks, you are able to use the `--download` flag to | ||
| store a cached copy of the remote Taskfile. | ||
|
|
||
| <!-- TODO: The following behavior may change --> | ||
|
|
||
| If Task detects that you have a local copy of the remote Taskfile, it will use | ||
| your local copy instead of downloading the remote file. You can force Task to | ||
| work offline by using the `--offline` flag. This will prevent Task from making | ||
| any calls to remote sources. | ||
| Whenever you run a remote Taskfile, the latest copy will be downloaded from the | ||
| internet and cached locally. If for whatever reason, you lose access to the | ||
| internet, you will still be able to run your tasks by specifying the `--offline` | ||
| flag. This will tell Task to use the latest cached version of the file instead | ||
| of trying to download it. You are able to use the `--download` flag to update | ||
| the cached version of the remote files without running any tasks. | ||
|
Comment on lines
+81
to
+82
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, that's the idea 👍 |
||
|
|
||
| By default, Task will timeout requests to download remote files after 10 seconds | ||
| and look for a cached copy instead. This timeout can be configured by setting | ||
| the `--timeout` flag and specifying a duration. For example, `--timeout 5s` will | ||
| set the timeout to 5 seconds. | ||
|
|
||
| <!-- prettier-ignore-start --> | ||
| [remote-taskfiles-experiment]: https://github.com/go-task/task/issues/1317 | ||
|
|
||
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we talked on Discord, it'd be interesting to have an
offline: truesetting and aTASK_OFFLINE=1env to allow users to set this once and have it always enabled.Can be on another PR if you prefer, no problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I also created it is an issue as requested :)
#1403
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the functionality here is ready, so let's get this merged. I'll work on the schema/env options in another PR as suggested.
@c-ameron Thanks for creating the issues. I've added them to the TODO list in the experiment issue so they're not forgotten.