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

[python/sdk] Allow remote components to use output property called id #15115

Merged
merged 1 commit into from Jan 18, 2024

Conversation

Zaid-Ajaj
Copy link
Contributor

@Zaid-Ajaj Zaid-Ajaj commented Jan 9, 2024

Description

This PR updates the python SDK to allow remote components to have ID property. Adds an integration test which implements a component that had an output property id to ensure that we can have id as an output that doesn't get filtered out when serializing and deserializing property maps.

Component instantiation looks like this in python

import pulumi
from component import Component

component_a = Component("a", id="hello")

pulumi.export("id", component_a.id)

Where we expect component_a.id to equal "{resource.ID}-{args.Id}" => "42-hello" and the 42 is the (constant) ID of the resource created inside the component.

Checklist

  • I have run make tidy to update any new dependencies
  • I have run make lint to verify my code passes the lint check
    • I have formatted my code using gofumpt
  • I have added tests that prove my fix is effective or that my feature works
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version

@Zaid-Ajaj Zaid-Ajaj added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label Jan 9, 2024
@pulumi-bot
Copy link
Contributor

pulumi-bot commented Jan 9, 2024

Changelog

[uncommitted] (2024-01-18)

Bug Fixes

  • [sdk/python] Allow remote components to use output property called id
    #15115

@Zaid-Ajaj Zaid-Ajaj force-pushed the zaid/components-with-id-output branch from dbef422 to 43ba452 Compare January 17, 2024 20:08
@Zaid-Ajaj Zaid-Ajaj changed the title Initial testing of components that have ID as output property [python/sdk] Allow remote components to use output property called id Jan 17, 2024
@Zaid-Ajaj Zaid-Ajaj force-pushed the zaid/components-with-id-output branch 6 times, most recently from e0d384d to e5d88f0 Compare January 18, 2024 03:44
@Zaid-Ajaj Zaid-Ajaj requested a review from a team January 18, 2024 11:23
@Zaid-Ajaj Zaid-Ajaj added area/sdks Pulumi language SDKs language/python and removed impact/no-changelog-required This issue doesn't require a CHANGELOG update labels Jan 18, 2024
@Zaid-Ajaj Zaid-Ajaj marked this pull request as ready for review January 18, 2024 11:24
sdk/python/lib/pulumi/runtime/resource.py Outdated Show resolved Hide resolved
@Zaid-Ajaj Zaid-Ajaj force-pushed the zaid/components-with-id-output branch from 9606791 to c7fd504 Compare January 18, 2024 13:37
@Zaid-Ajaj Zaid-Ajaj added this pull request to the merge queue Jan 18, 2024
Merged via the queue into master with commit 31c90fd Jan 18, 2024
46 checks passed
@Zaid-Ajaj Zaid-Ajaj deleted the zaid/components-with-id-output branch January 18, 2024 16:55
@justinvp justinvp mentioned this pull request Jan 18, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jan 18, 2024
### Features

- [sdk/go] Add WithValue to pulumi.Context
  [#15149](#15149)


### Bug Fixes

- [cli] Fix a panic when user's home directory could not be looked up.
  [#15160](#15160)

- [cli/display] Fix JSON/YAML value diff displays.
  [#15171](#15171)

- [sdk/go] Update github.com/cloudflare/circl to v1.3.7.
  [#15151](#15151)

- [cli/import] --import-file now omits empty resource lists.
  [#15132](#15132)

- [sdk/python] Allow remote components to use output property called id
  [#15115](#15115)


### Miscellaneous

- [sdkgen] Emit a warning when using id or urn as resource outputs
  [#15060](#15060)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sdks Pulumi language SDKs language/python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants