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

digraph: Support JSON reference expansion #778

Merged
merged 14 commits into from
Jan 8, 2025
Merged

digraph: Support JSON reference expansion #778

merged 14 commits into from
Jan 8, 2025

Conversation

yohamta
Copy link
Collaborator

@yohamta yohamta commented Jan 8, 2025

Implemented syntax for JSON reference in variables to dynamically expand values from JSON variables.

Example:

steps:
  - name: sub workflow
    run: sub_workflow
    output: SUB_RESULT
  - name: use output
    command: echo "The result is ${SUB_RESULT.outputs.finalValue}"
    depends:
      - sub workflow

If SUB_RESULT contains:

{
  "outputs": {
    "finalValue": "success"
  }
}

Then the expanded value of ${SUB_RESULT.outputs.finalValue} will be success. It works for any environment variables and params as well.

@yohamta yohamta marked this pull request as ready for review January 8, 2025 14:53
@yohamta yohamta merged commit 1ce8148 into main Jan 8, 2025
3 checks passed
@yohamta yohamta deleted the json-ref branch January 8, 2025 15:04
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 67.55448% with 134 lines in your changes missing coverage. Please review.

Project coverage is 55.70%. Comparing base (bc71e96) to head (5efc380).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/cmdutil/eval.go 58.09% 80 Missing and 8 partials ⚠️
internal/cmdutil/cmd.go 66.10% 29 Missing and 11 partials ⚠️
internal/digraph/scheduler/node.go 40.00% 2 Missing and 1 partial ⚠️
internal/digraph/step_context.go 0.00% 2 Missing ⚠️
internal/digraph/builder.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #778      +/-   ##
==========================================
+ Coverage   55.19%   55.70%   +0.50%     
==========================================
  Files          71       73       +2     
  Lines        7712     7825     +113     
==========================================
+ Hits         4257     4359     +102     
- Misses       3082     3091       +9     
- Partials      373      375       +2     
Files with missing lines Coverage Δ
cmd/dry.go 68.00% <100.00%> (ø)
cmd/restart.go 53.57% <100.00%> (ø)
cmd/retry.go 54.05% <100.00%> (ø)
cmd/setup.go 75.82% <100.00%> (-0.27%) ⬇️
cmd/start.go 62.72% <100.00%> (ø)
internal/cmdutil/sub.go 100.00% <100.00%> (ø)
internal/digraph/condition.go 52.22% <100.00%> (ø)
internal/digraph/context.go 26.66% <100.00%> (ø)
internal/digraph/params.go 69.75% <100.00%> (ø)
internal/digraph/variables.go 74.46% <100.00%> (ø)
... and 5 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc71e96...5efc380. Read the comment docs.

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

Successfully merging this pull request may close these issues.

1 participant