|
Ran
|
Jobs
1
|
Files
8
|
Run time
1min
|
Badge
README BADGES
|
push
github
Fix(helpers): Support Gerrit 3.x compact change-id Gerrit 3.x and later pass the hook --change argument in a new compact form: '<URL-encoded project>~<change_number>' (e.g. 'ccsdk%2Fapps~1') rather than the legacy triplet 'project~branch~Iabc123...'. The previous get_change_id regex only matched the legacy triplet and crashed with: IndexError: list index out of range on every patchset-created, comment-added and change-merged event served by a Gerrit 3.x instance, dropping every event before the workflow dispatch could run. A diagnostic capture from a CI deployment of Gerrit 3.13.1 showed every hook firing the same traceback at helpers.py:311 with --change='ccsdk%2Fapps~1', confirming the regex mismatch. Behaviour for the legacy triplet is preserved: when the input matches '<project>~<branch>~I<hex>', the function still returns the I... Change-Id from the commit message footer. When the input matches the new compact shape '<project>~<digits>', the function returns it verbatim. The compact form is still a unique, stable identifier per change and works as a GERRIT_CHANGE_ID workflow input (e.g. for concurrency keys), which is what almost every downstream Gerrit-style workflow uses it for. Unrecognised input now raises ValueError with a clear message instead of IndexError, so future hook tracebacks point at the mismatch directly rather than at re.findall(...)[0]. Tests cover both shapes plus the rejection path. Co-authored-by: Claude <claude@anthropic.com> Change-Id: Ibea897330 Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
9 of 9 new or added lines in 1 file covered. (100.0%)
15 existing lines in 3 files now uncovered.522 of 560 relevant lines covered (93.21%)
0.93 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 6 |
95.32 |
0.0% | src/gerrit_to_platform/_logging.py |
| 5 |
94.32 |
2.65% | src/gerrit_to_platform/helpers.py |
| 4 |
86.55 |
0.0% | src/gerrit_to_platform/comment_added.py |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | ubuntu-latest - py3.11 - 27632623135.1 | 8 |
93.21 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|