|
Ran
|
Files
8
|
Run time
0s
|
Badge
README BADGES
|
push
github
Fix(config): Allow duplicate keys in replication.config Pass strict=False to configparser.ConfigParser() in get_config() so that Gerrit's git-style multi-valued options parse cleanly. Gerrit's pull-replication plugin writes one fetch refspec per line under the [remote "..."] section, e.g. [remote "onap"] url = https://gerrit.onap.org/r/a/${name}.git fetch = +refs/heads/*:refs/heads/* fetch = +refs/tags/*:refs/tags/* fetch = +refs/changes/*:refs/changes/* This is valid git config syntax for representing a list of values for the same key. Python's configparser defaults to strict=True and refuses repeated keys, raising DuplicateOptionError on the second 'fetch =' line. A diagnostic capture from a CI deployment showed every hook firing crash with that exception the moment find_and_dispatch() called get_replication_remotes() -> get_config(REPLICATION), dropping every patchset-created, comment-added and change-merged event before any workflow dispatch could run. g2p only reads the single-valued url, authgroup and remotenamestyle keys from each remote, never the multi-valued fetch key, so the 'last value wins' semantics that strict=False introduces for duplicate keys have no functional impact on g2p. Adds: * tests/fixtures/replication_multi_fetch.config covering the pull-replication shape that triggered the field crash; * test_get_config_tolerates_duplicate_keys asserting the parser loads the fixture without raising; * test_get_replication_remotes_tolerates_duplicate_keys asserting the higher-level helper still produces the expected remotes mapping for that fixture. Co-authored-by: Claude <claude@anthropic.com> Change-Id: I692e6e15c Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
516 of 556 relevant lines covered (92.81%)
0.93 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|