-
Notifications
You must be signed in to change notification settings - Fork 18
Validation Pipeline
Upon issuing a pull request, a user can expect that the following validations will be executed.
- The
@id
property of the root element will be inspected.- If the value isn't a valid DTMI, the request will fail.
- The
@id
property of the root element will be compared to the file path. The DTMI will be converted to lower-case; all:
will be replaced with/
; all;
will be replaced with-
;.json
will be appended.- This MUST match the file name or the request will fail.
Example: a file defining
dtmi:com:Example:Person;1
would be required to be in a file in./dtmi/com/example/person-1.json
. Similarly, a file definingdtmi:COM:ExAmPlE:PeRsOn;1
would be required to be in the file./dtmi/com/example/person-1.json
. This means that even though the DTMI are case-sensitive, the file structure holding the files is not. Additional information on the case sensitivity can be found in Resolution Convention - Any specified
@id
on sub elements will be checked to see if it resembles a DTMI. If not, it will be ignored.- If so, the DTMI MUST follow a namespace scoping.
Example: a file specifying
dtmi:com:example:person;1
can have a schema defined fordtmi:com:example:person:phoneNumber;1
but cannot have a schema defined fordtmi:com:telephone:number;1
- The DTDL parser (likely existing C# implementation is expected to be used) will run against the submitted file(s) and ensure they will parse appropriately.
- Failure to parse will fail the request.
- Attempts will be made to scan for secrets and inappropriate content using existing tooling.
- Any secrets of content items will be marked as warnings instead of errors.
- The default branch will include branch security and
./CODEOWNERS
file to alert any code owners that have been previously configured - No deletions or renames are allowed.
- Will generate warnings as these could be major breaking changes to devices using them in production.
- Invalid DTMI (see above)
- Invalid path structure (see above)
- Invalid sub DTMI (see above)
- Invalid JSON. JSON document does not parse using standard language tools (likely C# due to DTDL parser requirements)
- Invalid DTDL. Document does not parse using the DTDL parser utility.
- Ensure that a code owner (if any has been configured) has approved the request
- Ensure that the validation has completed without errors.
- Investigate any warnings (content/secrets)
- If a separate workflow hasn't been established to apply new code owners, add entries for any newly created file that doesn't have an existing similar DTMI version
Example: a user has created
dtmi:com:Example:Person;1
. There are no previously existing./dtmi/com/example/person-*.json
files. Add a new line to./CODEOWNERS
filedtmi/com/example/person-*.json
. Include with the existing PR or create a followup PR.- Do not add codeowner entries if there are any existing versions of the DTMI.
- Always SQUASH commits.
- Ensure no deletions or renames exist without extenuating circumstances.
- Changes to models that are in use are to be considered HUGE breaking changes.
If your pull request has been open for (SLA to be determined), and has not been approved by a code owner. Raise an issue on the repository using the (template name to be determined) issue template.