Skip to content

Commit 35a0020

Browse files
committed
fix(monke) update body for confluence entities
1 parent cc3360e commit 35a0020

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

monke/bongos/confluence.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,17 @@ async def create_single_page(index: int) -> Dict[str, Any]:
6464
token = str(uuid.uuid4())[:8]
6565

6666
title, content = await generate_confluence_artifact(self.openai_model, token)
67+
unique_title = f"{title} [{token}]"
6768

6869
# Create page
69-
page_data = await self._create_test_page(self.test_space_key, title, content)
70+
page_data = await self._create_test_page(self.test_space_key, unique_title, content)
7071

7172
self.logger.info(f"📄 Created test page: {page_data['title']}")
7273

7374
return {
7475
"type": "page",
7576
"id": page_data["id"],
76-
"title": title,
77+
"title": unique_title, # Store the unique title
7778
"space_key": self.test_space_key,
7879
"token": token,
7980
"expected_content": token,
@@ -100,19 +101,21 @@ async def update_single_page(page_info: Dict[str, Any]) -> Dict[str, Any]:
100101
token = page_info.get("token") or str(uuid.uuid4())[:8]
101102

102103
# Generate new content with same token
103-
title, content = await generate_confluence_artifact(
104+
# Keep the original title to avoid conflicts in Confluence
105+
original_title = page_info.get("title")
106+
_, content = await generate_confluence_artifact(
104107
self.openai_model, token, is_update=True
105108
)
106109

107-
# Update page
108-
await self._update_test_page(page_info["id"], title, content)
110+
# Update page with original title (Confluence doesn't allow duplicate titles in a space)
111+
await self._update_test_page(page_info["id"], original_title, content)
109112

110-
self.logger.info(f"📝 Updated test page: {title}")
113+
self.logger.info(f"📝 Updated test page: {original_title}")
111114

112115
return {
113116
"type": "page",
114117
"id": page_info["id"],
115-
"title": title,
118+
"title": original_title, # Keep original title
116119
"space_key": self.test_space_key,
117120
"token": token,
118121
"expected_content": token,

0 commit comments

Comments
 (0)