-
Notifications
You must be signed in to change notification settings - Fork 43
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
Handle code blocks in import section #2382
Handle code blocks in import section #2382
Conversation
Hi @andrzejressel - thank you for your pull request. I'm trying to run tests for you but I'm seeing a setup issue on our end for the tests. Additionally, all Terraform code will need to be translated to Pulumi code. We do not, as a rule, display Terraform code in these docs. This is an incredibly gnarly part of our codebase, so thank you so much for willing to get involved here! 💟 I'm happy to help and answer questions, you can also find me on the community Slack for Pulumi. |
cca2891
to
e020b07
Compare
I've rebased and we should be able to get some better test output here. |
e020b07
to
4c336bd
Compare
Should be fine now |
I will take a look next week - thank you for your patience! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried this against one of our other providers - pulumi-gcp
, and I unfortunately still see a panic. There's something about the counter in the loop that's not quite right.
importString = fmt.Sprintf("%s %s", importString, p) | ||
} | ||
// Handle terraform blocks - pass them whole without changes | ||
if trimmedSection == "```terraform" || trimmedSection == "```hcl" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use https://github.com/pulumi/pulumi-terraform-bridge/blob/master/pkg/tfgen/docs.go#L2353 for this check - it contains the current known detection patterns for TF code. 🙏
if strings.HasPrefix(trimmedSection, "```") { | ||
initial := true | ||
for { | ||
section = subsection[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line panics when running this code against pulumi-gcp.
/run-acceptance-tests |
Fix for pulumi/pulumi-docker#1201
I've tested it with docker provider and it seems to be working fine apart from this warning:
which removes example from ServiceConfig, but I think this it not related to this change.