Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[notes] Add support for multiple authors #50

Closed

Conversation

vchrombie
Copy link
Contributor

This PR adds code to support export of multiple authors from the changelog entry.

Resolves #49

@vchrombie vchrombie force-pushed the support-multiple-authors branch from 6255573 to 2bcb95a Compare June 20, 2022 09:25
@vchrombie
Copy link
Contributor Author

@sduenas please review when you have time.
Thanks.

@sduenas
Copy link
Member

sduenas commented Jun 20, 2022

@vchrombie I have this error when running your patch

Traceback (most recent call last):
  File "/home/sduenas/.local/bin/notes", line 8, in <module>
    sys.exit(notes())
  File "/usr/lib/python3/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/sduenas/.local/lib/python3.9/site-packages/release_tools/notes.py", line 108, in notes
    au_content = compose_author_content(project, entry_list)
  File "/home/sduenas/.local/lib/python3.9/site-packages/release_tools/notes.py", line 154, in compose_author_content
    content = composer.compose(project, entries)
  File "/home/sduenas/.local/lib/python3.9/site-packages/release_tools/notes.py", line 358, in compose
    content += author + "\n"
TypeError: can only concatenate list (not "str") to list

This is the input that I use:

---
title: Notes command supports multiple authors in changelog entries
category: added
author:
    - John Smith <jsmith@example.com>
    - John Doe <jdoe@example.com>
issue: 49
notes: >
    The notes command supports exporting of multiple authors
    from the changelog entries. You can add more than one
    author to the changelog entry by defining them as
    ```
    author:
        - John Smith <jsmith@example.com>
        - John Doe <jdoe@example.com>
    ```

@vchrombie
Copy link
Contributor Author

vchrombie commented Jun 21, 2022

Hi @sduenas

@vchrombie I have this error when running your patch

This is the same error when you try to generate notes (with --authors) without this feature.

This is the input that I use:

I used the same and it worked fine for me

p0tt3r@wand ~/dev/release-tools                             
(.venv) >🔮$ cat releases/unreleased/notes-command-supports-multiple-authors-in-changelog-entries.yml
---
title: Notes command supports multiple authors in changelog entries
category: added
author: 
    - John Smith <jsmith@example.com>
    - John Doe <jdoe@example.com>
issue: 49
notes: >
    The notes command supports exporting of multiple authors
    from the changelog entries. You can add more than one
    author to the changelog entry by defining them as
    ```
    author: 
        - John Smith <jsmith@example.com>
        - John Doe <jdoe@example.com>
    ```

p0tt3r@wand ~/dev/release-tools                             
(.venv) >🔮$ semverup         [±support-multiple-authors ✓]
0.5.0

p0tt3r@wand ~/dev/release-tools                             
(.venv) >🔮$ notes "release-tools" 0.5.0 --authors
Release notes file '0.5.0.md' created
Authors file updated

p0tt3r@wand ~/dev/release-tools                             
(.venv) >🔮$ cat AUTHORS     [±support-multiple-authors ●●]
Santiago Dueñas <sduenas@bitergia.com>
Venu Vardhan Reddy Tekula <venu@bitergia.com>
Jose Javier Merchante <jjmerchante@bitergia.com>
John Smith <jsmith@example.com>
John Doe <jdoe@example.com>

p0tt3r@wand ~/dev/release-tools                             
(.venv) >🔮$ cat releases/0.5.0.md 
## release-tools 0.5.0 - (2022-06-21)

**New features:**

 * Notes command supports multiple authors in changelog entries (#49)\
   The notes command supports exporting of multiple authors from the
   changelog entries. You can add more than one author to the changelog
   entry by defining them as ``` author:      - John Smith
   <jsmith@example.com>     - John Doe <jdoe@example.com> ```
 * Option `--bump-version` to increase version manually\
   Include `--bump-version=[MAJOR, MINOR, PATCH]` argument to `sermverup`
   command to increase the version number regardless the release notes
   changes.

@jjmerchante, could you also help to test the patch just to have another view?

Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch looks good to me but we need to improve the tests.

tests/test_notes.py Outdated Show resolved Hide resolved
@sduenas
Copy link
Member

sduenas commented Jun 21, 2022

@vchrombie I have this error when running your patch

This is the same error when you try to generate notes (with --authors) without this feature.

My fault, I was using an older version and not the one from your branch.

@vchrombie vchrombie force-pushed the support-multiple-authors branch 2 times, most recently from dcd9fd8 to 9340173 Compare June 29, 2022 19:10
@vchrombie
Copy link
Contributor Author

Hi @sduenas, please have a look at this PR when you have free time.
Thank you so much.

This commit adds code to support export of multiple
authors from the changelog entry. You can add more than
one author to the changelog entry by defining them as
```
author:
    - John Smith <jsmith@example.com>
    - John Doe <jdoe@example.com>
```

Signed-off-by: Venu Vardhan Reddy Tekula <venuvardhanreddytekula8@gmail.com>
@vchrombie vchrombie force-pushed the support-multiple-authors branch from 9340173 to 5decf0d Compare June 30, 2022 03:03
Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sduenas sduenas closed this in 419e2ca Jul 4, 2022
@vchrombie
Copy link
Contributor Author

Thanks for merging this @sduenas.

@vchrombie vchrombie deleted the support-multiple-authors branch July 13, 2022 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for multiple authors
2 participants