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

How to reference dependency outputs from parent bundle action? #18

Open
carolynvs opened this issue Mar 31, 2023 · 0 comments
Open

How to reference dependency outputs from parent bundle action? #18

carolynvs opened this issue Mar 31, 2023 · 0 comments

Comments

@carolynvs
Copy link
Member

Do we want to continue to allow bundle actions to use ${bundle.dependencies.DEP.outputs.OUTPUT_NAME}?

Now that dependencies can promote outputs to the parent bundle, (below), do we need to change how we allow the parent bundle to reference dependency outputs?

dependencies
  requires:
  - name: mysql
    outputs:
      connstr: "
Server=${bundle.parameters.host};Database=${outputs.db};Uid=${outputs.uid};Pwd=${outputs.pwd}"

install:
- exec:
    command: ./install.sh
    arguments:
    - ${bundle.dependencies.mysql.outputs.connstr} # what value should this hold???
    - ${outputs.connstr} # uses the concatenated value created in the dependency definition

What's not clear is what bundle.dependencies.mysql.outputs.connstr should reference. A dependency can generate an output, map it to another value and make it available to the parent bundle. So I can see users being confused if that variable contains the original value or the mapped value.

If we remove that template variable from the actions, that is a breaking change to dependencies.

We could keep it and have it refer to the value "closest in scope".

  • If the dependency generates connstr, and doesn't provide a mapping, we use that original value.
  • If an output mapping named connstr is delcared, we use that.
  • If a bundle generates connstr, and defines a mapping, we use the mapped value.
  • If a mixin also generates an output named connstr, bundle.dependencies.mysql.outputs.constr would not be updated but bundle.outputs.connstr would.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant