Merge stable into develop
Merged
FA
2d ago+6999+6999+0123456789012345678901234567890123456789-947-947-012345678901234567890123456789
Supersedes #11701, which has merge conflicts.
Summary
Merges stable at 5a5e13260 into develop at f81744e5a, in two merge commits:
- 28e1c93f6 merges
stableat 186c692eb, the 1.12.3 release. - 17f9f7271 merges #11585 (instance label and color global settings), which reached
stablewhile the first merge was tested.
Each merge commit holds its conflict resolution and the changes described below. git show --remerge-diff <merge commit> shows them against the automatic merge.
Conflicts resolved in the merge of the 1.12.3 release
backend/infrahub/core/migrations/schema/attribute_kind_update.py, the query that moves the values of an attribute whose kind changes between an indexed kind and TextArea, JSON or List:develop(#11652) groups the attributes by value and looks up each value once. Toward TextArea, JSON or List, it scanned the values without theAttributeValueIndexedlabel, limited to the values being converted.stable(#11597) gives these values avalue_keyhash with a RANGE index. It finds or creates them with aMERGEonvalue_key,valueandis_defaultfollowed byLIMIT 1, and reads the keys in Python before the query, in a newbuild_querymethod.- The resolution keeps the grouping of
develop. Toward TextArea, JSON or List, each group finds or creates its value with theMERGEofstable, so the scan is gone. The direction toward an indexed kind is thedevelopversion without changes. - The
build_queryoverride ofstablenow also passesoperation_atsandnode_ids, whichdevelopadded to the query arguments in #11670 and #11683. Without them, the kind update would ignore the node set and the operation times.
backend/infrahub/core/migrations/shared.py:stablemoves the construction of each query intobuild_query, anddevelopaddsoperation_atsandnode_idsto that construction.build_querypasses both.backend/infrahub/core/migrations/query/attribute_add.py: only the imports conflicted. The resolution keeps the imports of both sides.backend/infrahub/core/query/diff.py:developreplaced repeatedappendcalls withextend(42ddb5686), andstablemoved the same code into_window_edge_reads(#11709). The resolution keeps_window_edge_reads, written withextendso that it passes the ruff ruleFURB113thatdevelopenforces.frontend/app/src/shared/api/graphql/generated/graphql-cache.d.ts: regenerated withpnpm codegen:graphqland gql.tada 1.11.5 fromstable. Only the hash comments change. The generated types are the same as on both branches.
Conflicts resolved in the merge of #11585
backend/infrahub/graphql/mutations/preferences.py, inInfrahubSetPreferences.mutate:developcombined the lock and the transaction into oneasync withstatement and removed a# type: ignore[call-arg]that mypy reported as unused.stable(#11585) sets and returnsinstance_labelandinstance_color, and keeps the# type: ignore[call-arg]on the return.- The resolution keeps the single
async withofdevelop, adds the two fields ofstable, and has notype: ignore. mypy reports no error on the file.
frontend/app/src/shared/api/graphql/generated/graphql-env.d.tsandgraphql-cache.d.ts: regenerated withpnpm codegen:graphql. The regenerated files hold theinstance_labelandinstance_colorfields.- Regenerating the other generated files changed nothing:
schema/schema.graphql, the GraphQL types frompnpm codegen, the REST types frompnpm codegen:openapi, the environment block ofdocker-compose.ymland the reference docs.
Graph migration 084 of develop renumbered to 085
- Both branches added a graph migration 084:
- A database upgraded to 1.12.3 is at graph version 84, so it would skip any other migration 084. As described in Renumbering a Migration After a Rebase, the migration of
stablekeeps 084 and the one ofdevelopbecomes085_schema_change_indexes, withminimum_version84.GRAPH_VERSIONis 85. - The renumbering also updates the migration's test,
dev/knowledge/backend/schema-changes.mdand the spec files indev/specs/ifc-3614-store-schema-changes/. - #11597 says that if
developadded its own migration 084 first, the migration ofstablewould need a new number. That was before 1.12.3 shipped it as 084. - A database that already ran the migration 084 of
developis at graph version 84, so it does not run084_index_attribute_value_keysafter this merge. It can apply that migration withinfrahub db migrate --migration-number 84.
Tests changed by the merge
Git did not flag these.
- Since #11597,
AttributeKindUpdateMigrationQueryrequiresvalue_keys. Four tests fromdevelopbuilt the query without them:- The three kind update tests of
test_migration_selection_count.pyread the keys through the migration'sbuild_query, with a new helperbuild_attribute_kind_update_kwargsinselection_dataset.py. - The kind update case of
test_migration_node_scope.pyruns the migration throughexecute(), as its relationship removal case does. Its count query gets an empty map of keys, because the count does not read them.
- The three kind update tests of
test_large_value_lookups_seek_the_key_index(#11597) expected two seeks of theAttributeValue(value_key)index in the kind update query: one to create the missing values and one to link each attribute to its value. The merged query looks up each value once, and the test failed on the merged tree with one seek, so it now expects one seek and still no scan.
Checks run on the merged tree
Run on the second merge commit, which holds both merges:
ruff format --checkandruff checkon the repository,mypyonbackendandty check: pass.uv run invoke docs.validate: no generated document changed.- Frontend:
biome ci .(2,031 files),knip, andbetterer ci(167 TypeScript issues, the same number as recorded): pass. - Frontend tests that #11585 added or changed (
vitest runon the preferences, config, navigation, authentication, layout, login, combobox and title tests): 29 files, 186 tests passed. - Backend tests that #11585 added or changed (
test_50_internals.py,test_preference_repository.py, bothtest_preferences.py,test_internal.py,test_internal_config_ldap.py,test_instance_settings.py,test_instance_identity.py): 89 passed.
Run on the first merge commit only:
pnpm install --frozen-lockfileinfrontend/: the merged lockfile matches the merged package files.- Unit tests in
backend/tests/unit/core/graphandbackend/tests/unit/core/migrations: 81 passed. - Component tests on Neo4j for the kind update, the value keys and the migrations: 155 passed and 10 expected failures (
xfail), intest_attribute_value_key.py,test_attribute_kind_update.py,test_migration_selection_count.py,test_migration_node_scope.py,test_migration_second_run.py,test_all_migrations_rollback.py,test_084_index_attribute_value_keys.pyandtest_085_schema_change_indexes.py. - Component tests on Neo4j with 3 workers, in
backend/tests/component/core/migrations,core/diff,core/constraint_validators,core/graph,core/schema_change,core/test_attribute_value_key.py,core/test_branch_rebase.pyandmessage_bus/operations/requests/test_proposed_change.py: 1,311 passed, 12 skipped, 11 expected failures (xfail) and 1 failure.- The failure:
test_kind_migration.py::test_calculate_with_migrated_kind_nodefound nohuman_friendly_idchange in the base branch diff of the migrated car. - The same test passed when run alone, with its whole module (13 passed), after the module that ran before it on the same worker (14 passed), and 30 times out of 30 in 3 parallel sessions of 10 runs. The cause of the single failure is not known.
- The failure:
Not run locally: the rest of the backend component suite, the integration, functional and e2e tests, the rest of the frontend tests, and markdownlint (not installed in this environment). The Markdown edits only replace 084 with 085 and 84 with 85.