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

Programmatic Derivation of CALM File Type #490

Open
Thels opened this issue Oct 17, 2024 · 2 comments
Open

Programmatic Derivation of CALM File Type #490

Thels opened this issue Oct 17, 2024 · 2 comments

Comments

@Thels
Copy link
Member

Thels commented Oct 17, 2024

Feature Request

Description of Problem:

It's programmatically a bit of a pain to determine what sort of file you're validating/visualizing. Primarily as there is no indicator of what type of content you're processing without referring to schemas.

For example for the initial PR of the VSCode extension, this led to logic like if $schema contains /pattern/ then it's an instantization. This isn't ideal and can quickly fall apart if someone refers to a pattern without this handy indicator.

Programmatically determining the type of file being processed could simplify our validation/visualization flows from a CLI perspective too.

Potential Solutions:

  • Introduce into the CALM schema the concept of a type - so the JSON files self-describe what they are.

"calm-type": ["pattern", "pattern-instantiation", ...others ]

Type Suggested File Suffix
Pattern .pattern.json
Instantization of Pattern .instance.json
Control Requirement .requirement.json
Control Evidence .evidence.json
Layout .layout.json
Flow .flow.json

The benefit of having the file names describe what they are documenting would also allow for extra validation to occur - for example if I have a file called .instance.json I know it should have certain elements present.

Names are obviously a discussion point, just wanted to propose what the initial draft could be ( thanks @willosborne for helping with the list! )

@willosborne
Copy link
Member

Biased, but I like the second approach more as we discussed during the office hours.

What do people think about the control requirement/evidence part? Do we even want an extension for these domains? I know this was discussed on the call

@yt-ms
Copy link
Contributor

yt-ms commented Oct 24, 2024

Could I suggest somehow making it less likely to have a collision on the extensions against other things using the same extensions (e.g. .flow.json)? Something like blah.calm-pattern.json seems like a lot of typing, but maybe a compromise is something like blah.cpattern.json or 'blah.c-pattern.json.

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

No branches or pull requests

3 participants