infrahub-server 1.4.1__py3-none-any.whl → 1.4.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING
4
4
 
5
5
  from infrahub import lock
6
6
  from infrahub.core import registry
7
+ from infrahub.core.constants import GLOBAL_BRANCH_NAME
7
8
  from infrahub.log import get_logger
8
9
  from infrahub.worker import WORKER_IDENTITY
9
10
 
@@ -81,16 +82,21 @@ async def refresh_branches(db: InfrahubDatabase) -> None:
81
82
  from infrahub.graphql.manager import GraphQLSchemaManager
82
83
 
83
84
  async with lock.registry.local_schema_lock():
84
- branches = await registry.branch_object.get_list(db=db)
85
- for new_branch in branches:
86
- if new_branch.name in registry.branch:
87
- await update_branch_registry(db=db, branch=new_branch)
85
+ active_branches = await registry.branch_object.get_list(db=db)
86
+ for active_branch in active_branches:
87
+ if active_branch.name == GLOBAL_BRANCH_NAME:
88
+ # Avoid processing updates for the global branch as it doesn't
89
+ # have an associated schema
90
+ continue
91
+
92
+ if active_branch.name in registry.branch:
93
+ await update_branch_registry(db=db, branch=active_branch)
88
94
  else:
89
- await create_branch_registry(db=db, branch=new_branch)
95
+ await create_branch_registry(db=db, branch=active_branch)
90
96
 
91
- purged_branches = await registry.purge_inactive_branches(db=db, active_branches=branches)
97
+ purged_branches = await registry.purge_inactive_branches(db=db, active_branches=active_branches)
92
98
  purged_branches.update(
93
- GraphQLSchemaManager.purge_inactive(active_branches=[branch.name for branch in branches])
99
+ GraphQLSchemaManager.purge_inactive(active_branches=[branch.name for branch in active_branches])
94
100
  )
95
101
  for branch_name in sorted(purged_branches):
96
102
  log.info(f"Removed branch {branch_name!r} from the registry", branch=branch_name, worker=WORKER_IDENTITY)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: infrahub-server
3
- Version: 1.4.1
3
+ Version: 1.4.2
4
4
  Summary: Infrahub is taking a new approach to Infrastructure Management by providing a new generation of datastore to organize and control all the data that defines how an infrastructure should run.
5
5
  License: Apache-2.0
6
6
  Author: OpsMill
@@ -662,7 +662,7 @@ infrahub/tasks/check.py,sha256=37n1U1Knb3AV6kz2sw_IabL9pnlqceLVICWf9GdSxZE,687
662
662
  infrahub/tasks/dummy.py,sha256=6SxlQqQXZqgTuwLaAsK-p1O1TYNKfdGmUYjNJFNHe9s,1209
663
663
  infrahub/tasks/keepalive.py,sha256=D6yh3Vmlr1WCEpZibk2YLc2n0dCcX6tM62HCSxyGEu8,783
664
664
  infrahub/tasks/recurring.py,sha256=RJO2zdzCU-38Kb81lmCUbFQOBhGui8qn2QizTV4vj9I,447
665
- infrahub/tasks/registry.py,sha256=QfpC3-HSZoytehkDY3Q9_MdvDN0J_xUAUi1fyAgCYyU,3656
665
+ infrahub/tasks/registry.py,sha256=zanLxRT_RFkYV2Y3OQedHu2-PTBwoExbAzgokT0TZjQ,3957
666
666
  infrahub/telemetry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
667
667
  infrahub/telemetry/constants.py,sha256=_5mJAZaT_wTCaF7Yzsd---Zn1N6GZkoP_954GK8K4-c,184
668
668
  infrahub/telemetry/database.py,sha256=9UVPOxRionVF65jjo8slRIaNBOv-KMRzq7I-7fe3wZE,3111
@@ -826,8 +826,8 @@ infrahub_testcontainers/models.py,sha256=ASYyvl7d_WQz_i7y8-3iab9hwwmCl3OCJavqVbe
826
826
  infrahub_testcontainers/performance_test.py,sha256=hvwiy6tc_lWniYqGkqfOXVGAmA_IV15VOZqbiD9ezno,6149
827
827
  infrahub_testcontainers/plugin.py,sha256=I3RuZQ0dARyKHuqCf0y1Yj731P2Mwf3BJUehRJKeWrs,5645
828
828
  infrahub_testcontainers/prometheus.yml,sha256=610xQEyj3xuVJMzPkC4m1fRnCrjGpiRBrXA2ytCLa54,599
829
- infrahub_server-1.4.1.dist-info/LICENSE.txt,sha256=7GQO7kxVoQYnZtFrjZBKLRXbrGwwwimHPPOJtqXsozQ,11340
830
- infrahub_server-1.4.1.dist-info/METADATA,sha256=HyDVqhcrCXqCmaJn77mWKJ_40SZ0G_Hmpk5MMvxo08g,8271
831
- infrahub_server-1.4.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
832
- infrahub_server-1.4.1.dist-info/entry_points.txt,sha256=UXIeFWDsrV-4IllNvUEd6KieYGzQfn9paga2YyABOQI,393
833
- infrahub_server-1.4.1.dist-info/RECORD,,
829
+ infrahub_server-1.4.2.dist-info/LICENSE.txt,sha256=7GQO7kxVoQYnZtFrjZBKLRXbrGwwwimHPPOJtqXsozQ,11340
830
+ infrahub_server-1.4.2.dist-info/METADATA,sha256=d-zSV3_9JrWJwJRhXIxjvryRmMyxZO_HQiRc4-A_T84,8271
831
+ infrahub_server-1.4.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
832
+ infrahub_server-1.4.2.dist-info/entry_points.txt,sha256=UXIeFWDsrV-4IllNvUEd6KieYGzQfn9paga2YyABOQI,393
833
+ infrahub_server-1.4.2.dist-info/RECORD,,