task: Allow Rerun action to override properties of task being reran (#10468)

For example:
```
"alt-t": [
    "task::Rerun",
     { "reevaluate_context": true, "allow_concurrent_runs": true }
],
```
Overriding `allow_concurrent_runs` to `true` by itself should terminate
current instance of the task, if there's any.

This PR also fixes task deduplication in terminal panel to use expanded
label and not the id, which depends on task context. It kinda aligns
with how task rerun worked prior to #10341 . That's omitted in the
release notes though, as it's not in Preview yet.

Release Notes:

- `Task::Rerun` action can now override `allow_concurrent_runs` and
`use_new_terminal` properties of the task that is being reran.
This commit is contained in:
Piotr Osiewicz 2024-04-12 12:44:50 +02:00 committed by GitHub
parent 6e1ba7e936
commit 298e9c9387
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 7 deletions

View file

@ -102,7 +102,8 @@ impl TaskTemplate {
let full_label = substitute_all_template_variables_in_str(&self.label, &task_variables)?;
let command = substitute_all_template_variables_in_str(&self.command, &task_variables)?;
let args = substitute_all_template_variables_in_vec(self.args.clone(), &task_variables)?;
let task_hash = to_hex_hash(self)
let task_hash = to_hex_hash(&self)
.context("hashing task template")
.log_err()?;
let variables_hash = to_hex_hash(&task_variables)