-
Notifications
You must be signed in to change notification settings - Fork 22
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
skip profile schemas when checking for schema migrations #5446
Conversation
CodSpeed Performance ReportMerging #5446 will improve performances by 28.28%Comparing Summary
Benchmarks breakdown
|
It would be good to also remove extra |
oh nice find. removed it |
@@ -32,11 +32,14 @@ async def schema_validate_migrations(message: SchemaValidateMigrationData) -> li | |||
log.info(f"{len(message.constraints)} constraint(s) to validate") | |||
# NOTE this task is a good candidate to add a progress bar | |||
for constraint in message.constraints: | |||
schema = message.schema_branch.get(name=constraint.path.schema_kind) | |||
if isinstance(schema, ProfileSchema): | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A thought could be to reverse this by saying that what we want to have is a GenericSchema
or a NodeSchema
. I'm mostly thinking about a future scenario if we introduce some other type of schema SomethingElseSchema
(I have no idea of what that might be). If we were to do that this function might be invalid again as it would catch entries that we might not want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great suggestion. I've made this change
27d7d06
to
53f5ffb
Compare
found this issue while doing some diff workflow testing locally
SchemaConstraintValidatorRequest.node_schema
only acceptsNodeSchema
orGenericSchema
, notProfileSchema
if a branch includes a new/updated profile instance (say
backbone_profile
orupstream_profile
from theinfrastructure_edge.py
script), thenSchemaValidateMigrationData.constraints
that is passed toschema_validate_migrations
will include profile schema, which will raise a validation error and break the pipelineI think the typing on
SchemaConstraintValidatorRequest
is correct b/c a profile will not require a migration. We have complete control over those schema, so there should be nothing to validate