From 309d35840a3bb55184bf94a98cb15f607eb3ee61 Mon Sep 17 00:00:00 2001 From: Xiaonan Qi Date: Mon, 17 Nov 2025 16:32:29 -0800 Subject: [PATCH 1/3] Add versioning activation for 8.3 --- contentctl/objects/content_versioning_service.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contentctl/objects/content_versioning_service.py b/contentctl/objects/content_versioning_service.py index 9e774f98..63eb30d9 100644 --- a/contentctl/objects/content_versioning_service.py +++ b/contentctl/objects/content_versioning_service.py @@ -283,10 +283,9 @@ def activate_versioning(self) -> None: Activate the content versioning service """ # Post to the SA-ContentVersioning service to set versioning status - if self.indexbased_content_versioning: - self._query_content_versioning_service( - method="POST", body={"versioning_activated": True} - ) + self._query_content_versioning_service( + method="POST", body={"versioning_activated": True} + ) # Wait for versioning to be activated for ES 8.3.0+ if self.kvstore_content_versioning: From 504dd84c6e66a57b01c4554f80a39baed92c04dd Mon Sep 17 00:00:00 2001 From: Xiaonan Qi Date: Thu, 4 Dec 2025 10:58:41 -0800 Subject: [PATCH 2/3] Comment original kvstore activation logic --- .../objects/content_versioning_service.py | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/contentctl/objects/content_versioning_service.py b/contentctl/objects/content_versioning_service.py index 63eb30d9..77c44fe1 100644 --- a/contentctl/objects/content_versioning_service.py +++ b/contentctl/objects/content_versioning_service.py @@ -197,19 +197,19 @@ def _query_content_versioning_service( # Query the content versioning service try: - if method == "GET" and self.kvstore_content_versioning: - response = self.service.request( - method=method, - path_segment="content_versioning/versioning_apps", - app="SA-ContentVersioning", - ) - if self.indexbased_content_versioning: - response = self.service.request( # type: ignore - method=method, - path_segment="configs/conf-feature_flags/general", - body=body, - app="SA-ContentVersioning", - ) + # if method == "GET" and self.kvstore_content_versioning: + # response = self.service.request( + # method=method, + # path_segment="content_versioning/versioning_apps", + # app="SA-ContentVersioning", + # ) + # if self.indexbased_content_versioning: + response = self.service.request( # type: ignore + method=method, + path_segment="configs/conf-feature_flags/general", + body=body, + app="SA-ContentVersioning", + ) except HTTPError as e: # Raise on any HTTP errors raise HTTPError(f"Error querying content versioning service: {e}") from e @@ -248,26 +248,26 @@ def is_versioning_activated(self) -> bool: # Find the versioning_activated field and report any errors try: - if self.kvstore_content_versioning: - if "content" in data: - for app in data["content"]: - if app.get("name") == "DA-ESS-ContentUpdate": - # If there is error message versioning is not activated properly - if "message" in app: - return False - - # If the installed verion is not the same as the test version - if app.get("version") != self.global_config.app.version: - return False - - if app.get("status") == "active": - return True - else: - return False - if self.indexbased_content_versioning: - for entry in data["entry"]: - if entry["name"] == "general": - return bool(int(entry["content"]["versioning_activated"])) + # if self.kvstore_content_versioning: + # if "content" in data: + # for app in data["content"]: + # if app.get("name") == "DA-ESS-ContentUpdate": + # # If there is error message versioning is not activated properly + # if "message" in app: + # return False + + # # If the installed verion is not the same as the test version + # if app.get("version") != self.global_config.app.version: + # return False + + # if app.get("status") == "active": + # return True + # else: + # return False + # if self.indexbased_content_versioning: + for entry in data["entry"]: + if entry["name"] == "general": + return bool(int(entry["content"]["versioning_activated"])) except KeyError as e: raise KeyError( "Cannot retrieve versioning status, unable to determine versioning status using " @@ -288,13 +288,13 @@ def activate_versioning(self) -> None: ) # Wait for versioning to be activated for ES 8.3.0+ - if self.kvstore_content_versioning: - timeout = 600 - while not self.is_versioning_activated: - time.sleep(60) - timeout -= 60 - if timeout <= 0: - break + # if self.kvstore_content_versioning: + # timeout = 600 + # while not self.is_versioning_activated: + # time.sleep(60) + # timeout -= 60 + # if timeout <= 0: + # break # Confirm versioning has been enabled if not self.is_versioning_activated: From ac021d1122bd27c9ca426855762d63bf05e9f964 Mon Sep 17 00:00:00 2001 From: Xiaonan Qi Date: Thu, 4 Dec 2025 14:43:50 -0800 Subject: [PATCH 3/3] Add comment for version confirmation workflow --- contentctl/objects/content_versioning_service.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/contentctl/objects/content_versioning_service.py b/contentctl/objects/content_versioning_service.py index 77c44fe1..254b9d4c 100644 --- a/contentctl/objects/content_versioning_service.py +++ b/contentctl/objects/content_versioning_service.py @@ -197,6 +197,10 @@ def _query_content_versioning_service( # Query the content versioning service try: + # TODO: The comment out section is for validating versioning is enabled and ready to go. The validation + # workflow (whether to be part of wait_for_cms_main or a separate function) is planed to be implemented + # in later contentctl-ng. + # API endpoint for checking versioning status after ES 8.3.0 # if method == "GET" and self.kvstore_content_versioning: # response = self.service.request( # method=method, @@ -248,6 +252,10 @@ def is_versioning_activated(self) -> bool: # Find the versioning_activated field and report any errors try: + # TODO: The comment out section is for validating versioning is enabled and ready to go. The validation + # workflow (whether to be part of wait_for_cms_main or a separate function) is planed to be implemented + # in later contentctl-ng. + # Validating response by checking `status` field in `DA-ESS-ContentUpdate` app # if self.kvstore_content_versioning: # if "content" in data: # for app in data["content"]: @@ -287,7 +295,10 @@ def activate_versioning(self) -> None: method="POST", body={"versioning_activated": True} ) - # Wait for versioning to be activated for ES 8.3.0+ + # TODO: The comment out section is for validating versioning is enabled and ready to go. The validation + # workflow (whether to be part of wait_for_cms_main or a separate function) is planed to be implemented + # in later contentctl-ng. + # The versioning is expected to be ready within 10 minutes # if self.kvstore_content_versioning: # timeout = 600 # while not self.is_versioning_activated: