Skip to content
This repository was archived by the owner on Feb 21, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions scrum/migrations/0014_auto__chg_field_bug_priority.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

def forwards(self, orm):

# Changing field 'Bug.priority'
db.alter_column('scrum_bug', 'priority', self.gf('django.db.models.fields.CharField')(max_length=3))

def backwards(self, orm):

# Changing field 'Bug.priority'
db.alter_column('scrum_bug', 'priority', self.gf('django.db.models.fields.CharField')(max_length=2))

models = {
'scrum.bug': {
'Meta': {'ordering': "('id',)", 'object_name': 'Bug'},
'assigned_to': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
'attachments': ('scrum.models.CompressedJSONField', [], {'blank': 'True'}),
'blocks': ('jsonfield.fields.JSONField', [], {'blank': 'True'}),
'comments_count': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
'component': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'creation_time': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'depends_on': ('jsonfield.fields.JSONField', [], {'blank': 'True'}),
'flags': ('scrum.models.CompressedJSONField', [], {'blank': 'True'}),
'history': ('scrum.models.CompressedJSONField', [], {'blank': 'True'}),
'id': ('django.db.models.fields.PositiveIntegerField', [], {'primary_key': 'True'}),
'last_change_time': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_synced_time': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'priority': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}),
'product': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bugs'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['scrum.Project']"}),
'resolution': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
'severity': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
'sprint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bugs'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['scrum.Sprint']"}),
'status': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
'story_component': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
'story_points': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
'story_user': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
'summary': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
'target_milestone': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
'whiteboard': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'blank': 'True'})
},
'scrum.bugsprintlog': {
'Meta': {'ordering': "('-timestamp',)", 'object_name': 'BugSprintLog'},
'action': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
'bug': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sprint_actions'", 'to': "orm['scrum.Bug']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'sprint': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bug_actions'", 'to': "orm['scrum.Sprint']"}),
'timestamp': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'})
},
'scrum.bugzillaurl': {
'Meta': {'ordering': "('id',)", 'object_name': 'BugzillaURL'},
'date_synced': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 10, 27, 0, 0)'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'one_time': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'project': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'urls'", 'null': 'True', 'to': "orm['scrum.Project']"}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '2048'})
},
'scrum.bzproduct': {
'Meta': {'object_name': 'BZProduct'},
'component': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'products'", 'to': "orm['scrum.Project']"})
},
'scrum.project': {
'Meta': {'ordering': "('name',)", 'object_name': 'Project'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'slug': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects'", 'null': 'True', 'to': "orm['scrum.Team']"})
},
'scrum.sprint': {
'Meta': {'ordering': "['-start_date']", 'unique_together': "(('team', 'slug'),)", 'object_name': 'Sprint'},
'bugs_data_cache': ('jsonfield.fields.JSONField', [], {'null': 'True'}),
'bz_url': ('django.db.models.fields.URLField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}),
'created_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'end_date': ('django.db.models.fields.DateField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'notes_html': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'slug': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'}),
'start_date': ('django.db.models.fields.DateField', [], {}),
'team': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sprints'", 'to': "orm['scrum.Team']"})
},
'scrum.team': {
'Meta': {'ordering': "('name',)", 'object_name': 'Team'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'slug': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'})
}
}

complete_apps = ['scrum']
2 changes: 1 addition & 1 deletion scrum/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ class Bug(models.Model):
status = models.CharField(max_length=20)
resolution = models.CharField(max_length=20, blank=True)
summary = models.CharField(max_length=500)
priority = models.CharField(max_length=2, blank=True)
priority = models.CharField(max_length=3, blank=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we go ahead and make this bigger? Maybe 10? I don't think it'll hurt. Also we need a south migration for this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe specify this as a setting in the config file? Since custom installations of bugzilla might have longer priority descriptions than 3. Limiting to 3 should be sufficient for default installs though.

Will add south migration against this.

whiteboard = models.CharField(max_length=2048, blank=True)
blocks = JSONField(blank=True)
depends_on = JSONField(blank=True)
Expand Down
5 changes: 5 additions & 0 deletions scrum/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ def get_object(self, queryset=None):
pk = self.kwargs['pk']
bug_data = bugzilla.get_bugs(ids=[pk], scrum_only=False)
if bug_data['bugs']:
# scrumbu.gs currently doesn't write to bugzilla
# hence we do not use update_token returned against bugs
# via xmlrpc
for bug in bug_data['bugs']:
del bug['update_token']
obj = store_bugs(bug_data)[0]
else:
obj = False
Expand Down
4 changes: 4 additions & 0 deletions settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
MANAGERS = ADMINS

BUGZILLA_BASE_URL = 'https://bugzilla.mozilla.org'
BUGZILLA_API_URL = 'https://bugzilla.mozilla.org/xmlrpc.cgi'
BUGZILLA_USER = 'scrum@mozilla.org'
BUZILLA_PASS = 'scrumpass'

CACHE_BUGS_FOR = 4 # hours

SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
Expand Down