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

provide warning if there is a segment mismatch between type and name #314

Closed
bmoore-msft opened this issue Aug 21, 2020 · 5 comments
Closed
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@bmoore-msft
Copy link
Contributor

Consider:

resource configScript 'Microsoft.Compute/virtualMachies/extensions@2020-06-01' = {
name: 'configScript'
location: location

Where we have a child resource, but a single segment in the name - we should be able to flag that at dev-time (certainly compile time)

@alex-frankel
Copy link
Collaborator

Hopefully once #272 is done, this becomes less of a concern

@anthony-c-martin
Copy link
Member

anthony-c-martin commented Aug 22, 2020

Hopefully once #272 is done, this becomes less of a concern

I think this is technically out of scope (no pun intended) for the scope spec, but definitely something I'm interested in. Doing validation on a user-supplied string becomes tricky as soon as expressions become involved, and forcing users to format their own segmented strings feels unnecessarily burdensome.

The syntax I'm thinking about is something like the following:

resource mvVm 'Microsoft.Compute/virtualMachies@2020-06-01' = {
  name: 'myVm'
  ..whatever..
}
resource configScript 'Microsoft.Compute/virtualMachies/extensions@2020-06-01' = {
  parent: myVm
  name: 'configScript' // we just expect the child name, similar to the nested resource syntax in templates today
  ..whatever..
}

@bmoore-msft
Copy link
Contributor Author

I don't know if I would introduce a new/non-arm way... scope makes some sense but I don't know if that's the way the platform will treat it (it might, we haven't done the work yet).

The parent property might be challenging because I may have more than one generation that I need to specify.

My guess is that the common pattern will be parameters or literals separated by slashes. Anything else would be more work. Catching that case would be easy - whether we need to catch any/all cases is probably worth more discussion.

@alex-frankel
Copy link
Collaborator

What does "non-arm" way mean here? What if we support this new property in the IL?

@alex-frankel alex-frankel added enhancement New feature or request and removed Needs: Triage 🔍 labels Sep 3, 2020
@alex-frankel alex-frankel added the good first issue Good for newcomers label Sep 23, 2020
@anthony-c-martin
Copy link
Member

Fixed with #1800

@ghost ghost locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants