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

Needs to set the variables locally when failing a job with variables #10698

Closed
skayliu opened this issue Oct 13, 2022 · 1 comment · Fixed by #10701
Closed

Needs to set the variables locally when failing a job with variables #10698

skayliu opened this issue Oct 13, 2022 · 1 comment · Fixed by #10701
Assignees
Labels
kind/feature Categorizes an issue or PR as a feature, i.e. new behavior version:8.2.0-alpha1 Marks an issue as being completely or in parts released in 8.2.0-alpha1 version:8.2.0 Marks an issue as being completely or in parts released in 8.2.0

Comments

@skayliu
Copy link
Contributor

skayliu commented Oct 13, 2022

Is your feature request related to a problem? Please describe.

If a failling job has variables, then the variables needs to be set locally

client.newFailCommand(...).variables(...)

Describe the solution you'd like

Set the variables only locally when failing a job has variables.

Describe alternatives you've considered

If you want to variables globally, then you should newSetVariablesCommand, also it can set locally.

  • for locally
    .newSetVariablesCommand(job.getElementInstanceKey()).variables(Map.of("key2", "value2")).local(true).send().join();
  • for globally
    .newSetVariablesCommand(job.getElementInstanceKey()).variables(Map.of("key2", "value2").send().join();

Additional context

Related #9404

@skayliu skayliu added the kind/feature Categorizes an issue or PR as a feature, i.e. new behavior label Oct 13, 2022
@korthout korthout self-assigned this Oct 13, 2022
@korthout
Copy link
Member

Thanks @skayliu 🚀

For completeness, the reason to only support locally set variables is described in:

I suggest that the job fail command sets the variables only locally. No option to set global variables.

The reason is variable propagation. Similar to the job complete command, we don't set the variable globally but we propagate the variables from the related task to the upper scopes. If the task has an output mapping then the mapping is applied. If the output mappings can't be applied then we would need to create an incident.

This would be more complex. So, I prefer to set the variables only locally in the scope of the task.

@skayliu skayliu changed the title Needs to set the variables locally when failling a job with variables Needs to set the variables locally when failing a job with variables Oct 13, 2022
@korthout korthout added the version:8.2.0-alpha1 Marks an issue as being completely or in parts released in 8.2.0-alpha1 label Nov 1, 2022
@npepinpe npepinpe added the version:8.2.0 Marks an issue as being completely or in parts released in 8.2.0 label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes an issue or PR as a feature, i.e. new behavior version:8.2.0-alpha1 Marks an issue as being completely or in parts released in 8.2.0-alpha1 version:8.2.0 Marks an issue as being completely or in parts released in 8.2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants