pulumi / pulumi/pulumi-java

Revisit handling of nested inputs in call vs invoke

Open
#124 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/sdks kind/enhancement
Dominant language
Java
Stars
85
Forks
26
Avg merge
11h 49m
Merged PRs (30d)
22

Description

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

The code ported from C# has these notes:

            // This method backs all calls that generate
            // `Output<T>` and may include `Input<T>` values in the
            // `args`. It needs to decide which control-flow tracking
            // features are supported in the SDK and which ones in the
            // provider implementing the invoke logic.
            //
            // Current choices are:
            //
            // - any resource dependency found by a recursive
            //   traversal of `args` that awaits and inspects every
            //   `Input<T>` will always be propagated into the
            //   `Output<T>`; the provider cannot "swallow"
            //   dependencies
            //
            // - the provider is responsible for deciding whether the
            //   `Output<T>` is secret and known, and may add
            //   additional dependencies
            //
            // This means that presence of secrets or unknowns in the
            // `args` does not guarantee the result is secret or
            // unknown, which differs from Pulumi SDKs that choose to
            // implement these invokes via `apply` (currently Go and
            // Python) and is the same as C# SDK.
            //
            // Differences from `call`: the `invoke` gRPC protocol
            // does not yet support passing or returning out-of-band
            // dependencies to the provider, and in-band `Resource`
            // value support is subject to feature negotiation (see
            // `monitorSupportsResourceReferences`). So `call` makes
            // the provider fully responsible for dependency
            // tracking, which is a good future direction also for
            // `invoke`.

Some follow up work:

  • it is possible that we do not need to support monitorSupportsResourceReferences=false monitors anymore, if that is true, some simplifications may be in order

  • we need some tests to validate the choices java sdk is making here

Affected area/feature

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Java SDK implementations of call and invoke, then read the handling around monitorSupportsResourceReferences and the C# port notes in this issue. Add tests that validate the Java SDK's nested Input, dependency, secret, and unknown handling; done means the supported monitor behavior and any simplifications are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.