Skip to content

fix: add proper type to hosts in haproxy libraries#383

Open
skatsaounis wants to merge 1 commit intocanonical:mainfrom
skatsaounis:fix-hosts-type
Open

fix: add proper type to hosts in haproxy libraries#383
skatsaounis wants to merge 1 commit intocanonical:mainfrom
skatsaounis:fix-hosts-type

Conversation

@skatsaounis
Copy link
Contributor

Applicable spec:

Overview

Rationale

Juju Events Changes

Module Changes

Library Changes

Checklist

@skatsaounis skatsaounis requested a review from a team as a code owner March 3, 2026 11:08
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Test results for commit abd5475

Test coverage for abd5475

Name                                       Stmts   Miss Branch BrPart  Cover   Missing
--------------------------------------------------------------------------------------
lib/charms/haproxy/v0/ddos_protection.py     154     51     34      8    64%   157-174, 183-187, 288, 316-318, 323, 326-330, 342-344, 381, 387, 393, 396, 424, 495-498, 510-529
src/charm.py                                  21      0      0      0   100%
src/state.py                                  43      0      0      0   100%
--------------------------------------------------------------------------------------
TOTAL                                        218     51     34      8    73%

Static code analysis report

Run started:2026-03-03 12:41:35.420080+00:00

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 333
  Total lines skipped (#nosec): 0
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Test results for commit abd5475

Test coverage for abd5475

Name                                         Stmts   Miss Branch BrPart  Cover   Missing
----------------------------------------------------------------------------------------
lib/charms/haproxy/v0/ddos_protection.py       154     42     34      3    72%   157-174, 183-187, 265, 284, 415-418, 422-424, 459-478, 514-529
lib/charms/haproxy/v0/spoe_auth.py             158     55     32      2    59%   203, 304-306, 315, 354-381, 392-402, 441-442, 459-472, 484-501, 522-525, 529-531
lib/charms/haproxy/v1/haproxy_route_tcp.py     385    169     78      8    52%   210, 213, 282, 291-294, 298-301, 319-322, 337, 343-348, 448, 453, 830-833, 837, 854-875, 893-908, 922-929, 938, 1043-1084, 1088-1094, 1098, 1167-1196, 1267-1306, 1336-1338, 1363-1365, 1387-1391, 1410-1412, 1430-1432, 1439-1445, 1453-1455, 1463-1464, 1475-1482, 1495-1506, 1514-1535, 1547-1548, 1559-1560, 1571-1574, 1585-1586, 1615-1624, 1640-1643, 1659-1670, 1686-1689, 1707-1718, 1729-1730, 1738-1739, 1747-1748, 1759-1762
lib/charms/haproxy/v2/haproxy_route.py         385     53     98     26    82%   181, 257, 266-269, 294-297, 318-323, 673-674, 860->exit, 867, 893-904, 927-930, 934-936, 955-957, 1129-1135, 1139, 1336->1338, 1340->1342, 1342->1344, 1344->1346, 1346->1348, 1348->1351, 1386, 1394, 1399, 1402, 1427, 1455, 1459, 1463, 1486, 1506, 1515-1516, 1518->exit, 1554-1556, 1576, 1590, 1595-1597
src/charm.py                                   268     74     68      9    66%   99, 227, 235-251, 256, 261, 278, 289, 295-296, 330-350, 406-409, 415->414, 462-470, 498-511, 524-529, 538, 550-564, 569, 579, 585-591, 607
src/haproxy.py                                 127     31      6      2    75%   110-116, 136-158, 268-269, 272, 280-286, 314, 344-355, 367-369, 379-380
src/http_interface.py                           73     25      4      0    62%   74, 83, 92, 106-108, 126, 138, 150, 162, 170-175, 187, 194, 202, 217-227
src/state/charm_state.py                        77     15     14      4    79%   93-95, 100-101, 104, 145-150, 159, 208-210, 222-223
src/state/ddos_protection.py                    39      0      2      0   100%
src/state/exception.py                           1      0      0      0   100%
src/state/ha.py                                 30      1      2      1    94%   50
src/state/haproxy_route.py                     197     14     60      5    90%   132, 161-170, 194, 227, 297, 346-348, 365
src/state/haproxy_route_tcp.py                 120     17     42      1    80%   92-94, 109->112, 147-160
src/state/ingress.py                            38      0      4      0   100%
src/state/ingress_per_unit.py                   32      0      4      0   100%
src/state/spoe_auth.py                          26      2      2      0    93%   63-64
src/state/tls.py                                39      7     12      4    78%   74, 77-78, 127-135, 141-142
src/state/validation.py                         46     23      8      1    44%   66-67, 71-98
src/tls_relation.py                             61      5     14      4    88%   83-84, 86->85, 118-128, 140->142
----------------------------------------------------------------------------------------
TOTAL                                         2256    533    484     70    73%

Static code analysis report

Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Run started:2026-03-03 12:53:38.664529+00:00

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 9874
  Total lines skipped (#nosec): 13
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 10

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Test results for commit abd5475

Test coverage for abd5475

Name                               Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------------
src/charm.py                          45      9      2      0    77%   65-91, 96-98
src/haproxy_spoe_auth_service.py      44     16      2      0    61%   56-64, 76-82, 93-117
src/state.py                          55     15      6      1    67%   64-66, 79, 125-146
------------------------------------------------------------------------------
TOTAL                                144     40     10      1    68%

Static code analysis report

Run started:2026-03-03 12:38:51.302229

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 409
  Total lines skipped (#nosec): 1
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 1

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we would need to increment the lib's patch version number and publish a new version of the lib so that we can fetch it from requirer charms like ingress-configurator. Can I ask you to first increment the LIBPATCH number? I'll take care of publishing the library once that's done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants