Skip to content

Commit f543a94

Browse files
authored
Merge pull request #243 from dwolfson/main
Several bugs fixed around NoteLogs and Journals
2 parents f3269dc + fbda340 commit f543a94

19 files changed

Lines changed: 1706 additions & 1278 deletions

commands/tech/refresh_specs.py

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ def run_command(cmd_args: list[str], description: str):
3636
def main():
3737
parser = argparse.ArgumentParser(description="Refresh generated specs and templates for Dr. Egeria.")
3838
parser.add_argument("--usage-level", choices=["Basic", "Advanced"], default=None,
39-
help="Egeria usage level (Basic or Advanced)")
39+
help="Egeria usage level (Basic or Advanced). "
40+
"If omitted, both Basic and Advanced are generated.")
4041
parser.add_argument("--family", type=str, default=None,
4142
help="Generate only for a specific family (applies to cmd templates)")
4243
parser.add_argument("--merge-reports", action="store_true", default=False,
@@ -46,25 +47,29 @@ def main():
4647
# Base executable path for scripts
4748
python_exec = sys.executable
4849

49-
# 1. Generate Markdown Command Templates
50-
cmd_templates = [
51-
python_exec,
52-
"-m", "commands.tech.generate_md_cmd_templates"
53-
]
54-
if args.usage_level:
55-
cmd_templates.extend(["--usage-level", args.usage_level])
56-
if args.family:
57-
cmd_templates.extend(["--family", args.family])
58-
run_command(cmd_templates, "Markdown Command Templates Generation")
59-
60-
# 2. Generate Dr. Egeria Help
61-
cmd_help = [
62-
python_exec,
63-
"-m", "commands.tech.generate_dr_help"
64-
]
65-
if args.usage_level == "Advanced":
66-
cmd_help.append("--advanced")
67-
run_command(cmd_help, "Dr. Egeria Help Generation")
50+
# When no usage level is requested, refresh both Basic and Advanced.
51+
usage_levels = [args.usage_level] if args.usage_level else ["Basic", "Advanced"]
52+
53+
# 1. Generate Markdown Command Templates (per usage level)
54+
for usage_level in usage_levels:
55+
cmd_templates = [
56+
python_exec,
57+
"-m", "commands.tech.generate_md_cmd_templates",
58+
"--usage-level", usage_level,
59+
]
60+
if args.family:
61+
cmd_templates.extend(["--family", args.family])
62+
run_command(cmd_templates, f"Markdown Command Templates Generation ({usage_level})")
63+
64+
# 2. Generate Dr. Egeria Help (per usage level)
65+
for usage_level in usage_levels:
66+
cmd_help = [
67+
python_exec,
68+
"-m", "commands.tech.generate_dr_help"
69+
]
70+
if usage_level == "Advanced":
71+
cmd_help.append("--advanced")
72+
run_command(cmd_help, f"Dr. Egeria Help Generation ({usage_level})")
6873

6974
# 3. Generate Report Specifications
7075
cmd_reports = [

md_processing/v2/feedback.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,23 @@ async def apply_changes(self) -> str:
8888
if guid:
8989
self.parsed_output["guid"] = guid
9090
logger.success(f"Added Journal Entry to '{journal_name}' with GUID {guid}")
91-
return await self.client._async_get_note_by_guid(guid, output_format='MD')
91+
# A note is a Journal Entry in Dr.Egeria; render with the Journal Entry spec.
92+
return await self.client._async_get_note_by_guid(
93+
guid, output_format='MD', report_spec="Journal-Entry-DrE")
9294

9395
elif "Note" in object_type:
94-
# Standard Note in NoteLog
95-
prop_body = set_element_prop_body("Note", qualified_name, attributes)
96+
# A note is a Journal Entry; at the metadata level it is a Notification (NotificationProperties).
97+
prop_body = set_element_prop_body("Notification", qualified_name, attributes)
9698
if verb == "Update":
9799
guid = self.parsed_output.get("guid")
98100
if not guid: return self.command.raw_block
99-
body = set_update_body("Note", attributes)
101+
body = set_update_body("Notification", attributes)
100102
body['properties'] = self.filter_update_properties(prop_body, body.get('mergeUpdate', True))
101103
await self.client._async_update_note(guid, body=body_slimmer(body))
102104
self.parsed_output["guid"] = guid
103105
logger.success(f"Updated Note '{display_name}' with GUID {guid}")
104-
return await self.client._async_get_note_by_guid(guid, output_format='MD')
106+
return await self.client._async_get_note_by_guid(
107+
guid, output_format='MD', report_spec="Journal-Entry-DrE")
105108
# Create Note omitted for brev since it was create_project in sync code?
106109
# Looking closer at sync code: body = set_create_body... guid = egeria_client.create_project (??)
107110
# That looks like a bug in sync code. I'll stick to what was there or leave for now.

pyegeria/core/_base_server_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def __init__(
7474
page_size: int = None,
7575
local_qualifier: str = None,
7676
organization_name: str = None,
77+
time_out: int = None,
7778
):
7879
server_name = server_name or settings.Environment.egeria_view_server
7980
platform_url = platform_url or settings.Environment.egeria_platform_url
@@ -90,6 +91,7 @@ def __init__(
9091
self.token = token
9192
self.local_qualifier = local_qualifier or settings.User_Profile.egeria_local_qualifier
9293
self.organization_name = organization_name or settings.Environment.organization_name
94+
self.time_out = time_out or settings.Debug.timeout_seconds or 30
9395
self._valid_value_cache = {}
9496

9597
self.exc_type = None
@@ -452,7 +454,7 @@ async def _async_make_request(
452454
request_type: str,
453455
endpoint: str,
454456
payload: str | dict = None,
455-
time_out: int = 30,
457+
time_out: int = None,
456458
is_json: bool = True,
457459
params: dict | None = None
458460
) -> Response | str:
@@ -487,6 +489,9 @@ async def _async_make_request(
487489
PyegeriaInvalidParameterException
488490
If the request parameters are invalid.
489491
"""
492+
if time_out is None:
493+
time_out = self.time_out
494+
490495
context: dict = {}
491496
context['class name'] = __class__.__name__
492497
context['caller method'] = inspect.currentframe().f_back.f_code.co_name

0 commit comments

Comments
 (0)