Skip to content

Commit

Permalink
Merge pull request #1850 from selenamarie/bug965675-missing-product-b…
Browse files Browse the repository at this point in the history
…uild-type-data

Fixes bug 965675 - update fakedata for build_type and update_channel
  • Loading branch information
selenamarie committed Feb 4, 2014
2 parents dbc61b5 + 66a129f commit d4f1c69
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions socorro/external/postgresql/fakedata.py
Expand Up @@ -410,6 +410,20 @@ class ReleaseChannels(BaseTable):
['ESR', '5']]


class ProductBuildTypes(BaseTable):
table = 'product_build_types' # replaces product_release_channels
columns = ['product_name', 'build_type', 'throttle']

def generate_rows(self):
for product in self.releases:
for channel in self.releases[product]['channels']:
throttle = self.releases[product][
'channels'][channel]['throttle']
row = [product, channel.lower(), throttle]
yield row


# DEPRECATED
class ProductReleaseChannels(BaseTable):
table = 'product_release_channels'
columns = ['product_name', 'release_channel', 'throttle']
Expand All @@ -427,7 +441,8 @@ class RawADU(BaseTable):
table = 'raw_adu'
columns = ['adu_count', 'date', 'product_name', 'product_os_platform',
'product_os_version', 'product_version', 'build',
'build_channel', 'product_guid', 'received_at']
'build_channel', 'product_guid', 'received_at',
'update_channel']

def generate_rows(self):
for timestamp in date_range(self.start_date, self.end_date):
Expand All @@ -448,7 +463,7 @@ def generate_rows(self):
row = [adu, str(timestamp), product, os_name,
os_name, number, buildid,
channel.lower(), product_guid,
str(received_at)]
str(received_at), channel.lower()]
yield row


Expand Down Expand Up @@ -792,10 +807,11 @@ def generate_rows(self):

# the order that tables are loaded is important.
tables = [OSNames, OSNameMatches, ProcessTypes, Products, ReleaseChannels,
ProductReleaseChannels, RawADU, ReleaseChannelMatches,
ReleasesRaw, UptimeLevels, WindowsVersions, Reports, RawCrashes,
OSVersions, ProductProductidMap, ReleaseRepositories,
CrontabberState, CrashTypes, ReportPartitionInfo, Skiplist]
ProductReleaseChannels, ProductBuildTypes, RawADU,
ReleaseChannelMatches, ReleasesRaw, UptimeLevels, WindowsVersions,
Reports, RawCrashes, OSVersions, ProductProductidMap,
ReleaseRepositories, CrontabberState, CrashTypes,
ReportPartitionInfo, Skiplist]

# FIXME this could be built up from BaseTable's releases dict, instead
featured_versions = ('5.0a1', '4.0a2', '3.1b1', '2.1')

0 comments on commit d4f1c69

Please sign in to comment.