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

Template IDs changing #122

Open
cgardner opened this issue Feb 3, 2021 · 2 comments
Open

Template IDs changing #122

cgardner opened this issue Feb 3, 2021 · 2 comments

Comments

@cgardner
Copy link
Contributor

cgardner commented Feb 3, 2021

Template IDs are not persistent, which causes some problems when scripting around dstask.

Alternately, when using templates from the command line, you have to constantly look up the templates to get the ID that you want to use.

We discussed this in slack and it sounded like the solution would be to use the UUID instead of ID for templates. Partially implemented in #37

I have worked around this by searching templates by name.

Here's my workaround:

function findTemplateBySummary() {
  local search=${1}
  local query=".[] | select(.summary == \"${search}\") | .id"
  echo $(command dstask show-templates | jq $query)
}
@naggie
Copy link
Owner

naggie commented Feb 4, 2021

Thanks -- more specifically allowing addressing templates by numeric UUID as well as ID is the solution. The change will allow this for all tasks.

@naggie
Copy link
Owner

naggie commented Sep 22, 2021

So they should be persistent on a given PC due to the ID cache.

Previously tasks stored their preferred ID in the yaml. This worked fine most of the time but would result in some merge conflicts.

I decided to cache IDs instead as otherwise I'd have to write something to deal with those (simple) conflicts which didn't seem like a good solution -- we'd end up with IDs that are consistent across hosts most of the time which is more dangerous that none of the time anyway.

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

No branches or pull requests

2 participants