D19612: RFC port to bugzilla REST API
Harald Sitter
noreply at phabricator.kde.org
Fri Mar 8 14:43:46 GMT 2019
sitter created this revision.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
sitter requested review of this revision.
REVISION SUMMARY
I'd love some feedback on the lib api especially. this is the first REST
wrapper I wrote using cpp, so it feels all a bit clunky to me.
https://bugzilla.readthedocs.io/en/5.0/api/
- new internal lib wrapping the REST API
- some testing on the lib, should probably be a bit more comprehensive
- xmlrpc use gone
- BugzillaManager continues to be a singleton manager for the API
- ancient cookie system for login is entirely gone, this has been deprecated (or perhaps even removed?) for years
this is functional, but still requires todo cleanups at the very least.
also duplicate querying is pretty inefficient, needs porting to pagination
really.
some of the files are also overloaded with stuff (connection.cpp brrr)
the lib api is split in three pieces:
1. the connection containing protocol logic
2. the clients containing routing logic
3. the models modeling the json blobs into cpp
the clients especially feel a bit awkward, but I think separating endpoint
handling from the models is a worthwhile thing.
clients get a request, give back a job and the intended use is for
the consumer to then connect to the finished signal of the job to then
ask the clients for the final return value of the job.
this is a bit 'meh'. what I really wanted was a Future to be returned
and the caller to connect to the future. unfortunately qfuture is fairly
limited and since qtbase has no Promise implementation I'm rather opting
for the double-function-approach than doing it like we did in the previous
decade and have a gazillion signals.
this way the handling of the job is always uniform and all specific
"handling code" is inside the connected slot rather than the actual
connection.
error handling has been put entirely into exceptions which get raised
when trying to access a finished job. in BugzillaManager they get rescued
and turned into the already existing signals. this simplifies error
handling a fair amount and also makes the error handling code
look uniform across the various API calls we have.
REPOSITORY
R871 DrKonqi
BRANCH
master
REVISION DETAIL
https://phabricator.kde.org/D19612
AFFECTED FILES
CMakeLists.txt
src/CMakeLists.txt
src/bugzillaintegration/bugzillalib.cpp
src/bugzillaintegration/bugzillalib.h
src/bugzillaintegration/duplicatefinderjob.cpp
src/bugzillaintegration/duplicatefinderjob.h
src/bugzillaintegration/libbugzilla/CMakeLists.txt
src/bugzillaintegration/libbugzilla/attachment.cpp
src/bugzillaintegration/libbugzilla/attachment.h
src/bugzillaintegration/libbugzilla/autotests/CMakeLists.txt
src/bugzillaintegration/libbugzilla/autotests/bugtest.cpp
src/bugzillaintegration/libbugzilla/autotests/bugzillatest.cpp
src/bugzillaintegration/libbugzilla/autotests/connectiontest.cpp
src/bugzillaintegration/libbugzilla/autotests/data/bugs.dragonplayer.json
src/bugzillaintegration/libbugzilla/autotests/data/error.http
src/bugzillaintegration/libbugzilla/autotests/data/hi.http
src/bugzillaintegration/libbugzilla/autotests/data/product.dragonplayer.json
src/bugzillaintegration/libbugzilla/autotests/data/put.http
src/bugzillaintegration/libbugzilla/autotests/producttest.cpp
src/bugzillaintegration/libbugzilla/bug.cpp
src/bugzillaintegration/libbugzilla/bug.h
src/bugzillaintegration/libbugzilla/bugzilla.cpp
src/bugzillaintegration/libbugzilla/bugzilla.h
src/bugzillaintegration/libbugzilla/comment.cpp
src/bugzillaintegration/libbugzilla/comment.h
src/bugzillaintegration/libbugzilla/connection.cpp
src/bugzillaintegration/libbugzilla/connection.h
src/bugzillaintegration/libbugzilla/product.cpp
src/bugzillaintegration/libbugzilla/product.h
src/bugzillaintegration/parsebugbacktraces.cpp
src/bugzillaintegration/parsebugbacktraces.h
src/bugzillaintegration/productmapping.cpp
src/bugzillaintegration/productmapping.h
src/bugzillaintegration/reportassistantpages_base.cpp
src/bugzillaintegration/reportassistantpages_bugzilla.cpp
src/bugzillaintegration/reportassistantpages_bugzilla.h
src/bugzillaintegration/reportassistantpages_bugzilla_duplicates.cpp
src/bugzillaintegration/reportassistantpages_bugzilla_duplicates.h
src/bugzillaintegration/reportinterface.cpp
src/bugzillaintegration/reportinterface.h
src/drkonqi.cpp
To: sitter
Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190308/813a437c/attachment-0001.html>
More information about the Plasma-devel
mailing list