Closed pmuller closed 10 years ago
@pmuller mailed me a copy of his (non public) changelog file, and after bisecting it I realized it was actually quite simple.
The changelog was lacking an initial release line, meaning that the final couple of changelog lines had no release. In other words, it looked like this:
* :release:`0.14.1 <date>`
* :bug:`0` bugs and such here
.. <a bunch more releases and issue lines, as usual>
* :release:`0.5.0 <date>`
* :feature:`0` early feature 2
* :feature:`0` early feature 1
.. notice there is no initial release here! this is the end of the file.
Releases scans the changelog file bottom-up, so if there is no 'first' (from that perspective) release, it has no idea what release those first two early features belong to.
I'll see what I can do so that Releases detects this and yields a more useful error, and if the docs could use an extra warning or something.
@pmuller - so if you put an e.g. '0.4.0' release at the very bottom of your changelog - or if you remove those last two features - it should build correctly.
Even when adding an initial release at the end of the changelog, I still get the same error. (I e-mailed the updated changelog to you).
Moreover, releases' own changelog does not have an initial release (it also starts with a feature). So I'm afraid I misunderstood your answer.
That's pretty strange, then :( Bisecting your original file clearly showed the issue only appeared when those last two lines were added back in, which is what brought me that red herring - but you're right, the new edition fails again & we do have other changelogs with trailing issues.
I bisected your new one, focusing on the end, and quickly realized it was the final feature line (I anonymized it even though it looked pretty innocuous out of context :)):
* :feature:`0` some text here that doesn't really mean anything,
more text here that is indented 3 spaces deep.
With that line-item removed, it builds. Poked at those two lines more, noticed that if I simply dedent the 2nd line 1 space so it matches the non-bullet part of the 1st line, things build. This implies it's an invalid-ReST problem (though offhand I didn't think ReST was that picky?), which is probably preventing Releases from mutating its issue
node within that section, thus leading to the error.
But I'm going to dig into it to make sure I'm right this time :)
Yea, that extra indent is causing ReST to turn those two lines into a definition list item, with the issue object inside the term sub-element (definition list items become an outer element wrapping one or more pairs of term/definition elements). So the final tree at this step becomes:
<list_item>
<definition_list>
<term>
<issue />
<first text line />
</term>
<definition>
<second text line />
</definition>
</definition_list>
</list_item>
This is a situation Releases wasn't equipped to handle; it sees a 'bare' list item that doesn't start with an issue node, goes "ah, this is a vanilla list item, I'm supposed to turn those into bugs automatically", and does so. But that leaves the user-intended issue node wrapped deep within, which never gets mutated into HTML nodes, and so the HTML render step dies with the error in question.
Still poking to see what Releases can/should do here so the error (because it is still technically an error - Releases requires a specific format after all) is made more obvious or is otherwise handled.
@pmuller I pushed a fix now that I think does the trick; it spits out an exception in this situation (both in my tests and on your changelog file), with a reasonably verbose error message including a print of the trouble spot and a note saying "yo, recheck your syntax!".
@pmuller Bump :)
Oops, I realize I never updated this issue. I'm sorry.
I actually use your patch and it works well ! Thanks :)
Sweet, glad to hear it :)
Using releases 0.6.1 and most earlier versions, I get the same exception as in #22 and #24. Here is the Sphinx error log :
Since this changelog.rst does not belong to an opensource project, I'll send it to you by e-mail.
I tried many versions of release; and the 0.2.4 version builds this changelog.rst file successfully. More recent ones do not.
Thanks for your help !