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

[arm2pulumi] - Adds input validation for expected languages to render #2430

Merged
merged 1 commit into from
May 4, 2023

Conversation

kpitzen
Copy link
Contributor

@kpitzen kpitzen commented May 4, 2023

  • Adds a set of supported languages in pkg/arm2pulumi/renderer.go
  • Validates all provided languages in cmd/arm2pulumi/main.go
  • Provides dynamic list of possible languages in the primary prompt help

Closes pulumi/arm2pulumi#32

@kpitzen
Copy link
Contributor Author

kpitzen commented May 4, 2023

Example output:
image
(I've since modified the wording to "any combination of" instead of "one of")

@kpitzen kpitzen force-pushed the KP/Validatearm2pulumilang branch from e4ff7b2 to d75aba9 Compare May 4, 2023 15:15
@kpitzen kpitzen changed the title Adds input validation for expected languages to render [arm2pulumi] - Adds input validation for expected languages to render May 4, 2023
@github-actions
Copy link

github-actions bot commented May 4, 2023

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

provider/pkg/arm2pulumi/renderer.go Outdated Show resolved Hide resolved
@@ -30,6 +30,22 @@ import (
"github.com/sourcegraph/jsonx"
)

var SupportedLanguages = map[string]interface{}{
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note: a bit unfortunate that we have to repeat (and later update) the list here when we already import p/p. I just looked around briefly but it doesn't seem we have any exported, official set of languages there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally agree - I looked for exactly this and came up unfortunately empty-handed. Maybe worth opening an issue on p/p?

- Adds a set of supported languages in pkg/arm2pulumi/renderer.go
- Validates all provided languages in cmd/arm2pulumi/main.go
- Provides dynamic list of possible languages in the primary prompt help
@kpitzen kpitzen force-pushed the KP/Validatearm2pulumilang branch from d75aba9 to 10ef6d5 Compare May 4, 2023 16:34
@kpitzen kpitzen enabled auto-merge May 4, 2023 16:55
@kpitzen kpitzen merged commit b7e6483 into master May 4, 2023
12 checks passed
@kpitzen kpitzen deleted the KP/Validatearm2pulumilang branch May 4, 2023 17:10
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.

Accepts any language without validation
2 participants