9696BOLD_BLUE = BOLD + BLUE
9797
9898
99- helps [
100- "review"
101- ] = """
99+ helps ["review" ] = """
102100 type: group
103101 short-summary: Commands for creating and managing APIView reviews.
104102"""
105103
106- helps [
107- "agent"
108- ] = """
104+ helps ["agent" ] = """
109105 type: group
110106 short-summary: Commands for interacting with the agent.
111107"""
112108
113- helps [
114- "apiview"
115- ] = """
109+ helps ["apiview" ] = """
116110 type: group
117111 short-summary: Commands for querying APIView data.
118112"""
119113
120- helps [
121- "test"
122- ] = """
114+ helps ["test" ] = """
123115 type: group
124116 short-summary: Commands for development and testing.
125117"""
126118
127- helps [
128- "ops"
129- ] = """
119+ helps ["ops" ] = """
130120 type: group
131121 short-summary: Commands for deployment and infrastructure.
132122"""
133123
134- helps [
135- "kb"
136- ] = """
124+ helps ["kb" ] = """
137125 type: group
138126 short-summary: Commands for interacting with the knowledge base.
139127"""
140128
141- helps [
142- "db"
143- ] = """
129+ helps ["db" ] = """
144130 type: group
145131 short-summary: Commands for managing the database.
146132"""
147133
148- helps [
149- "report"
150- ] = """
134+ helps ["report" ] = """
151135 type: group
152136 short-summary: Commands for analytics, auditing, and reporting.
153137"""
@@ -1653,10 +1637,7 @@ def db_ingest_guidelines(
16531637 )
16541638
16551639 if result .total_memories :
1656- print (
1657- f"Memories: { len (result .memories_absorbed )} to absorb, "
1658- f"{ len (result .memories_retained )} to retain"
1659- )
1640+ print (f"Memories: { len (result .memories_absorbed )} to absorb, " f"{ len (result .memories_retained )} to retain" )
16601641
16611642 if result .errors :
16621643 print (f"{ Fore .RED } Errors ({ len (result .errors )} ):{ RESET } " )
@@ -1906,7 +1887,9 @@ def list_opened_revisions(
19061887 Queries Application Insights for reviews that had page views, then enriches
19071888 with revision metadata from Cosmos DB.
19081889 """
1909- data = get_opened_revisions (start_date , end_date , environment = environment , exclude_languages = exclude , created_in_window = created_in_window )
1890+ data = get_opened_revisions (
1891+ start_date , end_date , environment = environment , exclude_languages = exclude , created_in_window = created_in_window
1892+ )
19101893 _print_revision_table (data , empty_msg = "No opened revisions found in the specified date range." )
19111894
19121895
@@ -2415,9 +2398,7 @@ def get_architect_comments(
24152398 params .append ({"name" : param_name , "value" : rid })
24162399 review_query = f"SELECT c.id, c.Language FROM c WHERE ({ ' OR ' .join (clauses )} )"
24172400 review_results = list (
2418- reviews_container .query_items (
2419- query = review_query , parameters = params , enable_cross_partition_query = True
2420- )
2401+ reviews_container .query_items (query = review_query , parameters = params , enable_cross_partition_query = True )
24212402 )
24222403 review_lang_map = {r ["id" ]: get_language_pretty_name (r .get ("Language" , "" )) for r in review_results }
24232404
@@ -2430,19 +2411,13 @@ def get_architect_comments(
24302411 start_iso = to_iso8601 (start_date )
24312412 end_iso = to_iso8601 (end_date , end_of_day = True )
24322413 thread_starts = get_thread_start_dates (filtered , environment = environment )
2433- started_in_window = {
2434- key for key , min_created in thread_starts .items () if start_iso <= min_created <= end_iso
2435- }
2414+ started_in_window = {key for key , min_created in thread_starts .items () if start_iso <= min_created <= end_iso }
24362415
24372416 # By default, exclude replies — keep only the thread-starting comment for threads
24382417 # that actually *started* in the date window (not merely replied to).
24392418 if not include_replies :
24402419 # Keep only comments belonging to threads that started in the window
2441- filtered = [
2442- c
2443- for c in filtered
2444- if (c .get ("ThreadId" ) or c .get ("ElementId" )) in started_in_window
2445- ]
2420+ filtered = [c for c in filtered if (c .get ("ThreadId" ) or c .get ("ElementId" )) in started_in_window ]
24462421
24472422 # Keep only the first (earliest) comment per thread
24482423 seen_threads = {}
@@ -2466,11 +2441,7 @@ def get_architect_comments(
24662441 # When including replies, identify threads started by an approver and include
24672442 # *all* comments in those threads (not just approver-authored ones).
24682443 # First, restrict to threads that actually started in the date window.
2469- filtered = [
2470- c
2471- for c in filtered
2472- if (c .get ("ThreadId" ) or c .get ("ElementId" )) in started_in_window
2473- ]
2444+ filtered = [c for c in filtered if (c .get ("ThreadId" ) or c .get ("ElementId" )) in started_in_window ]
24742445
24752446 if allowed_commenters is not None :
24762447 # Find who authored the earliest comment per thread
@@ -2485,20 +2456,18 @@ def get_architect_comments(
24852456 thread_earliest_in_window [thread_key ] = created
24862457 thread_starters [thread_key ] = c .get ("CreatedBy" , "" )
24872458
2488- approver_threads = {
2489- k for k , author in thread_starters .items () if author in allowed_commenters
2490- }
2491- filtered = [
2492- c
2493- for c in filtered
2494- if (c .get ("ThreadId" ) or c .get ("ElementId" )) in approver_threads
2495- ]
2459+ approver_threads = {k for k , author in thread_starters .items () if author in allowed_commenters }
2460+ filtered = [c for c in filtered if (c .get ("ThreadId" ) or c .get ("ElementId" )) in approver_threads ]
24962461
24972462 comments = [APIViewComment (** c ) for c in filtered ]
24982463
24992464 results = [
25002465 {
2501- ** {k : v for k , v in comment .model_dump (by_alias = True , mode = "json" ).items () if k in _APIVIEW_COMMENT_SELECT_FIELDS },
2466+ ** {
2467+ k : v
2468+ for k , v in comment .model_dump (by_alias = True , mode = "json" ).items ()
2469+ if k in _APIVIEW_COMMENT_SELECT_FIELDS
2470+ },
25022471 "Language" : review_lang_map .get (comment .review_id , "" ),
25032472 }
25042473 for comment in comments
0 commit comments