• Home
  • Raw
  • Download

Lines Matching +full:delete +full:- +full:branch

7 #      http://www.apache.org/licenses/LICENSE-2.0
42 # ------------------------------------------------------------------------------
44 # ------------------------------------------------------------------------------
69 # ------------------------------------------------------------------------------
71 # ------------------------------------------------------------------------------
84 # The tick is invoked by cron.yaml every 1 minute, it doesn't allow sub-minute
154 # ------------------------------------------------------------------------------
156 # ------------------------------------------------------------------------------
162 date_limit = (datetime.utcnow() - timedelta(days=1)).strftime('%Y-%m-%d')
165 url += '&q=branch:main+project:%s' % GERRIT_PROJECT
173 prs_ready = change['labels'].get('Presubmit-Ready', {}).get('approved', {})
176 # account or are marked as Presubmit-Verified by a trustd account.
194 Jobs are keyed by timestamp-cl-patchset-config to get a fair schedule (workers
204 job_id = '%s--%s--%s' % (timestamp, src.replace('/', '-'), cfg_name)
221 If exists check if a Presubmit-Ready label has been added and if so updates it
228 # might have addeed a Presubmit-Ready label after we created the CL. In
230 logging.debug('check_new_cl(%s-%s)', cl, patchset)
232 'GET', '%s/cls/%s-%s/wants_vote.json' % (DB, cl, patchset))
235 logging.info('Updating wants_vote flag on %s-%s', cl, patchset)
237 'PUT', '%s/cls/%s-%s/wants_vote.json' % (DB, cl, patchset), body=True)
240 await check_pending_cl(cl_and_ps='%s-%s' % (cl, patchset))
241 logging.debug('check_new_cl(%s-%s): already queued', cl, patchset)
249 src = 'cls/%s-%s' % (cl, patchset)
252 patch_obj['cls_pending/%s-%s' % (cl, patchset)] = 0
261 logging.debug('check_new_cl(%s-%s): queueing jobs', cl, patchset)
266 first_key = '%s-0' % cl
267 last_key = '%s-z' % cl
272 ps = int(cl_and_ps.split('-')[-1])
293 # Presubmit-Ready label is applied after we have finished running all the
304 # Interrupted jobs are due to VMs being shutdown (usually due to a scale-down)
305 # Automatically re-queue them so they get picked up by some other vm.
312 age_sec = (datetime.utcnow() - t_queued).total_seconds()
325 'cls_pending/%s' % cl_and_ps: {}, # = DELETE
357 if '-ui-' in job_id:
361 'https://storage.googleapis.com/%s/%s/ui-test-artifacts/index.html' %
366 cl_vote = -1
377 '- %s/%s (%s)\n' % (log_url, job_id, status)
382 msg += ''.join(['- %s/%s\n' % (log_url, job_id) for job_id in passed_jobs])
384 msg += '\nArtifacts:\n' + ''.join('- %s\n' % link for link in ui_links)
386 msg += '- https://ci.perfetto.dev/#!/cls/%s\n' % cl_and_ps.split('-')[0]
389 body['labels']['Code-Review'] = cl_vote
397 async def queue_postsubmit_jobs(branch: str, revision: str = None):
398 '''Creates the jobs entries in the DB for the given branch or revision
401 1. ?branch=main: Will retrieve the SHA1 of main and call the one below.
402 2. ?branch=main&rev=deadbeef1234: queues jobs for the given revision.
405 assert (branch)
408 # Get the commit SHA1 of the head of the branch.
409 url = 'https://%s/a/projects/%s/branches/%s' % (GERRIT_HOST, prj, branch)
420 await queue_postsubmit_jobs(branch=branch, revision=revision)
427 time_committed = datetime.strptime(time_committed, '%Y-%m-%d %H:%M:%S')
430 src = 'branches/%s-%s' % (branch, time_committed.strftime('%Y%m%d%H%M%S'))
442 ref = 'refs/heads/' + branch
453 age_days = (datetime.now() - datetime.strptime(job_id[:8], '%Y%m%d')).days
455 logging.debug('Delete log %s', job_id)
471 age = (datetime.now() - time_started).total_seconds()
486 age = (datetime.now() - last_update).total_seconds()
488 patch_obj['workers/' + worker_id] = {} # DELETE
502 'jobs_running/%s' % job_id: {}, # = DELETE,
503 'jobs_queued/%s' % job_id: {}, # = DELETE,
512 '''Re-queues a job that was previously interrupted due to a VM shutdown.'''
515 'jobs_running/%s' % job_id: {}, # = DELETE,
519 'jobs/%s/time_started' % job_id: {}, # = DELETE
520 'jobs/%s/time_ended' % job_id: {}, # = DELETE
521 'jobs/%s/worker' % job_id: {}, # = DELETE
527 await req_async('DELETE',
538 'v': int((t_ended - t_queued).total_seconds())
553 'v': int((t_started - t_queued).total_seconds())
562 'v': int((t_ended - t_started).total_seconds())