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

Is colon allowed in resourceName? #387

Closed
dubinsky opened this issue Feb 12, 2024 · 5 comments · Fixed by #389
Closed

Is colon allowed in resourceName? #387

dubinsky opened this issue Feb 12, 2024 · 5 comments · Fixed by #389
Labels
kind/bug Some behavior is incorrect or out of spec P2 Bugs of moderate severity to be assigned to an engineer in the next iteration
Milestone

Comments

@dubinsky
Copy link

As a part of #328, besom.URN.UrnRegex changed, including the change from (?<resourceName>.+) to (?<resourceName>[^:]+|[^:]*::[^:]*).

With this change, URNs that contain a single colon : in the resourceName (e.g., group:info) became illegal, although the comment in the code suggests that they should remain legal:

Stack, Project, and Name Regex: These are strings that do not contain ::.

Was this change intentional?

Thanks!

@lbialy
Copy link
Collaborator

lbialy commented Feb 12, 2024

Possibly a mistake, let me investigate, we have few quick patches that are coming out very soon in 0.2.1 (core only, packages won't need to be republished, hence the change in versioning scheme for packages with patch version dropped).

@pawelprazak
Copy link
Contributor

pawelprazak commented Feb 12, 2024

Looks like the answer is yes, anything is permitted as a resource name in Pulumi since November, including empty string:
pulumi/pulumi@5169797

Thank you for the report, we plan to release 0.2.1 soon with few minor fixes like this one :)

@pawelprazak pawelprazak added kind/bug Some behavior is incorrect or out of spec P2 Bugs of moderate severity to be assigned to an engineer in the next iteration labels Feb 12, 2024
@pawelprazak pawelprazak added this to the 0.2.1 milestone Feb 12, 2024
@lbialy
Copy link
Collaborator

lbialy commented Feb 12, 2024

We are obviously not going to follow that folly to the letter. Empty strings make absolutely no sense for Stack names, Project names and Resource names. However, Pulumi's test suite does test against an URN with empty resource name. We are going to allow any garbage in resource names, including empty strings, if that's something that comes from the engine but still require non-empty strings that adhere to the spec from our users because why propagate a mistake.

@dubinsky
Copy link
Author

anything is permitted as a resource name in Pulumi since November
require non-empty strings that adhere to the spec from our users

I am pretty sure that colon was allowed in the resource name even before November;
thank you for fixing it soon!

@lbialy
Copy link
Collaborator

lbialy commented Feb 12, 2024 via email

lbialy added a commit that referenced this issue Feb 12, 2024
…gine and adhering to 'string' spec in regard to it being any string without double colons
lbialy added a commit that referenced this issue Feb 13, 2024
…gine and adhering to 'string' spec in regard to it being any string without double colons (#389)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec P2 Bugs of moderate severity to be assigned to an engineer in the next iteration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants