kvalo / pwcli Goto Github PK
View Code? Open in Web Editor NEWPatchwork client tool
License: BSD 3-Clause "New" or "Revised" License
Patchwork client tool
License: BSD 3-Clause "New" or "Revised" License
If one of the patches in the series of patches being committed fails to apply (e.g. due to a conflict), the whole command is aborted.
It would be nice to have the chance to start a shell and resolve the conflict manually before proceeding. In my flows, this usually happens when there is a conflict between -fixes and -next.
Luca reported that if a patch has:
Signed-off-by: Ed Example [email protected]
Link: http://www.example.com/
Then pwcli (and git am -s) add a second s-o-b line. I guess it could be handled so that check if there's already s-o-b don't use '-s' switch with git-am.
There should be a check that only patches in 'Under Review' are listed, others are skipped.
2 patches applied:
31e41e6748ba rt2x00usb: do not anchor rx and tx urb's
2e0df2442185 rt2x00usb: fix anchor initialization
Accepted/Under review/Changes requested/Rejected/New/Deferred/Superseded/aWaiting upstream/not aPplicable/rFc/aBort? a
Traceback (most recent call last):
File "/home/kvalo/bin/pwcli", line 2220, in <module>
main()
File "/home/kvalo/bin/pwcli", line 2217, in main
pwcli.run_shell()
File "/home/kvalo/bin/pwcli", line 2002, in run_shell
args.func(args)
File "/home/kvalo/bin/pwcli", line 1563, in cmd_commit
patch.set_state_name(state)
File "/home/kvalo/bin/pwcli", line 521, in set_state_name
self.pw.rpc.patch_set(self.get_id(), params)
File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1316, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1493, in parse_response
return u.close()
File "/usr/lib/python2.7/xmlrpclib.py", line 800, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "<class 'django.db.utils.OperationalError'>:(1040, 'Too many connections')">
If users try out pwcli it can now send emails without the user knowing it. To avoid that we should make emails opt-in by having it as configurable in the config file.
The emails from pwcli should begin:
Fred Foo [email protected] writes:
And in the end there should be a signature. Maybe the signature should also contain a link to the patchwork entry?
Sometimes the list of patches in patchwork may change while the pwcli session is open (e.g. a new patch was submitted or the state of a patch changed). We may then want to refresh the list of patches without quitting and restarting pwcli. A "refresh" command could address that.
master@wireless-drivers-next > review 9
Retrieving patches (1/1)
[2/2] mwifiex: ignore calibration data failure 2016-10-21 Amitkumar Ka Deferred
------------------------------------------------------------
Under review/Changes requested/Rejected/New/Deferred/Superseded/aWaiting upstream/not aPplicable/rFc/aBort? u
Patch set to Under Review
master@wireless-drivers-next > review 8,10
Traceback (most recent call last):
File "/home/kvalo/bin/pwcli", line 2095, in <module>
main()
File "/home/kvalo/bin/pwcli", line 2092, in main
pwcli.run_shell()
File "/home/kvalo/bin/pwcli", line 1883, in run_shell
args.func(args)
File "/home/kvalo/bin/pwcli", line 1545, in cmd_review
patches = self.get_patches_from_ids(args.ids)
File "/home/kvalo/bin/pwcli", line 864, in get_patches_from_ids
indexes = parse_list(ids)
File "/home/kvalo/bin/pwcli", line 123, in parse_list
start = int(start_str)
ValueError: invalid literal for int() with base 10: '8,10'
In the summary email it would be nice to notify if git had to fall back to 3-way merge, like here:
master@wireless-drivers-next > commit 2
Retrieving patches (1/1)
9007981 mwifiex: Drop unnecessary include pcieport_if.h
------------------------------------------------------------
1 patches
commit All/commit Individually/aBort? a
Applying: mwifiex: Drop unnecessary include pcieport_if.h
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging drivers/net/wireless/marvell/mwifiex/pcie.h
============================================================
1 patches applied:
30cfe9f61c2e mwifiex: Drop unnecessary include pcieport_if.h
Accept/request Changes/Reject/Show mail/Edit mail/aBort?
When dealing with SMTP problems it would be nice to see SMTP debug logs. server.set_debuglevel(2) enables and prints the debug log to stderr. Maybe add a switch --debug-smtp to enable that?
To check compilation errors etc. The command should be configurable in the pwcli config file.
In an accepted email the Cc header contains:
Cc: unlisted-recipients:; (no To-header on input)
https://lkml.kernel.org/r/[email protected]
Though rest of the Cc and To field looks ok.
If the patch fails to compile and I choose the state Changes Requested, the patch is still in the repo. pwcli should automatically remove the applied commits from the patchset.
Thinking further, I think pwcli should remove the commits if any other state than Accepted is chosen.
Patchwork removes "[PATCH]" (and varitions of it) from the Subject and doesn't provide the original Subject via XML-RPC interface. Using modified Subject makes the threading look ugly in the summary emails so try to replicate back the original Subject. Should be possible by investigation how patchwork strips the Subject.
Write a proper README for the project. At least an overview, "screenshot" and how to use it. Also development tips would be nice.
If there are no patches available pwcli crashes:
test-branch@pwcli-stub-Ta651k >
potku:~/personal/patchwork/src/pwcli$ ./run_stub
Connecting to http://localhost:8106/
User : test (7477, 30052, 118371)
Projects : stub-test
Tree : pwcli-stub-Hsbz4D
Branch : test-branch
New : 18
Review : 7
Upstream : 0
Deferred : 5
Total : 30
test-branch@pwcli-stub-Hsbz4D > list -n doesnotexist
test-branch@pwcli-stub-Hsbz4D > review 2
Traceback (most recent call last):
File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 2217, in <module>
main()
File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 2214, in main
pwcli.run_shell()
File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 2002, in run_shell
args.func(args)
File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 1664, in cmd_review
patches = self.get_patches_from_ids(args.ids)
File "/home/kvalo/projects/personal/patchwork/src/pwcli/pwcli", line 958, in get_patches_from_ids
raise Exception('No patches available, doing nothing.')
Exception: No patches available, doing nothing.
Noticed that tags are not properly cleaned in stgit mode:
[RESEND, v4] ath10k: Fix sending NULL/ Qos NULL data frames for QCA99X0 and later
It would be nice to be able to read all comments from patchwork before applying the patch. So pwcli could automatically open the patch page on the browser, for example like this:
$BROWSER https://patchwork.kernel.org/patch/9113281/
If $BROWSER is unset xdg-open would be a good default.
Commands where the page(s) could be opened:
master@wireless-drivers-next > reply #12220245
Failed to convert index to integer: invalid literal for int() with base 10: '#12220245'
But show command works:
master@wireless-drivers-next > show #12220245
Delegate: kvalo
State: Changes Requested
From: Dan Carpenter <[email protected]>
Date: 2021-04-23 11:46:34
Patchwork-Id: 12220245
Compile script should not be run if stg import fails:
Retrieving patches (1/1)
[2/3] ath10k: use size_t for len variables 2017-02-02 Amadeusz Sła New
------------------------------------------------------------
Apply 1 patches to the pending branch? [Apply/Skip/aBort] a
Failed to apply patch: ['stg', 'import', '--mbox', '--sign'] failed: 2
error: patch failed: drivers/net/wireless/ath/ath10k/debug.c:726
error: drivers/net/wireless/ath/ath10k/debug.c: patch does not apply
stg import: Diff does not apply cleanly
Build successful
Changes requested/Rejected/New/Deferred/Superseded/aWaiting upstream/not aPplicable/rFc/aBort?
If a patch already has a Patchwork-Id (for example I have done that multiple times when picking patches from the pending branch and resubmitting them) pwcli adds a second one in the bottom:
Signed-off-by: Alice <[email protected]>
Patchwork-Id: 1111
Signed-off-by: Bob <[email protected]>
Patchwork-Id: 2222
But when pwcli reads the id from pending branch it uses the first id, which is the incorrect one.
One possible solution is to remove all lines which we start with "Patchwork-Id:". Another possibility is to reject the patch. Don't know what's the best.
If there are multiple email headers:
To: <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
Cc: <[email protected]>
pwcli will only take the first one:
To: [email protected]
Cc: <[email protected]>
Example:
[PATCH] ath9k: Move generic entries below specific ones in ath_pci_id_table.
https://patchwork.kernel.org/patch/9360361/
Luca reported that commit fails for him. It was because he is using git's decorate feature. A quick workaround was to remove $ from this regexp:
match = re.search(r'^commit ([0-9a-f]{40})$', text, re.MULTILINE)
A proper fix would be to use hardocoded output format, like --pretty=format:%H or something similar. And maybe --no-decorate?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.