packit / upsint

Upstream Integration: work better with your upstream project.
GNU General Public License v3.0
2 stars 9 forks source link

Add support for the label listing #18

Closed lachmanfrantisek closed 6 years ago

lachmanfrantisek commented 6 years ago
Usage: tool labels [OPTIONS] [REPO]

  List the labels for the project. This is how you can select a repository
  for Github: <namespace>/<project>.

Options:
  -s, --service TEXT  Name of the git service (e.g. github/gitlab).
  -c, --copy TEXT     Copy labels to another repo.
  --help              Show this message and exit.
$ tool labels -c user-cont/colin -c user-cont/conu
╒══════════════════════════════════╤════════╤══╕
│ bug                              │ d73a4a │  │
├──────────────────────────────────┼────────┼──┤
│ duplicate                        │ cfd3d7 │  │
├──────────────────────────────────┼────────┼──┤
│ enhancement                      │ a2eeef │  │
├──────────────────────────────────┼────────┼──┤
│ good first issue                 │ 7057ff │  │
├──────────────────────────────────┼────────┼──┤
│ help wanted                      │ 008672 │  │
├──────────────────────────────────┼────────┼──┤
│ invalid                          │ e4e669 │  │
├──────────────────────────────────┼────────┼──┤
│ label-for-testing-the-label-sync │ 0e8a16 │  │
├──────────────────────────────────┼────────┼──┤
│ question                         │ d876e3 │  │
├──────────────────────────────────┼────────┼──┤
│ wontfix                          │ ffffff │  │
╘══════════════════════════════════╧════════╧══╛
1 labels of 9 moved to user-cont/colin
1 labels of 9 moved to user-cont/conu
lachmanfrantisek commented 6 years ago

There is only a problem with the descriptions -- the GitHub API does return them...

lachmanfrantisek commented 6 years ago

Subcommand split:

$ tool list-labels --help
Usage: tool list-labels [OPTIONS] [REPO]

  List labels for the project. This is how you can select a repository for
  Github: <namespace>/<project>.

Options:
  -s, --service TEXT  Name of the git service (e.g. github/gitlab).
  --help              Show this message and exit.
$ tool update-labels --help
Usage: tool update-labels [OPTIONS] DESTINATION [SOURCE]

  Update labels of other project. Multiple destinations can be set by
  joining them with semicolon. This is how you can select a repository for
  Github: <namespace>/<project>.

Options:
  -s, --service TEXT     Name of the git service for destination (e.g.
                         github/gitlab).
  --source-service TEXT  Name of the git service (e.g. github/gitlab).
  --help                 Show this message and exit.

@TomasTomecek I have two questions:

Thanks.

lachmanfrantisek commented 6 years ago

I've also added support for the gitlab. Some notes about that:

TomasTomecek commented 6 years ago
    Any idea to achieve multiple destinations than this:

$ tool update-labels user-cont/colin\;user-cont/conu user-cont/tool

how about $ tool update-labels --source-repo https://github.com/user-cont/kwaciaren user-cont/x user-cont/y. --source-repo would default to repo in PWD.

Do we need to be consistent with the REPO argument in other commands? Is the destination ok?

Yes, that's fine. I'm working on configuration PR and let's discuss over there once I open it.

The colour format differ (Github does not have # at the start). --> Currently, I am converting the colours on the update. Does it make sense to use some common format for list-labels?

Personally, I don't care.

I've added --source-service to allow different service for the source and destination. (If there are multiple destinations, all will have the same service.)

This is pretty nuts!

lachmanfrantisek commented 6 years ago

@TomasTomecek I've done as you wrote...

TomasTomecek commented 6 years ago

Well done!