Skip to content

Commit 86f3dcb

Browse files
committed
fix: address code quality review comments
- Remove unused current_branch variable in detect_pr_from_branch - Add explicit return statements after pytest.skip() in decorators - Add diagnostic logging to empty except clauses - Add type annotations to production test fixtures and decorators
1 parent 15bd499 commit 86f3dcb

15 files changed

Lines changed: 6349 additions & 193 deletions

scripts/pr_review.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ def detect_pr_from_github_actions() -> PRInfo | None:
142142
url=pr.get("html_url"),
143143
state=pr.get("state"),
144144
)
145-
except Exception:
146-
pass
145+
except Exception as e:
146+
print(f"Warning: Could not read/parse GitHub event file: {e}", file=sys.stderr)
147147

148148
if pr_number:
149149
try:
@@ -195,9 +195,10 @@ def get_pr_info_from_gh_cli(pr_number: int | None = None) -> PRInfo | None:
195195
except (json.JSONDecodeError, KeyError):
196196
pass
197197
except FileNotFoundError:
198+
# gh CLI not available - this is expected in some environments
198199
pass
199-
except Exception:
200-
pass
200+
except Exception as e:
201+
print(f"Warning: Error getting PR info from gh CLI: {e}", file=sys.stderr)
201202

202203
return None
203204

@@ -214,11 +215,10 @@ def detect_pr_from_branch() -> PRInfo | None:
214215
check=False,
215216
)
216217
if result.returncode == 0:
217-
current_branch = result.stdout.strip()
218218
# Try to get PR info for this branch
219219
return get_pr_info_from_gh_cli(None)
220-
except Exception:
221-
pass
220+
except Exception as e:
221+
print(f"Warning: Error detecting PR from branch: {e}", file=sys.stderr)
222222

223223
return None
224224

tango/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,9 @@ class ShapeConfig:
485485

486486
# Default for get_idv()
487487
IDVS_COMPREHENSIVE: Final = (
488-
"key,piid,award_date,description,fiscal_year,total_contract_value,base_and_exercised_options_value,obligated,"
488+
"key,piid,award_date,description,fiscal_year,total_contract_value,obligated,"
489489
"idv_type,multiple_or_single_award_idv,type_of_idc,period_of_performance(start_date,last_date_to_order),"
490-
"recipient(display_name,legal_business_name,uei,cage_code),"
490+
"recipient(display_name,legal_business_name,uei,cage),"
491491
"awarding_office(*),funding_office(*),place_of_performance(*),parent_award(key,piid),"
492492
"competition(*),legislative_mandates(*),transactions(*),subawards_summary(*)"
493493
)
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
interactions:
2+
- request:
3+
body: ''
4+
headers:
5+
accept:
6+
- '*/*'
7+
accept-encoding:
8+
- gzip, deflate
9+
connection:
10+
- keep-alive
11+
host:
12+
- tango.makegov.com
13+
user-agent:
14+
- python-httpx/0.28.1
15+
method: GET
16+
uri: https://tango.makegov.com/api/idvs/?limit=1&shape=key%2Cpiid%2Caward_date%2Crecipient%28display_name%2Cuei%29%2Cdescription%2Ctotal_contract_value%2Cobligated%2Cidv_type
17+
response:
18+
body:
19+
string: '{"count":1151197,"next":"http://tango.makegov.com/api/idvs/?limit=1&shape=key%2Cpiid%2Caward_date%2Crecipient%28display_name%2Cuei%29%2Cdescription%2Ctotal_contract_value%2Cobligated%2Cidv_type&cursor=WyIyMDI2LTAxLTIzIiwgImUyMzQzNTk2LTQ1MDctNTZjMi1iNjQ0LWJhMmYyODI0OGQ2NyJd","previous":null,"cursor":"WyIyMDI2LTAxLTIzIiwgImUyMzQzNTk2LTQ1MDctNTZjMi1iNjQ0LWJhMmYyODI0OGQ2NyJd","previous_cursor":null,"results":[{"key":"CONT_IDV_83310126AC060_8300","piid":"83310126AC060","award_date":"2026-01-23","description":"FAR
20+
8.4 BPA FOR OFFICE FURNITURE - SB SET-ASIDE","total_contract_value":7500000.0,"obligated":0.0,"idv_type":"E","recipient":{"uei":"P4XNSMKPNGM5","display_name":"PRICE
21+
MODERN LLC"}}],"count_type":"approximate"}'
22+
headers:
23+
CF-RAY:
24+
- 9c431392eaa570c4-ORD
25+
Connection:
26+
- keep-alive
27+
Content-Type:
28+
- application/json
29+
Date:
30+
- Mon, 26 Jan 2026 21:24:19 GMT
31+
Nel:
32+
- '{"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}'
33+
Report-To:
34+
- '{"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=cIstw%2FQkVVTpk3mVjs76jajMuyEs82Mrhqsrf2Ak864vMKdya7PUUv6AVZg4VKE4Rji%2FvhG0vH%2FgFvXu61A%2FZvVpSoh0HGNASVAtxH6SooBq3WCuQYNf889L2%2Bs%3D"}]}'
35+
Server:
36+
- cloudflare
37+
Transfer-Encoding:
38+
- chunked
39+
allow:
40+
- GET, HEAD, OPTIONS
41+
cf-cache-status:
42+
- DYNAMIC
43+
content-length:
44+
- '721'
45+
cross-origin-opener-policy:
46+
- same-origin
47+
referrer-policy:
48+
- same-origin
49+
vary:
50+
- Accept, Cookie
51+
x-content-type-options:
52+
- nosniff
53+
x-execution-time:
54+
- 0.028s
55+
x-frame-options:
56+
- DENY
57+
x-ratelimit-burst-limit:
58+
- '1000'
59+
x-ratelimit-burst-remaining:
60+
- '985'
61+
x-ratelimit-burst-reset:
62+
- '56'
63+
x-ratelimit-daily-limit:
64+
- '2000000'
65+
x-ratelimit-daily-remaining:
66+
- '1999800'
67+
x-ratelimit-daily-reset:
68+
- '56162'
69+
x-ratelimit-limit:
70+
- '1000'
71+
x-ratelimit-remaining:
72+
- '985'
73+
x-ratelimit-reset:
74+
- '56'
75+
status:
76+
code: 200
77+
message: OK
78+
- request:
79+
body: ''
80+
headers:
81+
accept:
82+
- '*/*'
83+
accept-encoding:
84+
- gzip, deflate
85+
connection:
86+
- keep-alive
87+
host:
88+
- tango.makegov.com
89+
user-agent:
90+
- python-httpx/0.28.1
91+
method: GET
92+
uri: https://tango.makegov.com/api/vehicles/?page=1&limit=10&shape=uuid%2Csolicitation_identifier%2Corganization_id%2Cawardee_count%2Corder_count%2Cvehicle_obligations%2Cvehicle_contracts_value%2Csolicitation_title%2Csolicitation_date
93+
response:
94+
body:
95+
string: '{"count":5706,"next":"http://tango.makegov.com/api/vehicles/?limit=10&page=2&shape=uuid%2Csolicitation_identifier%2Corganization_id%2Cawardee_count%2Corder_count%2Cvehicle_obligations%2Cvehicle_contracts_value%2Csolicitation_title%2Csolicitation_date","previous":null,"results":[{"uuid":"84d76669-61d8-5938-83fb-2d6f8a6c85b7","solicitation_identifier":"0","organization_id":"f6c88e61-3d34-5685-a5ab-670858289883","awardee_count":38,"order_count":65,"vehicle_obligations":8876449.66,"vehicle_contracts_value":9688796.56,"solicitation_title":"X1LZ--618-20-2-6190-0007
96+
- Service - Minneapolis VA CRRC Parking, 33 Parking Spaces - MPLS","solicitation_date":"2020-03-02"},{"uuid":"eb797c6e-6865-505e-9c71-7d0dfc3b1b35","solicitation_identifier":"0040626388","organization_id":"0d75c931-8b4e-5941-9ec3-2b35df3ea8d9","awardee_count":3,"order_count":6,"vehicle_obligations":37189.74,"vehicle_contracts_value":37189.74,"solicitation_title":"B--AZ
97+
ES ARCHAEOLOGICAL SERVICES","solicitation_date":"2023-08-29"},{"uuid":"ef62a4f0-080a-503f-adbe-a1705ae410c0","solicitation_identifier":"05GA0A22Q0023","organization_id":"2774a854-bcf4-5d85-94c0-d715f0c1819f","awardee_count":4,"order_count":0,"vehicle_obligations":0.0,"vehicle_contracts_value":0.0,"solicitation_title":"SOLICITATION
98+
- GAO IDIQ CONSTRUCTION SERVICES","solicitation_date":"2022-03-21"},{"uuid":"4c317645-db68-53e7-8d97-eeec38e7da2e","solicitation_identifier":"1069512","organization_id":"384a7047-2f7c-5a2f-88b0-8e47cb5f98f5","awardee_count":2,"order_count":5,"vehicle_obligations":1828095.0,"vehicle_contracts_value":1828095.0,"solicitation_title":"Intent
99+
to Sole Source Procurement for Specific Pathogen Free (SPF) Embryonating Chicken
100+
Eggs","solicitation_date":"2022-09-13"},{"uuid":"98718d55-29c9-56f8-9a19-058f2b6e7174","solicitation_identifier":"1131PL21RIQ71002","organization_id":"afcff312-fd10-5ad4-853a-83e5b0ecc2e0","awardee_count":4,"order_count":6,"vehicle_obligations":332140.66,"vehicle_contracts_value":332140.66,"solicitation_title":"Monitoring
101+
and Evaluations: Program Audit Series Services IDIQ","solicitation_date":"2021-08-06"},{"uuid":"e2b5a801-4ddd-5abe-92b4-ba1807421c8f","solicitation_identifier":"1131PL22RIQ0001","organization_id":"afcff312-fd10-5ad4-853a-83e5b0ecc2e0","awardee_count":18,"order_count":52,"vehicle_obligations":32586217.82,"vehicle_contracts_value":32586217.82,"solicitation_title":"IDIQ:
102+
Multiple Award Contract - - Reverse Trade Missions, Conferences, Workshops,
103+
Training, and Other Events","solicitation_date":"2022-04-08"},{"uuid":"a9df6717-67b2-51c1-9d6d-e29b1d89b4cb","solicitation_identifier":"1145PC20Q0026","organization_id":"5b10eb83-548f-5685-b69e-c00f96ee6ff7","awardee_count":9,"order_count":32,"vehicle_obligations":377286.14,"vehicle_contracts_value":383286.14,"solicitation_title":"Peace
104+
Corps Background Investigators","solicitation_date":"2020-03-17"},{"uuid":"8d124a98-17f3-5143-b11a-cba33b218145","solicitation_identifier":"1145PC22Q0042","organization_id":"5b10eb83-548f-5685-b69e-c00f96ee6ff7","awardee_count":7,"order_count":18,"vehicle_obligations":116624.52,"vehicle_contracts_value":116624.52,"solicitation_title":"Language
105+
Proficiency Interview (LPI) Tester Trainers","solicitation_date":"2022-03-28"},{"uuid":"d9351f6f-3663-5b3e-baa6-629e71f4a6ae","solicitation_identifier":"12-046W-18-Q-0056","organization_id":"2bdc6615-3582-5f85-ace9-470bf8f461f7","awardee_count":2,"order_count":2,"vehicle_obligations":35100.0,"vehicle_contracts_value":35100.0,"solicitation_title":"Trail
106+
Maintenance/Restoration Services","solicitation_date":"2018-08-27"},{"uuid":"e9718942-c9d7-5ca7-a2e6-6eeb3a7a9d4c","solicitation_identifier":"12-04T0-18-Q-0001","organization_id":"2bdc6615-3582-5f85-ace9-470bf8f461f7","awardee_count":14,"order_count":58,"vehicle_obligations":671823.21,"vehicle_contracts_value":671823.21,"solicitation_title":"Region
107+
6 Coaching Services - BPA","solicitation_date":"2017-12-14"}]}'
108+
headers:
109+
CF-RAY:
110+
- 9c4316dfad3661a6-ORD
111+
Connection:
112+
- keep-alive
113+
Content-Type:
114+
- application/json
115+
Date:
116+
- Mon, 26 Jan 2026 21:26:34 GMT
117+
Nel:
118+
- '{"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}'
119+
Report-To:
120+
- '{"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=YhGIExzk%2BXb8IQoJa1CUA%2FKQW17W%2BnUptWcExoJW%2FmOhl2vg0oo%2FnlbQ60I%2FL7FccL46wHpj%2F80aCQilDJwFkAvlsGjuMT9oLg6x8y4GBXlrXJ0JHSJk9oomctU%3D"}]}'
121+
Server:
122+
- cloudflare
123+
Transfer-Encoding:
124+
- chunked
125+
allow:
126+
- GET, HEAD, OPTIONS
127+
cf-cache-status:
128+
- DYNAMIC
129+
content-length:
130+
- '3915'
131+
cross-origin-opener-policy:
132+
- same-origin
133+
referrer-policy:
134+
- same-origin
135+
vary:
136+
- Accept, Cookie
137+
x-content-type-options:
138+
- nosniff
139+
x-execution-time:
140+
- 0.037s
141+
x-frame-options:
142+
- DENY
143+
x-ratelimit-burst-limit:
144+
- '1000'
145+
x-ratelimit-burst-remaining:
146+
- '985'
147+
x-ratelimit-burst-reset:
148+
- '55'
149+
x-ratelimit-daily-limit:
150+
- '2000000'
151+
x-ratelimit-daily-remaining:
152+
- '1999784'
153+
x-ratelimit-daily-reset:
154+
- '56027'
155+
x-ratelimit-limit:
156+
- '1000'
157+
x-ratelimit-remaining:
158+
- '985'
159+
x-ratelimit-reset:
160+
- '55'
161+
status:
162+
code: 200
163+
message: OK
164+
- request:
165+
body: ''
166+
headers:
167+
accept:
168+
- '*/*'
169+
accept-encoding:
170+
- gzip, deflate
171+
connection:
172+
- keep-alive
173+
host:
174+
- tango.makegov.com
175+
user-agent:
176+
- python-httpx/0.28.1
177+
method: GET
178+
uri: https://tango.makegov.com/api/idvs/0/summary/
179+
response:
180+
body:
181+
string: '{"solicitation_identifier":"0","competition_details":{"commercial_item_acquisition_procedures":{"code":"A","description":"Commercial
182+
Products/Services"},"evaluated_preference":{"code":"NONE","description":"No
183+
Preference used"},"extent_competed":{"code":"A","description":"Full and Open
184+
Competition"},"most_recent_solicitation_date":"2023-09-22","number_of_offers_received":1,"original_solicitation_date":"2023-09-22","other_than_full_and_open_competition":{"code":"ONE","description":"Only
185+
One Source-Other (FAR 6.302-1 other)"},"set_aside":{"code":"NONE","description":"No
186+
set aside used"},"simplified_procedures_for_certain_commercial_items":{"code":"N","description":"No"},"small_business_competitiveness_demonstration_program":{"code":"N","description":"No"},"solicitation_identifier":"0","solicitation_procedures":{"code":"MAFO","description":"Subject
187+
to Multiple Award Fair Opportunity"}},"acquisition_details":{"naics_code":339113,"psc_code":"6515"},"additional_details":{"contract_type":{"code":"J","description":"Firm
188+
Fixed Price"},"idv_type":{"code":"E","description":"BPA"},"type_of_idc":{"code":"B","description":"Indefinite
189+
Delivery / Indefinite Quantity"},"total_contract_value":0.0},"description":"1-YEAR
190+
LE STAFF HEALTH INSURANCE - KYIV, UKRAINE","agency_details":{"funding_office":{"agency_code":"3600","agency_name":"Department
191+
of Veterans Affairs","office_code":"36C512","office_name":"512-BALTIMORE(00512)(36C512)","department_code":36,"department_name":"Department
192+
of Veterans Affairs"},"awarding_office":{"agency_code":"3600","agency_name":"Department
193+
of Veterans Affairs","office_code":"36C250","office_name":"250-NETWORK CONTRACT
194+
OFFICE 10 (36C250)","department_code":36,"department_name":"Department of
195+
Veterans Affairs"}},"awardee_count":39,"awards_url":"http://tango.makegov.com/api/idvs/0/summary/awards/"}'
196+
headers:
197+
CF-RAY:
198+
- 9c4316e08e1461a6-ORD
199+
Connection:
200+
- keep-alive
201+
Content-Type:
202+
- application/json
203+
Date:
204+
- Mon, 26 Jan 2026 21:26:34 GMT
205+
Nel:
206+
- '{"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}'
207+
Report-To:
208+
- '{"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=6NyjEA8vZcKC1Jv%2FSUFW%2BQT4MGovuXcSHKyuQFmwrH%2B0r754YPbuYhhIu5BjWzUMRAwBqAxEpmWkWwwoL6OS%2BT%2FNx%2BvEAAx2Mt9%2BVRxrdctrwyoa7%2BATazAudZY%3D"}]}'
209+
Server:
210+
- cloudflare
211+
Transfer-Encoding:
212+
- chunked
213+
allow:
214+
- GET, HEAD, OPTIONS
215+
cf-cache-status:
216+
- DYNAMIC
217+
content-length:
218+
- '1834'
219+
cross-origin-opener-policy:
220+
- same-origin
221+
referrer-policy:
222+
- same-origin
223+
vary:
224+
- Accept, Cookie
225+
x-content-type-options:
226+
- nosniff
227+
x-execution-time:
228+
- 0.063s
229+
x-frame-options:
230+
- DENY
231+
x-ratelimit-burst-limit:
232+
- '1000'
233+
x-ratelimit-burst-remaining:
234+
- '984'
235+
x-ratelimit-burst-reset:
236+
- '55'
237+
x-ratelimit-daily-limit:
238+
- '2000000'
239+
x-ratelimit-daily-remaining:
240+
- '1999783'
241+
x-ratelimit-daily-reset:
242+
- '56027'
243+
x-ratelimit-limit:
244+
- '1000'
245+
x-ratelimit-remaining:
246+
- '984'
247+
x-ratelimit-reset:
248+
- '55'
249+
status:
250+
code: 200
251+
message: OK
252+
version: 1

0 commit comments

Comments
 (0)