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

feat: add new Website resource type #209

Merged
merged 5 commits into from
May 12, 2024

Conversation

jianzs
Copy link
Contributor

@jianzs jianzs commented May 11, 2024

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

re #92

2. What is the scope of this PR (e.g. component or file name):

  • SDK
  • Static Deducer
  • Pyright Deducer
  • Pulumi Adapter

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

jianzs added 4 commits May 11, 2024 16:57
… infra API

This change introduces the ability to use direct captured properties as arguments in infrastructure API calls. For instance, the code below is now considered valid:

```python
from pluto_client import Website, Router

router = Router("router")
website = Website(path="path/to/website", name="website")

website.addEnv("ROUTER", router.url())
```

In this example, `router.url()` is a direct captured property which the website utilizes to establish a connection to the backend service.

The goal is for the infrastructure API to accept both direct captured properties and variables assigned with these properties, as demonstrated here:

```python
from pluto_client import Website, Router

router = Router("router")
website = Website(path="path/to/website", name="website")

router_url = router.url()
website.addEnv("ROUTER", router_url)
```

Currently, the API only accepts direct captured properties as arguments. Future updates will include support for variables that store the return values of these properties.
This commit adds the `projectRoot` setting to the Pulumi configuration by default. This feature improves the accuracy of relative path resolution for resource creation, like a Website. With the `projectRoot` available, the infra SDK can correctly resolve paths given by the user relative to the project's base directory. For instance, creating a Website resource with a path parameter relative to the project root is now possible as demonstrated:

```typescript
const website = new Website("./public");
```
Copy link

changeset-bot bot commented May 11, 2024

🦋 Changeset detected

Latest commit: 93a0d4b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@plutolang/pulumi-adapter Patch
@plutolang/pluto-infra Patch
@plutolang/pluto Patch
@plutolang/pyright-deducer Patch
@plutolang/static-deducer Patch
@plutolang/cli Patch
@plutolang/simulator-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jianzs jianzs added documentation Improvements or additions to documentation deducer Deducer adapter Adapter sdk Client SDK and Infra SDK labels May 11, 2024
Upgraded `@pulumi/aws` version from 6.4.1 to 6.34.1 to ensure compatibility with the Python 3.12 runtime in AWS Lambda functions.
@jianzs jianzs merged commit 89b4f84 into pluto-lang:main May 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapter Adapter deducer Deducer documentation Improvements or additions to documentation sdk Client SDK and Infra SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant