-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add AttributeKindChecker to aggregated constraints (#5460)
* add AttributeKindChecker to aggregated constraints * add missing validate_format methods * add changelog
- Loading branch information
1 parent
a08a438
commit 77df253
Showing
5 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
backend/infrahub/dependencies/builder/constraint/schema/attribute_kind.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from infrahub.core.validators.attribute.kind import AttributeKindChecker | ||
from infrahub.dependencies.interface import DependencyBuilder, DependencyBuilderContext | ||
|
||
|
||
class SchemaAttributeKindConstraintDependency(DependencyBuilder[AttributeKindChecker]): | ||
@classmethod | ||
def build(cls, context: DependencyBuilderContext) -> AttributeKindChecker: | ||
return AttributeKindChecker(db=context.db, branch=context.branch) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Validate updates to an attribute's `kind` when loading a new schema |