<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[218987] trunk/Websites/perf.webkit.org</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/218987">218987</a></dd>
<dt>Author</dt> <dd>rniwa@webkit.org</dd>
<dt>Date</dt> <dd>2017-06-29 21:43:00 -0700 (Thu, 29 Jun 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>UploadedFile should include the file extension in its url
https://bugs.webkit.org/show_bug.cgi?id=174009

Reviewed by Chris Dumez.

Some command line tools such as darwinup use the file extension to determine the file type.
Include the file extension in the URL of an uploaded file to make it work with these tools.

* public/include/uploaded-file-helpers.php:
(format_uploaded_file): Include the file extension.
* public/v3/models/uploaded-file.js:
(UploadedFile):
(UploadedFile.prototype.url): Return the URL with hthe file extension specified. /api/uploaded-file
already supports having the file extension specified.
* server-tests/tools-sync-buildbot-integration-tests.js: Updated test cases.
* unit-tests/buildbot-syncer-tests.js: Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsitesperfwebkitorgChangeLog">trunk/Websites/perf.webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicincludeuploadedfilehelpersphp">trunk/Websites/perf.webkit.org/public/include/uploaded-file-helpers.php</a></li>
<li><a href="#trunkWebsitesperfwebkitorgpublicv3modelsuploadedfilejs">trunk/Websites/perf.webkit.org/public/v3/models/uploaded-file.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgserverteststoolssyncbuildbotintegrationtestsjs">trunk/Websites/perf.webkit.org/server-tests/tools-sync-buildbot-integration-tests.js</a></li>
<li><a href="#trunkWebsitesperfwebkitorgunittestsbuildbotsyncertestsjs">trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebsitesperfwebkitorgChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/ChangeLog (218986 => 218987)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/ChangeLog 2017-06-30 03:43:25 UTC (rev 218986)
+++ trunk/Websites/perf.webkit.org/ChangeLog    2017-06-30 04:43:00 UTC (rev 218987)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2017-06-29  Ryosuke Niwa  <rniwa@webkit.org>
+
+        UploadedFile should include the file extension in its url
+        https://bugs.webkit.org/show_bug.cgi?id=174009
+
+        Reviewed by Chris Dumez.
+
+        Some command line tools such as darwinup use the file extension to determine the file type.
+        Include the file extension in the URL of an uploaded file to make it work with these tools.
+
+        * public/include/uploaded-file-helpers.php:
+        (format_uploaded_file): Include the file extension.
+        * public/v3/models/uploaded-file.js:
+        (UploadedFile):
+        (UploadedFile.prototype.url): Return the URL with hthe file extension specified. /api/uploaded-file
+        already supports having the file extension specified.
+        * server-tests/tools-sync-buildbot-integration-tests.js: Updated test cases.
+        * unit-tests/buildbot-syncer-tests.js: Ditto.
+
</ins><span class="cx"> 2017-05-31  Ryosuke Niwa  <rniwa@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Don't shouldn't create a request to build a patch if there is no patch to build
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicincludeuploadedfilehelpersphp"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/include/uploaded-file-helpers.php (218986 => 218987)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/include/uploaded-file-helpers.php  2017-06-30 03:43:25 UTC (rev 218986)
+++ trunk/Websites/perf.webkit.org/public/include/uploaded-file-helpers.php     2017-06-30 04:43:00 UTC (rev 218987)
</span><span class="lines">@@ -10,6 +10,7 @@
</span><span class="cx">         'createdAt' => Database::to_js_time($file_row['file_created_at']),
</span><span class="cx">         'mime' => $file_row['file_mime'],
</span><span class="cx">         'filename' => $file_row['file_filename'],
</span><ins>+        'extension' => $file_row['file_extension'],
</ins><span class="cx">         'author' => $file_row['file_author'],
</span><span class="cx">         'sha256' => $file_row['file_sha256']);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgpublicv3modelsuploadedfilejs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/public/v3/models/uploaded-file.js (218986 => 218987)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/public/v3/models/uploaded-file.js 2017-06-30 03:43:25 UTC (rev 218986)
+++ trunk/Websites/perf.webkit.org/public/v3/models/uploaded-file.js    2017-06-30 04:43:00 UTC (rev 218987)
</span><span class="lines">@@ -7,6 +7,7 @@
</span><span class="cx">         this._createdAt = new Date(object.createdAt);
</span><span class="cx">         this._deletedAt = object.deletedAt ? new Date(object.deletedAt) : null;
</span><span class="cx">         this._filename = object.filename;
</span><ins>+        this._extension = object.extension;
</ins><span class="cx">         this._author = object.author;
</span><span class="cx">         this._size = object.size;
</span><span class="cx">         this._sha256 = object.sha256;
</span><span class="lines">@@ -19,7 +20,7 @@
</span><span class="cx">     author() { return this._author; }
</span><span class="cx">     size() { return this._size; }
</span><span class="cx">     label() { return this.filename(); }
</span><del>-    url() { return RemoteAPI.url(`/api/uploaded-file/${this.id()}`); }
</del><ins>+    url() { return RemoteAPI.url(`/api/uploaded-file/${this.id()}${this._extension}`); }
</ins><span class="cx"> 
</span><span class="cx">     static uploadFile(file, uploadProgressCallback = null)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgserverteststoolssyncbuildbotintegrationtestsjs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/server-tests/tools-sync-buildbot-integration-tests.js (218986 => 218987)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/server-tests/tools-sync-buildbot-integration-tests.js     2017-06-30 03:43:25 UTC (rev 218986)
+++ trunk/Websites/perf.webkit.org/server-tests/tools-sync-buildbot-integration-tests.js        2017-06-30 04:43:00 UTC (rev 218987)
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx">         }).then(() => {
</span><span class="cx">             assert.equal(requests.length, 7);
</span><span class="cx">             assertAndResolveRequest(requests[6], 'POST', '/builders/some%20builder/force', 'OK');
</span><del>-            assert.deepEqual(requests[6].data, {'wk': '191622', 'wk-patch': RemoteAPI.url('/api/uploaded-file/1'),
</del><ins>+            assert.deepEqual(requests[6].data, {'wk': '191622', 'wk-patch': RemoteAPI.url('/api/uploaded-file/1.dat'),
</ins><span class="cx">                 'build-request-id': '1', 'forcescheduler': 'force-ab-builds'});
</span><span class="cx">             return MockRemoteAPI.waitForRequest();
</span><span class="cx">         }).then(() => {
</span></span></pre></div>
<a id="trunkWebsitesperfwebkitorgunittestsbuildbotsyncertestsjs"></a>
<div class="modfile"><h4>Modified: trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js (218986 => 218987)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js       2017-06-30 03:43:25 UTC (rev 218986)
+++ trunk/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js  2017-06-30 04:43:00 UTC (rev 218987)
</span><span class="lines">@@ -229,10 +229,10 @@
</span><span class="cx">     const shared111237 = CommitLog.ensureSingleton('111237', {'id': '111237', 'time': 1456931874000, 'repository': MockModels.sharedRepository, 'revision': '80229'});
</span><span class="cx">     const ios13A452 = CommitLog.ensureSingleton('88930', {'id': '88930', 'time': 0, 'repository': MockModels.ios, 'revision': '13A452'});
</span><span class="cx"> 
</span><del>-    const patch = new UploadedFile(453, {'createdAt': new Date('2017-05-01T19:16:53Z'), 'filename': 'patch.dat', 'author': 'some user',
</del><ins>+    const patch = new UploadedFile(453, {'createdAt': new Date('2017-05-01T19:16:53Z'), 'filename': 'patch.dat', 'extension': '.dat', 'author': 'some user',
</ins><span class="cx">         size: 534637, sha256: '169463c8125e07c577110fe144ecd63942eb9472d438fc0014f474245e5df8a1'});
</span><span class="cx"> 
</span><del>-    const root = new UploadedFile(456, {'createdAt': new Date('2017-05-01T21:03:27Z'), 'filename': 'root.dat', 'author': 'some user',
</del><ins>+    const root = new UploadedFile(456, {'createdAt': new Date('2017-05-01T21:03:27Z'), 'filename': 'root.dat', 'extension': '.dat', 'author': 'some user',
</ins><span class="cx">         size: 16452234, sha256: '03eed7a8494ab8794c44b7d4308e55448fc56f4d6c175809ba968f78f656d58d'});
</span><span class="cx"> 
</span><span class="cx">     const commitSet = CommitSet.ensureSingleton('53246456', {customRoots: [root], revisionItems: [{commit: webkit197463, patch}, {commit: shared111237}, {commit: ios13A452}]});
</span><span class="lines">@@ -975,7 +975,7 @@
</span><span class="cx">             const request = createSampleBuildRequestWithPatch(MockModels.iphone, null, -1);
</span><span class="cx">             const properties = syncers[2]._propertiesForBuildRequest(request, [request]);
</span><span class="cx">             assert.equal(properties['webkit'], '197463');
</span><del>-            assert.equal(properties['webkit-patch'], 'http://build.webkit.org/api/uploaded-file/453');
</del><ins>+            assert.equal(properties['webkit-patch'], 'http://build.webkit.org/api/uploaded-file/453.dat');
</ins><span class="cx">         });
</span><span class="cx"> 
</span><span class="cx">         it('should resolve "ifBuilt"', () => {
</span><span class="lines">@@ -996,16 +996,16 @@
</span><span class="cx">             const requestToBuild = createSampleBuildRequestWithPatch(MockModels.iphone, null, -1);
</span><span class="cx">             const requestToTest = createSampleBuildRequestWithPatch(MockModels.iphone, MockModels.speedometer, 0);
</span><span class="cx">             const otherRequestToTest = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
</span><del>-    
</del><ins>+
</ins><span class="cx">             let properties = syncers[0]._propertiesForBuildRequest(requestToTest, [requestToTest]);
</span><span class="cx">             assert.equal(properties['webkit'], '197463');
</span><del>-            assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456"}]');
</del><ins>+            assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456.dat"}]');
</ins><span class="cx">             assert.equal(properties['test-custom-build'], undefined);
</span><span class="cx">             assert.equal(properties['has-built-patch'], undefined);
</span><span class="cx"> 
</span><span class="cx">             properties = syncers[0]._propertiesForBuildRequest(requestToTest, [requestToBuild, requestToTest]);
</span><span class="cx">             assert.equal(properties['webkit'], '197463');
</span><del>-            assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456"}]');
</del><ins>+            assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456.dat"}]');
</ins><span class="cx">             assert.equal(properties['test-custom-build'], '');
</span><span class="cx">             assert.equal(properties['has-built-patch'], 'true');
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>