Commit a2057f8
fix: address review feedback from PR #210
Fixes four issues identified by @ako in code review:
1. Windows file:// URL RFC 8089 compliance
- Add leading slash for Windows paths: file:///C:/path
- Previously: file://C:/path (incorrect, treats C: as host)
- Now: file:///C:/path (correct per RFC 8089)
2. Deduplicate path resolution in fetchODataMetadata
- Remove redundant file:// extraction and relative path resolution
- Now relies on NormalizeURL() already called in createODataClient
- Simplify to: PathFromURL() + os.ReadFile()
- Remove unused mprDir parameter
3. Improve ServiceUrl validation error message
- Add migration hint explaining the breaking change
- Show how to create constant: CREATE CONSTANT Module.ApiLocation
- Explain this enforces Mendix best practice
4. Fix unsafe os.Chdir in tests
- Replace TestFetchODataMetadata_RelativePathWithoutProject
- New test uses NormalizeURL() to generate file:// URL
- No process-global state mutation
- Tests now expect normalized URLs (matching production flow)
All tests pass. Addresses review comments without changing functionality.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent eb23c9b commit a2057f8
3 files changed
Lines changed: 48 additions & 67 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
997 | 1003 | | |
998 | 1004 | | |
999 | 1005 | | |
| |||
1022 | 1028 | | |
1023 | 1029 | | |
1024 | 1030 | | |
1025 | | - | |
| 1031 | + | |
1026 | 1032 | | |
1027 | 1033 | | |
1028 | 1034 | | |
| |||
1427 | 1433 | | |
1428 | 1434 | | |
1429 | 1435 | | |
1430 | | - | |
1431 | | - | |
| 1436 | + | |
1432 | 1437 | | |
1433 | 1438 | | |
1434 | | - | |
1435 | | - | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
1436 | 1442 | | |
1437 | 1443 | | |
1438 | 1444 | | |
1439 | 1445 | | |
1440 | 1446 | | |
1441 | 1447 | | |
1442 | | - | |
1443 | | - | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
1444 | 1452 | | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
1468 | | - | |
1469 | | - | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1470 | 1456 | | |
1471 | 1457 | | |
1472 | 1458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
26 | | - | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 36 | + | |
| 37 | + | |
52 | 38 | | |
53 | 39 | | |
54 | 40 | | |
55 | 41 | | |
56 | 42 | | |
57 | | - | |
58 | 43 | | |
59 | 44 | | |
60 | 45 | | |
61 | 46 | | |
62 | 47 | | |
63 | 48 | | |
64 | 49 | | |
65 | | - | |
| 50 | + | |
66 | 51 | | |
67 | 52 | | |
68 | 53 | | |
| |||
87 | 72 | | |
88 | 73 | | |
89 | 74 | | |
90 | | - | |
| 75 | + | |
91 | 76 | | |
92 | 77 | | |
93 | 78 | | |
| |||
180 | 165 | | |
181 | 166 | | |
182 | 167 | | |
183 | | - | |
184 | | - | |
| 168 | + | |
| 169 | + | |
185 | 170 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | 171 | | |
190 | 172 | | |
191 | | - | |
| 173 | + | |
| 174 | + | |
192 | 175 | | |
193 | 176 | | |
194 | 177 | | |
195 | | - | |
196 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
197 | 186 | | |
198 | 187 | | |
199 | 188 | | |
| |||
0 commit comments