Merge lp:~cjohnston/qa-dashboard/store-artifacts into lp:qa-dashboard

Proposed by Chris Johnston
Status: Merged
Approved by: Chris Johnston
Approved revision: 575
Merged at revision: 575
Proposed branch: lp:~cjohnston/qa-dashboard/store-artifacts
Merge into: lp:qa-dashboard
Diff against target: 199 lines (+131/-1)
5 files modified
common/admin.py (+8/-0)
common/management/__init__.py (+4/-0)
common/migrations/0006_add_artifacts.py (+82/-0)
common/models.py (+11/-0)
smokeng/management/commands/jenkins_pull_smokeng.py (+26/-1)
To merge this branch: bzr merge lp:~cjohnston/qa-dashboard/store-artifacts
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+180432@code.launchpad.net

Commit message

Creates 'artifacts' in the dashboard; pulls artifacts from smokeng jobs

Description of the change

There are an increasing number of requests that are being made for the dashboard which all point to the dashboard replacing Jenkins as the viewable front end for QA testing. Many of these requests require that the dashboard produce some sort of data or result based upon the artifacts from a job. In order to satisfy these requests more easily, it would be a good idea to give the dashboard the notion of artifacts.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:575
http://s-jenkins:8080/job/dashboard-ci/154/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins:8080/job/dashboard-ci/154/rebuild

review: Approve (continuous-integration)
575. By Chris Johnston

Add common.artifacts, start saving smokeng artifacts

Revision history for this message
Andy Doan (doanac) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'common/admin.py'
--- common/admin.py 2013-08-09 03:20:35 +0000
+++ common/admin.py 2013-08-15 21:24:23 +0000
@@ -17,6 +17,7 @@
17 Bug,17 Bug,
18 JenkinsJob,18 JenkinsJob,
19 JenkinsBuild,19 JenkinsBuild,
20 Artifact,
20)21)
2122
22from django.contrib import admin23from django.contrib import admin
@@ -50,6 +51,13 @@
50 ]51 ]
51 date_hierarchy = 'ran_at'52 date_hierarchy = 'ran_at'
5253
54
55class ArtifactAdmin(admin.ModelAdmin):
56 list_display = ('name', 'jenkins_build', 'publish')
57 search_fields = ['name', 'jenkins_build']
58
59
53admin.site.register(Bug, BugAdmin)60admin.site.register(Bug, BugAdmin)
54admin.site.register(JenkinsJob, JenkinsJobAdmin)61admin.site.register(JenkinsJob, JenkinsJobAdmin)
55admin.site.register(JenkinsBuild, JenkinsBuildAdmin)62admin.site.register(JenkinsBuild, JenkinsBuildAdmin)
63admin.site.register(Artifact, ArtifactAdmin)
5664
=== modified file 'common/management/__init__.py'
--- common/management/__init__.py 2013-08-02 18:56:36 +0000
+++ common/management/__init__.py 2013-08-15 21:24:23 +0000
@@ -327,6 +327,9 @@
327 def _process_logs(self, build, build_date, install_data, func):327 def _process_logs(self, build, build_date, install_data, func):
328 raise NotImplementedError328 raise NotImplementedError
329329
330 def process_artifacts(self, build, install_data):
331 pass
332
330 def add_result(self):333 def add_result(self):
331 pass334 pass
332335
@@ -615,6 +618,7 @@
615 if self.install_data['process_build']:618 if self.install_data['process_build']:
616 self.add_job_bugs(build)619 self.add_job_bugs(build)
617 self.process_build(build)620 self.process_build(build)
621 self.process_artifacts(build, self.install_data)
618 self.process_add_result(build)622 self.process_add_result(build)
619 self.post_process_build(build)623 self.post_process_build(build)
620624
621625
=== added file 'common/migrations/0006_add_artifacts.py'
--- common/migrations/0006_add_artifacts.py 1970-01-01 00:00:00 +0000
+++ common/migrations/0006_add_artifacts.py 2013-08-15 21:24:23 +0000
@@ -0,0 +1,82 @@
1# -*- coding: utf-8 -*-
2import datetime
3from south.db import db
4from south.v2 import SchemaMigration
5from django.db import models
6
7
8class Migration(SchemaMigration):
9
10 def forwards(self, orm):
11 # Adding model 'Artifact'
12 db.create_table('common_artifacts', (
13 ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
15 ('updated_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
16 ('internal', self.gf('django.db.models.fields.BooleanField')(default=True)),
17 ('publish', self.gf('django.db.models.fields.BooleanField')(default=True)),
18 ('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
19 ('name', self.gf('django.db.models.fields.CharField')(max_length=4096)),
20 ('jenkins_build', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['common.JenkinsBuild'])),
21 ))
22 db.send_create_signal('common', ['Artifact'])
23
24
25 def backwards(self, orm):
26 # Deleting model 'Artifact'
27 db.delete_table('common_artifacts')
28
29
30 models = {
31 'common.artifact': {
32 'Meta': {'object_name': 'Artifact', 'db_table': "'common_artifacts'"},
33 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
34 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
35 'internal': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
36 'jenkins_build': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['common.JenkinsBuild']"}),
37 'name': ('django.db.models.fields.CharField', [], {'max_length': '4096'}),
38 'publish': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
39 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
40 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
41 },
42 'common.bug': {
43 'Meta': {'object_name': 'Bug', 'db_table': "'bugs'"},
44 'assignee': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
45 'bug_no': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
46 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
47 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
48 'importance': ('django.db.models.fields.CharField', [], {'default': "u'unknown'", 'max_length': '4096'}),
49 'internal': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
50 'project': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
51 'publish': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
52 'status': ('django.db.models.fields.CharField', [], {'default': "u'unknown'", 'max_length': '4096'}),
53 'title': ('django.db.models.fields.CharField', [], {'max_length': '4096', 'null': 'True'}),
54 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
55 },
56 'common.jenkinsbuild': {
57 'Meta': {'unique_together': "(('job', 'build_number'),)", 'object_name': 'JenkinsBuild', 'db_table': "'jenkins_builds'"},
58 'bugs': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'build_bugs'", 'symmetrical': 'False', 'to': "orm['common.Bug']"}),
59 'build_description': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '1024'}),
60 'build_number': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
61 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
62 'failed': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
63 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
64 'internal': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
65 'job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['common.JenkinsJob']"}),
66 'publish': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
67 'ran_at': ('django.db.models.fields.DateTimeField', [], {}),
68 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
69 },
70 'common.jenkinsjob': {
71 'Meta': {'object_name': 'JenkinsJob', 'db_table': "'jenkins_jobs'"},
72 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
73 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
74 'internal': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
75 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '200'}),
76 'publish': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
77 'updated_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
78 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
79 }
80 }
81
82 complete_apps = ['common']
0\ No newline at end of file83\ No newline at end of file
184
=== modified file 'common/models.py'
--- common/models.py 2013-07-02 21:04:09 +0000
+++ common/models.py 2013-08-15 21:24:23 +0000
@@ -150,3 +150,14 @@
150 """ Get number of bugs for this build. """150 """ Get number of bugs for this build. """
151151
152 return self.bugs.count()152 return self.bugs.count()
153
154
155class Artifact(DashboardBaseModel):
156 """ Add artifacts """
157
158 class Meta:
159 db_table = "common_artifacts"
160
161 url = models.URLField()
162 name = models.CharField(max_length=4096)
163 jenkins_build = models.ForeignKey(JenkinsBuild)
153164
=== modified file 'smokeng/management/commands/jenkins_pull_smokeng.py'
--- smokeng/management/commands/jenkins_pull_smokeng.py 2013-08-07 19:05:49 +0000
+++ smokeng/management/commands/jenkins_pull_smokeng.py 2013-08-15 21:24:23 +0000
@@ -25,7 +25,7 @@
2525
26from common.utah_parser import UTAHParser, ParserError26from common.utah_parser import UTAHParser, ParserError
27from common.utils import regexes27from common.utils import regexes
28from common.models import Bug28from common.models import Bug, Artifact
2929
30from smokeng.models import (30from smokeng.models import (
31 SmokeImage,31 SmokeImage,
@@ -107,6 +107,31 @@
107 total=total_count,107 total=total_count,
108 )108 )
109109
110 def process_artifacts(self, build, install_data):
111 artifact_regex = re.compile(
112 ur'^(clientlogs\/|)(.*.yaml|.*.log$|media-info|.*.props|.*.crash)'
113 )
114 for artifact in build['artifacts']:
115 path = artifact['relativePath']
116 if artifact_regex.match(path):
117 logfile_path = "{}{}/artifact/{}".format(
118 self.install_data['jenkins_build'].job.url,
119 self.install_data['jenkins_build'].build_number,
120 artifact['relativePath'],
121 )
122 artifact, new_artifact = Artifact.objects.get_or_create(
123 url=logfile_path,
124 name=artifact['fileName'],
125 jenkins_build=install_data['jenkins_build'],
126 )
127
128 if new_artifact:
129 logging.info(
130 "Adding %s for jenkins build %s",
131 artifact['fileName'],
132 install_data['jenkins_build'],
133 )
134
110 def _process_logs(self, build, build_date, install_data, func):135 def _process_logs(self, build, build_date, install_data, func):
111136
112 if not hasattr(func, '__call__'):137 if not hasattr(func, '__call__'):

Subscribers

People subscribed via source and target branches