Commit Graph

12 Commits

Author SHA1 Message Date
Alex Waterman
dd4c60aeb5 gpu: nvgpu: rfr: Add address book
Add an address book that lets devs use short hand for specifying
--to and --cc targets. For example, if a dev wants to CC the MISRA
list this can be used:

  $ ./scripts/rfr -e --cc misra ...

The address book also lets devs add their own names/email addresses
since this makes it convenient to CC individual people. For example:

  $ ./scripts/rfr -e --cc alex ...

Several new arguments were added to support the address book. There
are arguments to list/search the address book, ignore the address
book, and to prevent nvgpu-core from being added to the to address
by default. For more details see the help page.

To use an address book there's several options: place one at

  ~/.rfr-addrbook

Export an RFR_ADDRBOOK environment variable pointing to the address
book, or specify one with the `-a' option. The address book contents
is simple. All empty lines and lines beginning with '#' are ignored.
The remaining lines are split by '|' and the first half of the line
is considered a nickname and the latter half the address. An example:

  alex | alex waterman <alexw@nvidia.com>

This will let you specify `--to alex' instead of the full email
address. This is especially useful for mailing lists.

Lastly there is more documentation located at:

  https://confluence.nvidia.com/display/TGS/NVGPU+Request+For+Review

[Bump version to 1.1.0]

Change-Id: Iac7ec05ae28d7e888d2bf36bd23574ec49eb04dc
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1983695
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
2019-01-16 15:38:18 -08:00
Alex Waterman
67138e0376 gpu: nvgpu: rfr: Add support for CCs
Add support for CCs instead of only direct To addresses. This
lets us have more fine grained control over the to/cc addresses.

[Bump minor revision to 1.0.3]

Change-Id: Ie2864ddde02a71a4502bf2b3d0d80064810da0ef
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1983663
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
2019-01-16 15:38:14 -08:00
Alex Waterman
e2aa359774 gpu: nvgpu: rfr: Notify user of email destination
When sending emails it can be nice to see who you are sending an
email to if you specify multiple '--to' options.

Also update the get_user_message() function to remove comment lines
starting with '#'. This lets the script place information useful
to a developer in the message that won't ultimately make it to the
final email.

[Bump minor revision to 1.0.2]

Change-Id: I3657a787d8e9a8c19de727e050a0b9a18a6d43e0
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1983642
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
2019-01-16 15:38:11 -08:00
Alex Waterman
bf51b0cdf7 gpu: nvgpu: Update license for some scripts
Update (or add) the MIT license for several scripts in the nvgpu
code.

Change-Id: I3724c3cf22358773cc7dcaa8a8bb8acba439d216
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1946911
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-12 15:46:49 -08:00
Alex Waterman
138e70b0d4 scripts: rfr: Add file support
Add support for reading a file full of commit IDs/URLs. This
makes generating an RFR from a long list of commits easier in
some cases.

Change-Id: Id71173853e29d951048e8c3394ffce5d8b1eeb52
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1576523
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-08-22 10:23:35 -07:00
Konsta Holtta
bf8a1e0019 scripts: rfr: support multiple recipients
Add an argument (-t, --to) to specify additional recipients for the
review email. Sometimes it's useful to highlight some people explicitly
or in addition to the usual nvgpu core list.

In the future, we might consider adding some heuristics for less typing
(such as adding @nvidia.com automatically). For now the addresses have
to be complete.

Change-Id: I0e4ce5974a7a2f3db6eacc7128b825d20d6fd57c
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1768066
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-08-21 10:03:01 -07:00
Alex Waterman
641c208948 scripts: rfr: Direct email support
Add support for `rfr' to send emails directly to the nvgpu-core mailing
list. Copying the email contents and then manually updating it is
annoying. This streamlines that process greatly!

Since most people always write something extra past what the `rfr'
script generates you can edit the message before it sends. If you don't
specify a message explicitly with '--msg' then an editor based on your
setting of $EDITOR is opened up with the contents of the email. What
you edit into there will be sent verbatim. If for some reason you want
nothing to be added there's the '--no-msg' option.

Change-Id: Icb0ccba936357cf5e3a93001a5c22aeacf906e11
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1595544
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Tested-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-06-28 11:13:24 -07:00
Richard Zhao
a55e3e361d scripts: rfr: support https://git-master.nvidia.com/r/#/c/(\d+)
https://git-master.nvidia.com/r/#/c/(\d+) is acceptable format for
gerrit website and it won't auto-correct by adding '/' at endof the url.

Jira EVLR-2364

Change-Id: I1a33578058d23fbb3eaf76d260a1a659c628fdc3
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1646315
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-01-31 02:41:07 -08:00
Konsta Holtta
7e493175de scripts: rfr: query gerrit for git sha1
The gerrit search supports git sha1 revisions, so use that directly when
given a git commit.

This changes the behaviour such that the change-id found from the commit
message is not used implicitly, which removes ambiguity.

Change-Id: Ifac1002421886dc73234b530d937395aae5addee
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1585437
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-01 00:05:19 -07:00
Konsta Holtta
b5b9e71bd5 scripts: rfr: explicitly use gerrit cl if needed
Fetch the full patch information from gerrit as soon as possible, so
that the gerrit cl (i.e., git-master url) is used if given, because it
has more information than the change-id (which may exist in multiple
branches).

Querying based on change-id or git commit-id are left as-is.

Change-Id: I58dfa9da7354d607ca7e38f91e4a5f2c92c8454f
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1585436
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2017-11-01 00:05:14 -07:00
Alex Waterman
980bf96bf2 scripts: rfr: Remove duplicate subjects
The commit subject is printed implicitly in the commit message
so remove the subject from the header generated by `rfr'.

Also delete a debug line that got left over accidentally.

Change-Id: Ia7fe704182d87504c5794ad4661d8dd2f14bc51f
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1558431
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-09-13 16:08:31 -07:00
Alex Waterman
65f18d74ee scripts: Add an 'rfr' program
Add an RFR program to generate RFR emails. Since there are many emails
sent with either no information or lacking information this script
will help make RFR emails more useful to developers interested in
conducting reviews.

The help is as follows:

  $ ./rfr --help
  usage: rfr [-h] [-V] [-m MSG] Commit-IDs [Commit-IDs ...]

  RFR formatting tool

  positional arguments:
    Commit-IDs         Git or gerrit commits to describe. Can be either a git or
                       gerrit commit ID. If the ID starts with a 'I' then it
                       will be treated as a gerrit ID. If the commit ID looks
                       like a gerrit URL then it is treated as a gerrit URL.
                       Otherwise it's treated as a git commit ID.

  optional arguments:
    -h, --help         show this help message and exit
    -V, --version      print the program version
    -m MSG, --msg MSG  Custom message to add to the RFR email

  This program will format commit messages into something that can be sent to
  the nvgpu mailing list for review

The Commit IDs can be a git commit ID, gerrit change ID, or a gerrit URL. For
example:

  # Git commit IDs (abbreviated are ok)
  $ ./rfr 89e2470807
  $ ./rfr 89e2470807571ef6dc545ece8f5f7e43e27b0c12

  # Gerrit Change-Id (also can be abbreviated)
  $ ./rfr I0524ae1982fbce9eb4da976e72102e08e2dcd017
  $ ./rfr I0524ae198

  # And lastly, several different URL formats:
  https://git-master.nvidia.com/r/#/c/1553782/2
  https://git-master.nvidia.com/r/#/c/1553782/
  https://git-master.nvidia.com/r/1553782
  https://git-master/r/1553782

The only currently known bug is that if yo have multiple versions of a
commit that share the same gerrit Change-ID then this script will only
take the first one. For example if there's a bunch of cherry-picks then
which commit is taken is undefined.

It seems like generally the order that gerrit returns changes puts open
changes first, but this is not tested nor should this be relied upon. At
some point supporting some mechanism to filter will be necessary.

Change-Id: I0524ae1982fbce9eb4da976e72102e08e2dcd017
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1552173
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2017-09-11 15:50:42 -07:00