Closed cbartz closed 11 months ago
Thanks for reporting this, yes we should also strip on that line in reconcile.py. Could you add a PR for that (please include at least a unit test as well)?
The discourse behaviour is to actually perform the strip when uploading content to discourse (so it removes any trailing new lines automatically) which is why this is done for the comparison.
It seems that it is not possible to write Discourse posts that contain trailing new lines. This leads to a conflict in the
upload-charm-docs
action in a PR when modifying a document where the base version (the version in the commit tagged withupload-charm-docs/base-content
) is the same as the Discourse post, except that it contains trailing new lines (or probably ws chars in general).If the document is not modified in a PR, no conflict is detected because trailing ws characters are stripped from a local version: https://github.com/canonical/upload-charm-docs/blob/3cb5764f479a08ec067c621aaeb2f2856cef7fd4/src/reconcile.py#L191
As opposed to the base content:
https://github.com/canonical/upload-charm-docs/blob/3cb5764f479a08ec067c621aaeb2f2856cef7fd4/src/reconcile.py#L210-L212
My current understanding is that ws characters should also be stripped from the base content (in fact, adding
strip()
to this line also passes all the tests) like the local version.