Skip to content

Fix schema generation when run under path with dots#3968

Merged
thomas11 merged 2 commits into
pulumi:masterfrom
tie:master
Mar 6, 2025
Merged

Fix schema generation when run under path with dots#3968
thomas11 merged 2 commits into
pulumi:masterfrom
tie:master

Conversation

@tie

@tie tie commented Feb 19, 2025

Copy link
Copy Markdown
Contributor

This change fixes schema generation when specifications path contains dots (e.g. /build/pulumi-azure-native-2.88.0/azure-rest-api-specs/…).

I assume this a regression introduced in #3872 (comment), cc @danielrbradley.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thank you for submitting a pull request.

Acceptance tests must be run by a maintainer. If a maintainer hasn't picked this up after 7 days, please do reach out to a maintainer via our community Slack.

Maintainers: Please review changes then run tests by adding the comment:

/run-acceptance-tests

@thomas11 thomas11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @tie, thank you for your contribution! I can see how if strings.Contains(part, ".") would falsely match any dots in the path.

Would you mind adding some unit tests to resources_test.go? That way we can also make sure the new code doesn't regress anything. Some edge cases to watch out for are parameters with dots (/{foo.bar}) and nested /specification/, as you point out in your comment.

@thomas11

Copy link
Copy Markdown
Contributor

/run-acceptance-tests

@pulumi-bot

Copy link
Copy Markdown
Contributor

@thomas11

thomas11 commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

Hi @tie, just checking back in if you'd be up for adding some tests? We'd love to have your contribution.

This change fixes schema generation when specifications path contains
dots (e.g. /build/pulumi-azure-native-2.88.0/azure-rest-api-specs/…).
@tie

tie commented Mar 3, 2025

Copy link
Copy Markdown
Contributor Author

@thomas11, hi, sorry for the late reply! Added two test cases for GetModuleName.

@thomas11

thomas11 commented Mar 5, 2025

Copy link
Copy Markdown
Contributor

Running make schema shows an unexpected difference in versions/v2.yaml. A few resources seem to be missing. I haven't investigated yet.

@tie

tie commented Mar 5, 2025

Copy link
Copy Markdown
Contributor Author

Looks like folderModulePattern regexp does not allow numbers, e.g.

/go/pulumi-azure-native/azure-rest-api-specs/specification/storsimple8000series/resource-manager/Microsoft.StorSimple/stable/2017-06-01/storsimple.json

@thomas11 thomas11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thank you!

@thomas11 thomas11 merged commit 3d36516 into pulumi:master Mar 6, 2025
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v2.89.2.

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.

3 participants