Changeset 212947 in webkit
- Timestamp:
- Feb 23, 2017 11:17:48 PM (7 years ago)
- Location:
- trunk/Websites/perf.webkit.org
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/perf.webkit.org/ChangeLog
r212946 r212947 1 2017-02-23 Dewei Zhu <dewei_zhu@apple.com> 2 3 Rename 'commit_parent' in 'commits' table to 'commit_previous_commit'. 4 https://bugs.webkit.org/show_bug.cgi?id=168816 5 6 Reviewed by Ryosuke Niwa. 7 8 Rename 'commit_parent' to avoid ambiguity in the coming feature. 9 For exisiting database, run 10 "ALTER TABLE commits RENAME commit_parent TO commit_previous_commit;" 11 to update the database. 12 13 * init-database.sql: 14 * public/api/report-commits.php: 15 * public/include/commit-log-fetcher.php: 16 * server-tests/api-commits.js: 17 (then): 18 * server-tests/api-report-commits-tests.js: 19 (then): 20 * tools/sync-commits.py: 21 (main): 22 (Repository.fetch_commits_and_submit): 23 (GitRepository._revision_from_tokens): 24 * unit-tests/analysis-task-tests.js: 25 (sampleAnalysisTask): 26 1 27 2017-02-23 Ryosuke Niwa <rniwa@webkit.org> 2 28 -
trunk/Websites/perf.webkit.org/init-database.sql
r202001 r212947 89 89 commit_repository integer NOT NULL REFERENCES repositories ON DELETE CASCADE, 90 90 commit_revision varchar(64) NOT NULL, 91 commit_p arent integer REFERENCES commits ON DELETE CASCADE,91 commit_previous_commit integer REFERENCES commits ON DELETE CASCADE, 92 92 commit_time timestamp, 93 93 commit_order integer, … … 262 262 request_created_at timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'), 263 263 CONSTRAINT build_request_order_must_be_unique_in_group UNIQUE(request_group, request_order)); 264 CREATE INDEX build_request_triggerable ON build_requests(request_triggerable); 264 CREATE INDEX build_request_triggerable ON build_requests(request_triggerable); 265 265 CREATE INDEX build_request_build ON build_requests(request_build); -
trunk/Websites/perf.webkit.org/public/api/report-commits.php
r194088 r212947 48 48 } 49 49 50 $p arent_revision = array_get($commit_info, 'parent');51 $p arent_id = NULL;52 if ($p arent_revision) {53 $p arent_commit = $db->select_first_row('commits', 'commit', array('repository' => $repository_id, 'revision' => $parent_revision));54 if (!$p arent_commit) {50 $previous_commit_revision = array_get($commit_info, 'previousCommit'); 51 $previous_commit_id = NULL; 52 if ($previous_commit_revision) { 53 $previous_commit = $db->select_first_row('commits', 'commit', array('repository' => $repository_id, 'revision' => $previous_commit_revision)); 54 if (!$previous_commit) { 55 55 $db->rollback_transaction(); 56 exit_with_error('FailedToFindP arentCommit', array('commit' => $commit_info));56 exit_with_error('FailedToFindPreviousCommit', array('commit' => $commit_info)); 57 57 } 58 $p arent_id = $parent_commit['commit_id'];58 $previous_commit_id = $previous_commit['commit_id']; 59 59 } 60 60 … … 62 62 'repository' => $repository_id, 63 63 'revision' => $commit_info['revision'], 64 'p arent' => $parent_id,64 'previous_commit' => $previous_commit_id, 65 65 'order' => array_get($commit_info, 'order'), 66 66 'time' => array_get($commit_info, 'time'), -
trunk/Websites/perf.webkit.org/public/include/commit-log-fetcher.php
r210981 r212947 37 37 $statements = 'SELECT commit_id as "id", 38 38 commit_revision as "revision", 39 commit_p arent as "parent",39 commit_previous_commit as "previousCommit", 40 40 commit_time as "time", 41 41 committer_name as "authorName", … … 122 122 'id' => $commit_row['commit_id'], 123 123 'revision' => $commit_row['commit_revision'], 124 'p arent' => $commit_row['commit_parent'],124 'previousCommit' => $commit_row['commit_previous_commit'], 125 125 'time' => Database::to_js_time($commit_row['commit_time']), 126 126 'order' => $commit_row['commit_order'], -
trunk/Websites/perf.webkit.org/server-tests/api-commits.js
r210981 r212947 31 31 { 32 32 "repository": "WebKit", 33 "p arent": "210949",33 "previousCommit": "210949", 34 34 "revision": "210950", 35 35 "time": "2017-01-20T03:49:37.887Z", … … 52 52 assert.equal(commit['authorName'], submitted['author']['name']); 53 53 assert.equal(commit['authorEmail'], submitted['author']['account']); 54 if(submitted['previousCommit']) { 55 assert.ok(commit['previousCommit']); 56 } else { 57 assert.equal(commit['previousCommit'], null); 58 } 54 59 } 55 60 … … 89 94 assertCommitIsSameAsOneSubmitted(commits[1], submittedCommits[1]); 90 95 assertCommitIsSameAsOneSubmitted(commits[2], submittedCommits[2]); 91 }); 92 }); 96 assert.equal(commits[2]['previousCommit'], commits[1]['id']); 97 }); 98 }); 93 99 }); 94 100 … … 231 237 assert.equal(result['commits'].length, 1); 232 238 assertCommitIsSameAsOneSubmitted(result['commits'][0], { 233 p arent: null,239 previousCommit: null, 234 240 revision: '210950', 235 241 time: '2017-01-20T03:49:37.887Z', … … 300 306 assert.deepEqual(result['commits'].length, 2); 301 307 assertCommitIsSameAsOneSubmitted(result['commits'][0], { 302 p arent: null,308 previousCommit: null, 303 309 revision: '210949', 304 310 time: '2017-01-20T03:23:50.645Z', … … 307 313 }); 308 314 assertCommitIsSameAsOneSubmitted(result['commits'][1], { 309 p arent: null,315 previousCommit: null, 310 316 revision: '210950', 311 317 time: '2017-01-20T03:49:37.887Z', -
trunk/Websites/perf.webkit.org/server-tests/api-report-commits-tests.js
r201718 r212947 55 55 { 56 56 "repository": "WebKit", 57 "p arent": "141977",57 "previousCommit": "141977", 58 58 "revision": "141978", 59 59 "time": "2013-02-06T09:54:56.0Z", 60 60 "author": {"name": "Mikhail Pozdnyakov", "account": "mikhail.pozdnyakov@intel.com"}, 61 61 "message": "another message", 62 } 63 ] 64 }; 65 66 const subversionInvalidPreviousCommit = { 67 "slaveName": "someSlave", 68 "slavePassword": "somePassword", 69 "commits": [ 70 { 71 "repository": "WebKit", 72 "previousCommit": "99999", 73 "revision": "12345", 74 "time": "2013-02-06T08:55:20.9Z", 75 "author": {"name": "Commit Queue", "account": "commit-queue@webkit.org"}, 76 "message": "some message", 62 77 } 63 78 ] … … 159 174 assert.equal(commits[0]['message'], reportedData['message']); 160 175 assert.equal(commits[0]['committer'], committers[0]['id']); 176 assert.equal(commits[0]['previous_commit'], null); 161 177 assert.equal(committers[0]['name'], reportedData['author']['name']); 162 178 assert.equal(committers[0]['account'], reportedData['author']['account']); … … 167 183 assert.equal(commits[1]['message'], reportedData['message']); 168 184 assert.equal(commits[1]['committer'], committers[1]['id']); 185 assert.equal(commits[1]['previous_commit'], commits[0]['id']); 169 186 assert.equal(committers[1]['name'], reportedData['author']['name']); 170 187 assert.equal(committers[1]['account'], reportedData['author']['account']); 171 188 189 done(); 190 }).catch(done); 191 }); 192 193 it("should fail if previous commit is invalid", function (done) { 194 const db = TestServer.database(); 195 addSlaveForReport(subversionInvalidPreviousCommit).then(function () { 196 return TestServer.remoteAPI().postJSON('/api/report-commits/', subversionInvalidPreviousCommit); 197 }).then(function (response) { 198 assert.equal(response['status'], 'FailedToFindPreviousCommit'); 199 return db.selectAll('commits'); 200 }).then(function (result) { 201 assert.equal(result.length, 0); 172 202 done(); 173 203 }).catch(done); … … 228 258 assert.equal(committers[0]['name'], firstData['author']['name']); 229 259 assert.equal(committers[0]['account'], firstData['author']['account']); 230 260 231 261 assert.equal(commits[1]['id'], 3); 232 262 assert.equal(commits[1]['message'], null); -
trunk/Websites/perf.webkit.org/tools/sync-commits.py
r210982 r212947 24 24 parser.add_argument('--seconds-to-sleep', type=float, default=900, help='The seconds to sleep between iterations') 25 25 parser.add_argument('--max-fetch-count', type=int, default=10, help='The number of commits to fetch at once') 26 parser.add_argument('--max-ancestor-fetch-count', type=int, default=100, help='The number of commits to fetch at once if some commits are missing p arents')26 parser.add_argument('--max-ancestor-fetch-count', type=int, default=100, help='The number of commits to fetch at once if some commits are missing previous commits') 27 27 args = parser.parse_args() 28 28 … … 80 80 81 81 result = submit_commits(pending_commits, server_config['server']['url'], 82 server_config['slave']['name'], server_config['slave']['password'], ['OK', 'FailedToFindP arentCommit'])82 server_config['slave']['name'], server_config['slave']['password'], ['OK', 'FailedToFindPreviousCommit']) 83 83 84 84 if result.get('status') == 'OK': 85 85 break 86 86 87 if result.get('status') == 'FailedToFindP arentCommit':88 p arent_commit = self.fetch_commit(server_config, result['commit']['parent'])89 if not p arent_commit:90 raise Exception('Could not find the p arent %s of %s' % (result['commit']['parent'], result['commit']['revision']))91 pending_commits = [p arent_commit] + pending_commits87 if result.get('status') == 'FailedToFindPreviousCommit': 88 previous_commit = self.fetch_commit(server_config, result['commit']['previousCommit']) 89 if not previous_commit: 90 raise Exception('Could not find the previous commit %s of %s' % (result['commit']['previousCommit'], result['commit']['revision'])) 91 pending_commits = [previous_commit] + pending_commits 92 92 93 93 if result.get('status') != 'OK': … … 224 224 commit_time = int(tokens[1]) 225 225 author_email = tokens[2] 226 p arent_hash = tokens[3] if len(tokens) >= 4 else None226 previous_hash = tokens[3] if len(tokens) >= 4 else None 227 227 228 228 author_name = self._run_git_command(['log', current_hash, '-1', '--pretty=%cn']) … … 232 232 'repository': self._name, 233 233 'revision': current_hash, 234 'p arent': parent_hash,234 'previousCommit': previous_hash, 235 235 'time': datetime.fromtimestamp(commit_time).strftime(r'%Y-%m-%dT%H:%M:%S.%f'), 236 236 'author': {'account': author_email, 'name': author_name}, -
trunk/Websites/perf.webkit.org/unit-tests/analysis-task-tests.js
r204189 r212947 44 44 'message': 'Commit message', 45 45 'order': null, 46 'p arent': null,46 'previousCommit': null, 47 47 'repository': '11', 48 48 'revision': '196051',
Note: See TracChangeset
for help on using the changeset viewer.