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

Exclude code choosers in SDKs #1887

Merged
merged 1 commit into from
Apr 19, 2024
Merged

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Apr 19, 2024

Right now, we generate code blocks for the schema that look like this:

<!--Start PulumiCodeChooser -->
```typescript
// TS Code
```
```python
# Python Code
```
...
<!--End PulumiCodeChooser -->

That works great in the registry. For SDKs, we generate code that looks like this:

  # <!--Start PulumiCodeChooser -->
  # ```python
  # # Python Code
  # ```
  # <!--End PulumiCodeChooser -->

This is not good, since our users see our PulumiCodeChooser directives directly.

This PR changes the bridge's behavior to only emit the PulumiCodeChooser directives when we are targeting the schema.

Right now, we generate code blocks for the schema that look like this:

```md
  <!--Start PulumiCodeChooser -->
  ```typescript
  // TS Code
  ```
  ```python
  # Python Code
  ```
  ...
  <!--End PulumiCodeChooser -->
```

That works great in the registry. For SDKs, we generate code that looks like this:

```python
  # <!--Start PulumiCodeChooser -->
  # ```python
  # # Python Code
  # ```
  # <!--End PulumiCodeChooser -->
```

This is not good, since our users see our PulumiCodeChooser directives directly.

This PR changes the bridge's behavior to only emit the PulumiCodeChooser directives when
we are targeting the schema.
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 60.01%. Comparing base (4dbf4df) to head (6eed2fe).

Files Patch % Lines
pkg/tfgen/docs.go 72.72% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1887   +/-   ##
=======================================
  Coverage   60.00%   60.01%           
=======================================
  Files         327      327           
  Lines       43986    43994    +8     
=======================================
+ Hits        26393    26401    +8     
  Misses      16101    16101           
  Partials     1492     1492           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@guineveresaenger guineveresaenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for this improvement.

@iwahbe iwahbe merged commit 94c1de4 into master Apr 19, 2024
11 checks passed
@iwahbe iwahbe deleted the iwahbe/exclude-code-choosers-for-sdks branch April 19, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants