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

[Feature] support outputs transmit to follow steps #2157

Open
1 task done
nkuacac opened this issue Nov 18, 2024 · 0 comments
Open
1 task done

[Feature] support outputs transmit to follow steps #2157

nkuacac opened this issue Nov 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nkuacac
Copy link

nkuacac commented Nov 18, 2024

Problem Statement

steps:
    - try:
      - description: ""
        script:
          ...
          outputs:
            - name: result
              value: (json_parse($stdout).status.result)
    - try:
       - description: "use outputs_result to get before step result"
          apply:
            bindings:
               - name: get_from_before_step
                  value: ($outputs_result)

Solution Description

type StepProcessor interface {
	Run(context.Context, namespacer.Namespacer, engine.Context, engine.Context) **engine.Context**
}
func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespacer, tc engine.Context, testTc engine.Context) engine.Context {
...
			for k, v := range outputs {
				tc = tc.WithBinding(ctx, k, v)
				**testTc = testTc.WithBinding(ctx, "outputs_"+k, v)**
			}
		}
	}
	return testTc
}

Alternatives

No response

Additional Context

No response

Slack discussion

No response

Research

  • I have searched other issues in this repository and mine is not recorded.
@nkuacac nkuacac added the enhancement New feature or request label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant