reconstruct-changelog: add Git-Ubuntu-Dch command support
Now, users can tell git-ubuntu how to reconstruct the changelog via the
commit messages. The Git-Ubuntu-Dch command is added and it can receive
3 different values:
- 'short' : Include the short commit message (until first blank line)
- 'full' : Include the full commit message
- 'ignore': Do not include this commit message
Add "Git-Ubuntu-Dch: (short|full|ignore)" in any part of the commit
message and it will be processed as desired.
merge.py is a user-interface-layer component that calls into
GitUbuntuRepository and other internal functionality, which already have
their own unit tests. So these test cases focus on ensuring the
internal functionality will be receiving their expected input. This is
done by substituting GitUbuntuRepository with a MockRepo object with a
faked implementation of GitUbuntuRepository's API that lets us verify it
is receiving requests to tag, update-maintainer, etc. as expected.
(Note a development intent for this patch is to establish testing
coverage for the existing functionality, without making any
modifications to the covered code. Refactoring the existing code may
simplify or improve testing, but this is intentionally being left to
followup work.)
WIP remaining TODOs:
* Increase number/variety of parameterized cases in all tests
* Add more post-operation asserts, to check all expectations
* Trim out parameterized params not actually exercised by test case
* Cleanup this changelog entry :-)
WIP out of scope:
* Implementation of test_parser
* Documentation of MockRepo & associated fakes
This routine creates a single synthetic changelog entry. Each of the
elements of the changelog entry can be overridden via function
parameters, to allow test cases to selectively customize the entry to
suit.
Multiple changelog entries aren't supported. For this, tests will
simply call this routine multiple times and concatenate the results.
Refactor importer to encapsulate sendmail logic to its own object
Add a class to handle the email reporting for the importer. This uses
Python's smtplib module as it can be easily mocked out for testing.
smtplib itself is well-tested (it's even used as the example in pytest's
fixture docs -- https://docs.pytest.org/en/latest/fixture.html).
This otherwise preserves the essential functionality and behavior of the
current code.
README.md: Recommend use of a separate import directory for local usage
The example in the README suggests importing into a subdirectory in the
CWD, however it is likely the user's CWD while reading the README is in
the root of the usd-importer tree. It will lead to less confusion if we
suggest they import to a specific directory elsewhere.