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

MINOR: Use namespaced variables #19648

Merged
merged 13 commits into from
Feb 11, 2025

Conversation

IceS2
Copy link
Contributor

@IceS2 IceS2 commented Feb 3, 2025

Describe your changes:

In order to be able to have different tasks in a single workflow running in parallel, we need to have namespaced variables.
Until now we were using hardcoded values so one task would overwrite or read the result from another one.

This implementation basically does the following:

  • Defines namespaces so that the variable names are turned into <namespace>_<variable_name>
  • Defines one global namespace
  • Implements methods to set and get namespaced variables
  • Implements method to set "node variables", which would be namespaced to the node itself
  • Changes the way we deal with edges:
    • Now each node defines if it branches and to which values
    • Now the condition is a string instead of a boolean and it checks for the variable in the node that came before

This PR also removes some unused code that was added before:

  • JsonLogicTask
  • NoOpTask
  • CustomSignalTrigger

Type of change:

  • Improvement

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Copy link
Contributor

github-actions bot commented Feb 3, 2025

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 64%
64.62% (41349/63989) 40.98% (16699/40747) 44.22% (5034/11385)

Copy link
Contributor

@sushi30 sushi30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation works and is good. Left some comments/suggestions regarding validations. The only blocker is regarding the use of null as namespace. Other comments are suggestions/discussions for streamlining the API and offloading as of the validation as possible to the workflow definition:

  • validate inputs are valid in terms of given available nodes and compatibility of output to input.
  • validate edge conditions are valid given the variable type they're referring to.

@IceS2 IceS2 disabled auto-merge February 10, 2025 14:56
@IceS2 IceS2 enabled auto-merge (squash) February 10, 2025 14:57
Copy link

Copy link

@IceS2 IceS2 merged commit b120748 into main Feb 11, 2025
26 of 28 checks passed
@IceS2 IceS2 deleted the use-namespace-variables-for-governance-workflows branch February 11, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ingestion safe to test Add this label to run secure Github workflows on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants