the GraphQL app raises these errors after upgrading from 0.14 to the latest code
TypeError: Interface field BuiltinIPNamespace.profiles expects type NestedPaginatedCoreProfile but
IpamNamespace.profiles is type NestedPaginatedProfileIpamNamespace.
Interface field InfraService.profiles expects type NestedPaginatedCoreProfile but
InfraBackBoneService.profiles is type NestedPaginatedProfileInfraBackBoneService.
Interface field InfraEndpoint.profiles expects type NestedPaginatedCoreProfile but
InfraCircuitEndpoint.profiles is type NestedPaginatedProfileInfraCircuitEndpoint.
Expected Behavior
No errors
Steps to Reproduce
start a release version of Infrahub 0.14 or later
upgrade to latest code
start the API server
Additional Information
The root cause is that we save the profiles RelationshipSchema to the database. In the latest version of Infrahub, we have altered the peer kind of the generated profiles relationships to be CoreProfile instead of something more specific.
The older version of Infrahub saves the profiles RelationshipSchema to the database with the more specific peer kind on the profiles RelationshipSchema. Then we try to run the latest version of Infrahub and these out-of-date profiles relationships are loaded, which causes the GraphQL errors.
The solution is two-fold
stop saving profiles relationships to the database
remove the profiles relationships that we have saved already using a migration. this is not a huge issue b/c we will just ignore them going forward, but it would be cleaner to remove than to leave misleading/abandoned data behind
Component
API Server / GraphQL
Infrahub version
0.15
Current Behavior
the GraphQL app raises these errors after upgrading from
0.14
to the latest codeExpected Behavior
No errors
Steps to Reproduce
0.14
or laterAdditional Information
The root cause is that we save the
profiles
RelationshipSchema to the database. In the latest version of Infrahub, we have altered thepeer
kind of the generatedprofiles
relationships to beCoreProfile
instead of something more specific. The older version of Infrahub saves theprofiles
RelationshipSchema to the database with the more specific peer kind on theprofiles
RelationshipSchema. Then we try to run the latest version of Infrahub and these out-of-dateprofiles
relationships are loaded, which causes the GraphQL errors.The solution is two-fold
profiles
relationships to the databaseprofiles
relationships that we have saved already using a migration. this is not a huge issue b/c we will just ignore them going forward, but it would be cleaner to remove than to leave misleading/abandoned data behind