Hi Enrico,
Enrico Olivelli writes:
> I saw the error below, can anyone take a look at it?
I have encountered such an error error before, and couldn't explain it.
In my case, the actual Python exception was 'IndexError: list index out
of range'. (I assume that's the one you also saw, but it got cut off
the transcript.)
That exception can be easily triggered by passing an invalid version
string, or a version which has already been marked as "released".
>From the transcript, this does not seem to be what you did—both version
numbers there are perfectly acceptable. Moreover, I cannot reproduce
that crash; evaluating the relevants bits of the script in a Python
REPL produces the expected result:
[{'self': 'https://issues.apache.org/jira/rest/api/2/version/12349587',
'id': '12349587', 'name': '3.8.0', 'archived': False, 'released': False,
'projectId': 12310801}, {'self':
'https://issues.apache.org/jira/rest/api/2/version/12350030', 'id': '12350030',
'name': '3.7.1', 'archived': False, 'released': False, 'projectId': 12310801}]
Of course, it could be that:
* The API sometimes returns incomplete/empty results (I have no idea
how well the client copes with transient failures);
* One of these versions had temporarily been, e.g., marked as released
(I have no visibility on that side of the ticket system);
* We accidentally introduced some kind of control or invisible unicode
character (e.g., ZERO WIDTH SPACE) in the stream.
No such character is present in your email, but they could have been
stripped by the MUA—the script, however, definitely doesn't strip
those, and hits an 'IndexError' instead.
HTH, -D
P.-S. — In any case, how do you feel about improving the script so that
it re-prompts if some versions are not recognized? (I have more than
once been "ejected" by simple/obvious typos :) Should such
improvements be contributed to a "master version," somewhere else at
Apache?
> Would you like to update an associated JIRA? (y/n): y
> Enter a JIRA id [ZOOKEEPER-4342]:
> === JIRA ZOOKEEPER-4342 ===
> summary Robustify C client against errors during SASL negotiation
> assignee Damien Diederen
> status Open
> url https://issues.apache.org/jira/browse/ZOOKEEPER-4342
>
> Enter comma-separated fix version(s) []: 3.8.0,3.7.1
> Traceback (most recent call last):
> File "/Users/enrico.olivelli/dev/zookeeper/zk-merge-pr.py", line 533, in
>
> main()
> File "/Users/enrico.olivelli/dev/zookeeper/zk-merge-pr.py", line 519, in
> main
> resolve_jira_issues(commit_title, merged_refs, jira_comment)
> File "/Users/enrico.olivelli/dev/zookeeper/zk-merge-pr.py", line 329, in
> resolve_jira_issues
> resolve_jira_issue(merge_branches, comment, jira_id)
> File "/Users/enrico.olivelli/dev/zookeeper/zk-merge-pr.py", line 312, in
> resolve_jira_issue
> jira_fix_versions = [get_version_json(v) for v in fix_versions]
> File "/Users/enrico.olivelli/dev/zookeeper/zk-merge-pr.py", line 312, in
>
> jira_fix_versions = [get_version_json(v) for v in fix_versions]
> File "/Users/enrico.olivelli/dev/zookeeper/zk-merge-pr.py", line 310, in
> get_version_json
> return [v for v in versions if v.name == version_str][0].raw