Bug 341875 - Upload to ReviewBoard stopped working
Summary: Upload to ReviewBoard stopped working
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: patchreview (show other bugs)
Version: 1.7.0
Platform: Other Other
: NOR major
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-14 12:41 UTC by RJVB
Modified: 2014-12-31 18:06 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2014-12-14 12:41:49 UTC
Since my last successful upload yesterday evening around 21:48 Europe/Paris time, I am no longer able to use the ReviewBoard upload feature in KDevelop 4.7 . The same feature still functions in KDevelop git/master when used in KUbuntu's Project Neon 5 testbed (the only way I can use the most recent KDevelop version for now).

Reproducible: Always

Steps to Reproduce:
1. Open a project that has local changes
2. Do Git/Show Differences
3. Do Export Diff/ReviewBoard
4. authenticate and validate the dialog, optionally after having selected an existing request to modify

Actual Results:  
A generic error dialog appears, and `Could not upload the patch "Request Error: One or more fields had errors" ` is printed on the calling terminal.

Expected Results:  
A success dialog containing the URL to the RR.

Terminal feedback from various tested KDevelop versions, on KUbuntu 14.04:

> with kdevelop 4.7 git/4.7 (and ditto kdevplatform), kdelibs 4.14.3 git/4.14 . With the 4.7/1.7 versions, the QUrl contains my password (masked here with a `*`)!

```
starting...  QUrl( "https://rjvbb:*@git.reviewboard.kde.org/api/review-requests/" )  "repository=/repositories/kwallet.git/" 
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x12002d6
content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem.
starting...  QUrl( "https://rjvbb:*@git.reviewboard.kde.org/api/review-requests/121505/diffs/" )  "------------q7RhJ5Qhy6OYXa3JcxoGzLpBzJuKF2s57HmPMA6IGTqm3s5dntsnChw
Content-Disposition: form-data; name="basedir"

/
------------q7RhJ5Qhy6OYXa3JcxoGzLpBzJuKF2s57HmPMA6IGTqm3s5dntsnChw
Content-Disposition: form-data; name="path"; filename="kdevelopB155842.patch"
Content-Type: text/x-patch

diff --git tests/KWallet/kwallettest.h tests/KWallet/kwallettest.h
index 2936ac1..b42a5fe 100644
--- tests/KWallet/kwallettest.h
+++ tests/KWallet/kwallettest.h
@@ -33,6 +33,8 @@ public:
 private Q_SLOTS:
     void init();
     void testWallet();
+protected:
+    void QVERIFY2(bool hasFolder, const char* arg2);
 };
 
 #endif

------------q7RhJ5Qhy6OYXa3JcxoGzLpBzJuKF2s57HmPMA6IGTqm3s5dntsnChw--
" 
Could not upload the patch "Request Error: One or more fields had errors" 
```


> with kdevelop 4.7 and kdelibs 4.14.2 from (K)Ubuntu's repo:
```
starting...  QUrl( "https://rjvbb:*@git.reviewboard.kde.org/api/review-requests/" )  "repository=/repositories/kwallet.git/" 
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x12002ff
content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem.
starting...  QUrl( "https://rjvbb:*@git.reviewboard.kde.org/api/review-requests/121502/diffs/" )  "------------y2JQxlWu3WzuLM2R2VkxVY9ApAvOZIhVL1uImQBnv8hEVkfXDNVgter
Content-Disposition: form-data; name="basedir"

/
------------y2JQxlWu3WzuLM2R2VkxVY9ApAvOZIhVL1uImQBnv8hEVkfXDNVgter
Content-Disposition: form-data; name="path"; filename="kdevelopk129772.patch"
Content-Type: text/x-patch

diff --git tests/KWallet/kwallettest.h tests/KWallet/kwallettest.h
index 2936ac1..b42a5fe 100644
--- tests/KWallet/kwallettest.h
+++ tests/KWallet/kwallettest.h
@@ -33,6 +33,8 @@ public:
 private Q_SLOTS:
     void init();
     void testWallet();
+protected:
+    void QVERIFY2(bool hasFolder, const char* arg2);
 };
 
 #endif

------------y2JQxlWu3WzuLM2R2VkxVY9ApAvOZIhVL1uImQBnv8hEVkfXDNVgter--
" 
Could not upload the patch "Request Error: One or more fields had errors" 
```

> Using Kdevelop KF5 git/head against KDE 5 Frameworks from KUbuntu's Project Neon 5. Note how the QUrl does NOT contain my password!
```
starting...  QUrl( "https://rjvbb@git.reviewboard.kde.org/api/review-requests/" )  "repository=/repositories/kwallet.git/"
content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem.
starting...  QUrl( "https://rjvbb@git.reviewboard.kde.org/api/review-requests/121500/diffs/" )  "------------rmSfvNJJeLqMNaQwqhgI2TkB2cUsDlp4VGjQd0jILXcj52duiJCimvr
Content-Disposition: form-data; name="basedir"

/
------------rmSfvNJJeLqMNaQwqhgI2TkB2cUsDlp4VGjQd0jILXcj52duiJCimvr
Content-Disposition: form-data; name="path"; filename="kdevelop_t12140.patch"
Content-Type: text/x-patch

diff --git a/tests/KWallet/kwallettest.h b/tests/KWallet/kwallettest.h
index 2936ac1..b42a5fe 100644
--- a/tests/KWallet/kwallettest.h
+++ b/tests/KWallet/kwallettest.h
@@ -33,6 +33,8 @@ public:
 private Q_SLOTS:
     void init();
     void testWallet();
+protected:
+    void QVERIFY2(bool hasFolder, const char* arg2);
 };
 
 #endif

------------rmSfvNJJeLqMNaQwqhgI2TkB2cUsDlp4VGjQd0jILXcj52duiJCimvr--
"
```
Comment 1 RJVB 2014-12-14 15:41:33 UTC
Modified reviewboardjobs.cpp HttpCall::finished to print the receivedData before and after parsing:

    void HttpCall::finished()
    {
        QJson::Parser parser;
        QByteArray receivedData = m_reply->readAll();

        qDebug() << "parsing..." << receivedData;
        bool ok;
        m_result = parser.parse(receivedData, &ok);
        qDebug() << "parsing result=" << m_result;

and using kdevplatform git/1.7 on OS X, I get:

```
starting...  QUrl( "https://rjvbb:*@git.reviewboard.kde.org/api/review-requests/" )  "repository=/repositories/kde-runtime.git/" 
content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem.
parsing... "{"stat": "ok", "review_request": {"status": "pending", "last_updated": "2014-12-14T15:31:42Z", "links": {"diffs": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/diffs/", "method": "GET"}, "repository": {"href": "https://git.reviewboard.kde.org/api/repositories/147/", "method": "GET", "title": "kde-runtime"}, "screenshots": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/screenshots/", "method": "GET"}, "self": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/", "method": "GET"}, "update": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/", "method": "PUT"}, "last_update": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/last-update/", "method": "GET"}, "reviews": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/reviews/", "method": "GET"}, "file_attachments": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/file-attachments/", "method": "GET"}, "draft": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/draft/", "method": "GET"}, "diff_context": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/diff-context/", "method": "GET"}, "submitter": {"href": "https://git.reviewboard.kde.org/api/users/rjvbb/", "method": "GET", "title": "rjvbb"}, "changes": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/changes/", "method": "GET"}, "delete": {"href": "https://git.reviewboard.kde.org/api/review-requests/121512/", "method": "DELETE"}}, "depends_on": [], "issue_resolved_count": 0, "ship_it_count": 0, "id": 121512, "description": "", "target_people": [], "changenum": null, "bugs_closed": [], "testing_done": "", "branch": "", "time_added": "2014-12-14T15:31:42Z", "extra_data": {}, "public": false, "commit_id": null, "blocks": [], "close_description": null, "text_type": "plain", "issue_open_count": 0, "approved": false, "url": "/r/121512/", "absolute_url": "https://git.reviewboard.kde.org/r/121512/", "target_groups": [], "summary": "", "issue_dropped_count": 0, "approval_failure": "The review request has not been marked \"Ship It!\""}}" 
parsing result= QVariant(QVariantMap, QMap(("review_request", QVariant(QVariantMap, QMap(("absolute_url", QVariant(QString, "https://git.reviewboard.kde.org/r/121512/") ) ( "approval_failure" ,  QVariant(QString, "The review request has not been marked "Ship It!"") ) ( "approved" ,  QVariant(bool, false) ) ( "blocks" ,  QVariant(QVariantList, () ) ) ( "branch" ,  QVariant(QString, "") ) ( "bugs_closed" ,  QVariant(QVariantList, () ) ) ( "changenum" ,  QVariant(, ) ) ( "close_description" ,  QVariant(, ) ) ( "commit_id" ,  QVariant(, ) ) ( "depends_on" ,  QVariant(QVariantList, () ) ) ( "description" ,  QVariant(QString, "") ) ( "extra_data" ,  QVariant(QVariantMap, QMap() ) ) ( "id" ,  QVariant(qulonglong, 121512) ) ( "issue_dropped_count" ,  QVariant(qulonglong, 0) ) ( "issue_open_count" ,  QVariant(qulonglong, 0) ) ( "issue_resolved_count" ,  QVariant(qulonglong, 0) ) ( "last_updated" ,  QVariant(QString, "2014-12-14T15:31:42Z") ) ( "links" ,  QVariant(QVariantMap, QMap(("changes", QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/changes/") ) ( "method" ,  QVariant(QString, "GET") ) )  ) ) ( "delete" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/") ) ( "method" ,  QVariant(QString, "DELETE") ) )  ) ) ( "diff_context" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/diff-context/") ) ( "method" ,  QVariant(QString, "GET") ) )  ) ) ( "diffs" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/diffs/") ) ( "method" ,  QVariant(QString, "GET") ) )  ) ) ( "draft" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/draft/") ) ( "method" ,  QVariant(QString, "GET") ) )  ) ) ( "file_attachments" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/file-attachments/") ) ( "method" ,  QVariant(QString, "GET") ) )  ) ) ( "last_update" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/last-update/") ) ( "method" ,  QVariant(QString, "GET") ) )  ) ) ( "repository" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/repositories/147/") ) ( "method" ,  QVariant(QString, "GET") ) ( "title" ,  QVariant(QString, "kde-runtime") ) )  ) ) ( "reviews" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/reviews/") ) ( "method" ,  QVariant(QString, "GET") ) )  ) ) ( "screenshots" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/screenshots/") ) ( "method" ,  QVariant(QString, "GET") ) )  ) ) ( "self" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/") ) ( "method" ,  QVariant(QString, "GET") ) )  ) ) ( "submitter" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/users/rjvbb/") ) ( "method" ,  QVariant(QString, "GET") ) ( "title" ,  QVariant(QString, "rjvbb") ) )  ) ) ( "update" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121512/") ) ( "method" ,  QVariant(QString, "PUT") ) )  ) ) )  ) ) ( "public" ,  QVariant(bool, false) ) ( "ship_it_count" ,  QVariant(qulonglong, 0) ) ( "status" ,  QVariant(QString, "pending") ) ( "summary" ,  QVariant(QString, "") ) ( "target_groups" ,  QVariant(QVariantList, () ) ) ( "target_people" ,  QVariant(QVariantList, () ) ) ( "testing_done" ,  QVariant(QString, "") ) ( "text_type" ,  QVariant(QString, "plain") ) ( "time_added" ,  QVariant(QString, "2014-12-14T15:31:42Z") ) ( "url" ,  QVariant(QString, "/r/121512/") ) )  ) ) ( "stat" ,  QVariant(QString, "ok") ) )  ) 
starting...  QUrl( "https://rjvbb:*@git.reviewboard.kde.org/api/review-requests/121512/diffs/" )  "------------N0clMOO5RMsJtavLKAno2gc1FvLfEGLxcL8k969DSnLC6KWt1nYwyFA
Content-Disposition: form-data; name="basedir"

/
------------N0clMOO5RMsJtavLKAno2gc1FvLfEGLxcL8k969DSnLC6KWt1nYwyFA
Content-Disposition: form-data; name="path"; filename="kdevelopV966442.patch"
Content-Type: text/x-patch

diff --git kioexec/main.cpp kioexec/main.cpp
index 06cd8f3..699e94f 100644
--- kioexec/main.cpp
+++ kioexec/main.cpp
@@ -21,6 +21,17 @@
 <SNIP>
------------N0clMOO5RMsJtavLKAno2gc1FvLfEGLxcL8k969DSnLC6KWt1nYwyFA--
" 
parsing... "{"fields": {"path": ["list index out of range"]}, "stat": "fail", "err": {"msg": "One or more fields had errors", "code": 105}}" 
parsing result= QVariant(QVariantMap, QMap(("err", QVariant(QVariantMap, QMap(("code", QVariant(qulonglong, 105) ) ( "msg" ,  QVariant(QString, "One or more fields had errors") ) )  ) ) ( "fields" ,  QVariant(QVariantMap, QMap(("path", QVariant(QVariantList, (QVariant(QString, "list index out of range") )  ) ) )  ) ) ( "stat" ,  QVariant(QString, "fail") ) )  ) 
Could not upload the patch "Request Error: One or more fields had errors" 
```
Comment 2 RJVB 2014-12-14 16:19:23 UTC
Similar output generated with KDevelop 4.90.90 (KF5):

```
starting... regurl=  QUrl( "https://rjvbb@git.reviewboard.kde.org/api/review-requests/" )  post= "repository=/repositories/kwallet.git/"
content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem.
parsing... "{"stat": "ok", "review_request": {"status": "pending", "last_updated": "2014-12-14T16:16:06Z", "links": {"diffs": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/diffs/", "method": "GET"}, "repository": {"href": "https://git.reviewboard.kde.org/api/repositories/608/", "method": "GET", "title": "kwallet"}, "screenshots": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/screenshots/", "method": "GET"}, "self": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/", "method": "GET"}, "update": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/", "method": "PUT"}, "last_update": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/last-update/", "method": "GET"}, "reviews": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/reviews/", "method": "GET"}, "file_attachments": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/file-attachments/", "method": "GET"}, "draft": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/draft/", "method": "GET"}, "diff_context": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/diff-context/", "method": "GET"}, "submitter": {"href": "https://git.reviewboard.kde.org/api/users/rjvbb/", "method": "GET", "title": "rjvbb"}, "changes": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/changes/", "method": "GET"}, "delete": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/", "method": "DELETE"}}, "depends_on": [], "issue_resolved_count": 0, "ship_it_count": 0, "id": 121513, "description": "", "target_people": [], "changenum": null, "bugs_closed": [], "testing_done": "", "branch": "", "time_added": "2014-12-14T16:16:06Z", "extra_data": {}, "public": false, "commit_id": null, "blocks": [], "close_description": null, "text_type": "plain", "issue_open_count": 0, "approved": false, "url": "/r/121513/", "absolute_url": "https://git.reviewboard.kde.org/r/121513/", "target_groups": [], "summary": "", "issue_dropped_count": 0, "approval_failure": "The review request has not been marked \"Ship It!\""}}"
parsing result= QVariant(QVariantMap, QMap(("review_request", QVariant(QVariantMap, QMap(("absolute_url", QVariant(QString, "https://git.reviewboard.kde.org/r/121513/") ) ( "approval_failure" ,  QVariant(QString, "The review request has not been marked "Ship It!"") ) ( "approved" ,  QVariant(bool, false) ) ( "blocks" ,  QVariant(QVariantList, ()) ) ( "branch" ,  QVariant(QString, "") ) ( "bugs_closed" ,  QVariant(QVariantList, ()) ) ( "changenum" ,  QVariant(Invalid) ) ( "close_description" ,  QVariant(Invalid) ) ( "commit_id" ,  QVariant(Invalid) ) ( "depends_on" ,  QVariant(QVariantList, ()) ) ( "description" ,  QVariant(QString, "") ) ( "extra_data" ,  QVariant(QVariantMap, QMap()) ) ( "id" ,  QVariant(double, 121513) ) ( "issue_dropped_count" ,  QVariant(double, 0) ) ( "issue_open_count" ,  QVariant(double, 0) ) ( "issue_resolved_count" ,  QVariant(double, 0) ) ( "last_updated" ,  QVariant(QString, "2014-12-14T16:16:06Z") ) ( "links" ,  QVariant(QVariantMap, QMap(("changes", QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/changes/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "delete" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/") ) ( "method" ,  QVariant(QString, "DELETE") ) ) ) ) ( "diff_context" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/diff-context/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "diffs" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/diffs/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "draft" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/draft/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "file_attachments" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/file-attachments/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "last_update" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/last-update/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "repository" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/repositories/608/") ) ( "method" ,  QVariant(QString, "GET") ) ( "title" ,  QVariant(QString, "kwallet") ) ) ) ) ( "reviews" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/reviews/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "screenshots" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/screenshots/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "self" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "submitter" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/users/rjvbb/") ) ( "method" ,  QVariant(QString, "GET") ) ( "title" ,  QVariant(QString, "rjvbb") ) ) ) ) ( "update" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/") ) ( "method" ,  QVariant(QString, "PUT") ) ) ) ) ) ) ) ( "public" ,  QVariant(bool, false) ) ( "ship_it_count" ,  QVariant(double, 0) ) ( "status" ,  QVariant(QString, "pending") ) ( "summary" ,  QVariant(QString, "") ) ( "target_groups" ,  QVariant(QVariantList, ()) ) ( "target_people" ,  QVariant(QVariantList, ()) ) ( "testing_done" ,  QVariant(QString, "") ) ( "text_type" ,  QVariant(QString, "plain") ) ( "time_added" ,  QVariant(QString, "2014-12-14T16:16:06Z") ) ( "url" ,  QVariant(QString, "/r/121513/") ) ) ) ) ( "stat" ,  QVariant(QString, "ok") ) ) )
starting... regurl=  QUrl( "https://rjvbb@git.reviewboard.kde.org/api/review-requests/121513/diffs/" )  post= "------------WfFAsLiZNneEbckVuaRD8YbtVVupfxMBcZKSv21IneUOEFs8nJJvrto
Content-Disposition: form-data; name="basedir"

/
------------WfFAsLiZNneEbckVuaRD8YbtVVupfxMBcZKSv21IneUOEFs8nJJvrto
Content-Disposition: form-data; name="path"; filename="kdevelop_k18637.patch"
Content-Type: text/x-patch

diff --git a/tests/KWallet/kwallettest.h b/tests/KWallet/kwallettest.h
index 2936ac1..b42a5fe 100644
--- a/tests/KWallet/kwallettest.h
+++ b/tests/KWallet/kwallettest.h
@@ -33,6 +33,8 @@ public:
<SNIP>
------------WfFAsLiZNneEbckVuaRD8YbtVVupfxMBcZKSv21IneUOEFs8nJJvrto--
"
parsing... "{"diff": {"name": "kdevelop_k18637.patch", "links": {"self": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/draft/diffs/1/", "method": "GET"}, "draft_files": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/draft/diffs/1/files/", "method": "GET"}, "update": {"href": "https://git.reviewboard.kde.org/api/review-requests/121513/draft/diffs/1/", "method": "PUT"}, "repository": {"href": "https://git.reviewboard.kde.org/api/repositories/608/", "method": "GET", "title": "kwallet"}}, "timestamp": "2014-12-14T16:16:10Z", "basedir": "", "extra_data": {}, "revision": 1, "id": 35642, "base_commit_id": null}, "stat": "ok"}"
parsing result= QVariant(QVariantMap, QMap(("diff", QVariant(QVariantMap, QMap(("base_commit_id", QVariant(Invalid) ) ( "basedir" ,  QVariant(QString, "") ) ( "extra_data" ,  QVariant(QVariantMap, QMap()) ) ( "id" ,  QVariant(double, 35642) ) ( "links" ,  QVariant(QVariantMap, QMap(("draft_files", QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/draft/diffs/1/files/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "repository" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/repositories/608/") ) ( "method" ,  QVariant(QString, "GET") ) ( "title" ,  QVariant(QString, "kwallet") ) ) ) ) ( "self" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/draft/diffs/1/") ) ( "method" ,  QVariant(QString, "GET") ) ) ) ) ( "update" ,  QVariant(QVariantMap, QMap(("href", QVariant(QString, "https://git.reviewboard.kde.org/api/review-requests/121513/draft/diffs/1/") ) ( "method" ,  QVariant(QString, "PUT") ) ) ) ) ) ) ) ( "name" ,  QVariant(QString, "kdevelop_k18637.patch") ) ( "revision" ,  QVariant(double, 1) ) ( "timestamp" ,  QVariant(QString, "2014-12-14T16:16:10Z") ) ) ) ) ( "stat" ,  QVariant(QString, "ok") ) ) )

```
Comment 3 RJVB 2014-12-14 17:20:18 UTC
When I remove the patchfile just before validating the RR upload dialog, its contents do not show up in the trace printed on the terminal (meaning they aren't cached and there's apparently a true file upload being done), and the result becomes (before parsing):

> parsing... "{"fields": {"path": ["The submitted file is empty."]}, "stat": "fail", "err": {"msg": "One or more fields had errors", "code": 105}}" 

That's a logical error that I think also means that authentification works fine.
Comment 4 Aleix Pol 2014-12-16 02:01:13 UTC
To be honest I'm unsure of what's going on, in principle the output looks fine and then it doesn't work. I just uploaded a review request using kdevelop [1] and it just worked. Maybe the patch has a bad format? Have you tried to submit it separately?

[1] https://git.reviewboard.kde.org/r/121545/
Comment 5 RJVB 2014-12-16 10:12:51 UTC
Are you saying that it sometimes works for you, and sometimes it doesn't?

Also, did you create that RR with kdevelop "5", which seems not unlikely given how it's about a KF5 project?

I'll try to re-upload the last patch I uploaded to a new RR, and see what gives...
Comment 6 RJVB 2014-12-16 10:22:11 UTC
In fact, reviewboard was never snappy for me when doing things manually, but now it's exceedingly slow. Could that be related somehow? I don't know what happens "below" kdevelop when you hit that upload button, but between kdelibs, KJob, QUrl etc. maybe something has changed between KDE4 and KF5 that takes kinder to delays, timeouts etc?
Comment 7 RJVB 2014-12-16 10:22:56 UTC
(grr, I keep posting too soon...) 
Have you retried restarting the reviewboard website?!
Comment 8 RJVB 2014-12-16 11:17:01 UTC
It's getting weirder.

Transcript. Created using my Kubuntu 14.04 slowboat.

So I went to my last RR (https://git.reviewboard.kde.org/r/121477/), downloaded the diff and compared it to a fresh diff made from my local working copy. No changes.

Imported the working copy as a project in a new session in kdevelop 4.7 (i.e. under Linux). Upload to RB still doesn't work. So I tried uploading it manually through the site.

- first, the dialog wouldn't show the file I selected through the file selector.
- I deactivated Privoxy (which has never caused trouble here), and reloaded the RR
- tried the upload dialog again, this time the file "stuck", but upload gave me a familiar error:
"One or more fields had errors" and "list index out of range" next to the filename
- I reactivated Privoxy, reloaded the RR and tried the upload once more: same result

That was all with Google Chrome. Decided I'd try with Opera 12, which allows me to bypass the system proxy (which was hard enough to configure for the various desktop layers in Kubuntu)
- Switched off the proxy in the Quick Settings, and "send referrer info" back on
- Tried to upload - same error(s).

Finally, I opened the  project in my Neon5 kdevelop 4.90.90 . That worked.

And that showed me the error.
Comment 9 RJVB 2014-12-16 11:25:08 UTC
Here's the unified diff between patchfiles saved from KDevelop 4.7 patchreview and KDevelop 4.90.90 patchreview:

```
--- kioexec-kdev470.patch       2014-12-16 11:24:46.000000000 +0100
+++ kioexec-kdev49090.patch     2014-12-16 12:11:25.000000000 +0100
@@ -1,7 +1,7 @@
-diff --git kioexec/main.cpp kioexec/main.cpp
+diff --git a/kioexec/main.cpp b/kioexec/main.cpp
 index 06cd8f3..699e94f 100644
---- kioexec/main.cpp
-+++ kioexec/main.cpp
+--- a/kioexec/main.cpp
++++ b/kioexec/main.cpp
 @@ -21,6 +21,17 @@
  
  #include "main.h"
```

In short, ReviewBoard now apparently requires -p1 patches, while KDevelop 4.7 continues to make -p0 patches. That server change apparently became effective last Saturday shortly after 21:48 Europe/Paris time.
Manual upload of the -p1 patch works, and I presume that editing a KDevelop 4.7 patch to be -p1 before uploading it will cause the upload to succeed too (haven't tried that yet).

Is that a concious/voluntary change? I must say that p0 patches KDevelop generates have been very useful to me, so I'd regret having to "upgrade" to a p1 patch generation feature ...
Comment 10 Aleix Pol 2014-12-16 11:38:28 UTC
I feared it would be this as well. I'm unsure how to get that fixed to be honest, as it needs changes in the kompare library we are using and I doubt it will see a new kde4 release.
Comment 11 RJVB 2014-12-16 12:26:42 UTC
The least problematic (=/= easiest?) solution would be to let ReviewBoard accept both types of patches.
Other than that, if the required code changes are to libkompare, they'd be bug fixes, which can still be committed without need for a new release. It could even take the form of an "official" patch that can then be applied by distribution devs. They'd have to take over "evolutionary maintenance" at some point anyway, if they decide to continue to provide support to KDE4 set-ups.
Comment 12 Aleix Pol 2014-12-16 12:28:16 UTC
Well I see it as a new feature, but feel free to see about p1 patches support in kompare.
Comment 13 Aleix Pol 2014-12-17 02:04:30 UTC
FWIW, I just noticed that libkomparediff2 [1] also needs the support for p1 patches (actually I think it's just understanding the a/ and b/ prefixes in the paths), so it would probably make sense just to add it over there and then remove the --no-prefix over there.

[1] https://projects.kde.org/projects/kde/kdesdk/libkomparediff2
Comment 14 RJVB 2014-12-17 09:25:44 UTC
I have the impression that libkompare just does what it's asked, and that the p0 patches are indeed the result of invoking `git diff --no-prefix`. I removed that option from the invocation in the git plugin, and everything worked again. No need to meddle with the patch source depth, baseDir or what else (in fact, those had no effect).

Question is of course how this translates to the other versioning flavours ...
Comment 15 RJVB 2014-12-31 18:06:09 UTC
Git commit f1b7c7bafc0b3a9a41838395bf6a21dd184a06b1 by René J.V. Bertin.
Committed on 31/12/2014 at 18:05.
Pushed by rjvbb into branch '1.7'.

Restore upload functionality to git.reviewboard.kde.org
REVIEW:121586

M  +8    -2    plugins/git/gitplugin.cpp
M  +14   -0    plugins/git/gitplugin.h
M  +1    -0    plugins/patchreview/patchreview.cpp
M  +1    -1    plugins/reviewboard/reviewboardjobs.cpp
M  +1    -0    plugins/reviewboard/reviewboardplugin.cpp
M  +14   -29   vcs/vcsdiff.cpp
M  +9    -3    vcs/vcsdiff.h
M  +6    -1    vcs/widgets/vcsdiffpatchsources.cpp
M  +3    -0    vcs/widgets/vcsdiffpatchsources.h

http://commits.kde.org/kdevplatform/f1b7c7bafc0b3a9a41838395bf6a21dd184a06b1