[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Review Request: Make KAuth ready for frameworks + API Changes
From:       "Dario Freddi" <drf () kde ! org>
Date:       2012-03-18 22:25:52
Message-ID: 20120318222552.5332.32105 () vidsolbach ! de
[Download RAW message or body]

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104337/
-----------------------------------------------------------

Review request for kdelibs, Kevin Ottens, David Faure, and Alexander Neundo=
rf.


Description
-------

Preamble - sorry for having to name-call people but apparently we still don=
't have a frameworks way for reviewing code (which sucks). And sorry for th=
e long summary, but it's worth reading. However.

This huge patchsets brings KAuth in the marvelous world of Frameworks. If y=
ou dislike ReviewBoard's way of displaying diffs or simply want to see a co=
mmit list, please refer to the URL in "Branch".

First of all, I pulled in a dependency on KJob after a chat with Kevin. Thi=
s makes KAuth tier2, but shouldn't be a big issue.

Then there's the hard part: source compatibility is reasonably broken here.=
 The changes I had to do were mostly for the sake of revamping the internal=
 workflow of the library. The main problem KAuth had was the fact it was co=
mpletely synchronous, leading to a multitude of problems. After these chang=
es it's fully asynchronous instead (reason for pulling in KJob), the API wa=
s simplified, and some unused features like multiple action execution have =
been removed.

The main changes at a glance:

 * Some renaming to the enums
 * Moving Action & ActionReply to be implicitly shared
 * Removing ActionWatcher (now useless due to the new semantics of execute
 * Removing some useless APIs from Action, namely executeActions, execute(h=
elper)
 * execute() now returns a KJob
 * helperID() -> helperId()
 * Static action replies are now static accessors returning a new instance.=
 This was a complete mistake in the first place, but it's still there with =
a different semantic to ease porting. The main use case for changing this i=
s a failure to handle implicitly shared classes in multithreaded environmen=
ts with that approach.

Of course, while it would be awesome to have all the code reviewed, I under=
stand it's a very big change so I'd like at least some feedback on the foll=
owing points:

 * General sanity of the new API
 * Consistency of the enums. StatusInvalid vs. ExecuteMode vs. Authorizatio=
nDeniedError. While the semantic seems correct to me, I'd like to have some=
 feedback on whether consistency is valuable in the ordering of <type><valu=
e> vs. <value><type> and which one should be preferred in case.
 * Whether to deprecate static accessors such as static const ActionReply S=
uccessReply(). I strongly favor this.
 * Whether the new dependency of kcoreaddons for the sake of using KJob is =
reasonable or I should go for a different alternative.
 * CMake sanity for the new dependency of kcoreaddons.

The code is pretty much unit-tested and it should have a decent coverage, e=
ven if I had no way to check this. For unit tests, I had to create a fake a=
uthorization backend for testing purposes, whereas I managed to reuse the d=
bus backend for helper communication, so that I could even test that. For r=
unning the helper and the client in the same process, in the unit test I am=
 resorting to making the dbus service of the helper live in a separate thre=
ad, to prevent asynchronous DBus calls from failing due to QDBus' local-loo=
p optimization. The test is also run on the session bus.


Diffs
-----

  staging/kauth/CMakeLists.txt PRE-CREATION =

  staging/kauth/autotests/BackendsManager.h PRE-CREATION =

  staging/kauth/autotests/BackendsManager.cpp PRE-CREATION =

  staging/kauth/autotests/CMakeLists.txt PRE-CREATION =

  staging/kauth/autotests/HelperTest.cpp PRE-CREATION =

  staging/kauth/autotests/SetupActionTest.cpp PRE-CREATION =

  staging/kauth/autotests/TestBackend.h PRE-CREATION =

  staging/kauth/autotests/TestBackend.cpp PRE-CREATION =

  staging/kauth/autotests/TestHelper.h PRE-CREATION =

  staging/kauth/autotests/TestHelper.cpp PRE-CREATION =

  staging/kauth/src/AuthBackend.h PRE-CREATION =

  staging/kauth/src/CMakeLists.txt PRE-CREATION =

  staging/kauth/src/HelperProxy.h PRE-CREATION =

  staging/kauth/src/backends/dbus/DBusHelperProxy.h PRE-CREATION =

  staging/kauth/src/backends/dbus/DBusHelperProxy.cpp PRE-CREATION =

  staging/kauth/src/backends/dbus/org.kde.auth.xml PRE-CREATION =

  staging/kauth/src/backends/fake/FakeBackend.cpp PRE-CREATION =

  staging/kauth/src/backends/fakehelper/FakeHelperProxy.h PRE-CREATION =

  staging/kauth/src/backends/fakehelper/FakeHelperProxy.cpp PRE-CREATION =

  staging/kauth/src/backends/mac/AuthServicesBackend.cpp PRE-CREATION =

  staging/kauth/src/backends/policykit/PolicyKitBackend.cpp PRE-CREATION =

  staging/kauth/src/backends/polkit-1/Polkit1Backend.cpp PRE-CREATION =

  staging/kauth/src/kauthaction.h PRE-CREATION =

  staging/kauth/src/kauthaction.cpp PRE-CREATION =

  staging/kauth/src/kauthactionreply.h PRE-CREATION =

  staging/kauth/src/kauthactionreply.cpp PRE-CREATION =

  staging/kauth/src/kauthactionwatcher.h PRE-CREATION =

  staging/kauth/src/kauthactionwatcher.cpp PRE-CREATION =

  staging/kauth/src/kauthexecutejob.h PRE-CREATION =

  staging/kauth/src/kauthexecutejob.cpp PRE-CREATION =


Diff: http://git.reviewboard.kde.org/r/104337/diff/


Testing
-------

New unit tests pass 100%


Thanks,

Dario Freddi


[Attachment #3 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/104337/">http://git.reviewboard.kde.org/r/104337/</a>
  </td>
    </tr>
   </table>
   <br />


<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kdelibs, Kevin Ottens, David Faure, and Alexander \
Neundorf.</div> <div>By Dario Freddi.</div>







<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Preamble - sorry for having to name-call people but apparently we still \
don&#39;t have a frameworks way for reviewing code (which sucks). And sorry for the \
long summary, but it&#39;s worth reading. However.

This huge patchsets brings KAuth in the marvelous world of Frameworks. If you dislike \
ReviewBoard&#39;s way of displaying diffs or simply want to see a commit list, please \
refer to the URL in &quot;Branch&quot;.

First of all, I pulled in a dependency on KJob after a chat with Kevin. This makes \
KAuth tier2, but shouldn&#39;t be a big issue.

Then there&#39;s the hard part: source compatibility is reasonably broken here. The \
changes I had to do were mostly for the sake of revamping the internal workflow of \
the library. The main problem KAuth had was the fact it was completely synchronous, \
leading to a multitude of problems. After these changes it&#39;s fully asynchronous \
instead (reason for pulling in KJob), the API was simplified, and some unused \
features like multiple action execution have been removed.

The main changes at a glance:

 * Some renaming to the enums
 * Moving Action &amp; ActionReply to be implicitly shared
 * Removing ActionWatcher (now useless due to the new semantics of execute
 * Removing some useless APIs from Action, namely executeActions, execute(helper)
 * execute() now returns a KJob
 * helperID() -&gt; helperId()
 * Static action replies are now static accessors returning a new instance. This was \
a complete mistake in the first place, but it&#39;s still there with a different \
semantic to ease porting. The main use case for changing this is a failure to handle \
implicitly shared classes in multithreaded environments with that approach.

Of course, while it would be awesome to have all the code reviewed, I understand \
it&#39;s a very big change so I&#39;d like at least some feedback on the following \
points:

 * General sanity of the new API
 * Consistency of the enums. StatusInvalid vs. ExecuteMode vs. \
AuthorizationDeniedError. While the semantic seems correct to me, I&#39;d like to \
have some feedback on whether consistency is valuable in the ordering of \
&lt;type&gt;&lt;value&gt; vs. &lt;value&gt;&lt;type&gt; and which one should be \
                preferred in case.
 * Whether to deprecate static accessors such as static const ActionReply \
                SuccessReply(). I strongly favor this.
 * Whether the new dependency of kcoreaddons for the sake of using KJob is reasonable \
                or I should go for a different alternative.
 * CMake sanity for the new dependency of kcoreaddons.

The code is pretty much unit-tested and it should have a decent coverage, even if I \
had no way to check this. For unit tests, I had to create a fake authorization \
backend for testing purposes, whereas I managed to reuse the dbus backend for helper \
communication, so that I could even test that. For running the helper and the client \
in the same process, in the unit test I am resorting to making the dbus service of \
the helper live in a separate thread, to prevent asynchronous DBus calls from failing \
due to QDBus&#39; local-loop optimization. The test is also run on the session \
bus.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">New unit tests pass 100%</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>staging/kauth/CMakeLists.txt <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/autotests/BackendsManager.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/autotests/BackendsManager.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/autotests/CMakeLists.txt <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/autotests/HelperTest.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/autotests/SetupActionTest.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/autotests/TestBackend.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/autotests/TestBackend.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/autotests/TestHelper.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/autotests/TestHelper.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/AuthBackend.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/CMakeLists.txt <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/HelperProxy.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/backends/dbus/DBusHelperProxy.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/backends/dbus/DBusHelperProxy.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/backends/dbus/org.kde.auth.xml <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/backends/fake/FakeBackend.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/backends/fakehelper/FakeHelperProxy.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/backends/fakehelper/FakeHelperProxy.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/backends/mac/AuthServicesBackend.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/backends/policykit/PolicyKitBackend.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/backends/polkit-1/Polkit1Backend.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/kauthaction.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/kauthaction.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/kauthactionreply.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/kauthactionreply.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/kauthactionwatcher.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/kauthactionwatcher.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/kauthexecutejob.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>staging/kauth/src/kauthexecutejob.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/104337/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>




  </div>
 </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic