opsmill / infrahub

Infrahub - A new approach to Infrastructure Management
https://opsmill.com/
GNU Affero General Public License v3.0
181 stars 7 forks source link

bug: GraphQL errors when upgrading to 0.15 #3791

Closed ajtmccarty closed 2 months ago

ajtmccarty commented 2 months ago

Component

API Server / GraphQL

Infrahub version

0.15

Current Behavior

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

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

ajtmccarty commented 2 months ago

completed in #3792