Skip to content

Instantly share code, notes, and snippets.

function startup() {
let styleSheetService = Cc["@mozilla.org/content/style-sheet-service;1"]
.getService(Components.interfaces.nsIStyleSheetService);
let styleSheetURI = Services.io.newURI("chrome://myaddon/skin/toolbar.css", null, null);
styleSheetService.loadAndRegisterSheet(styleSheetURI, styleSheetService.USER_SHEET);
// returns true
console.log(styleSheetService.sheetRegistered(styleSheetURI, styleSheetService.USER_SHEET));
}
WITH crash AS (
SELECT json_object_field_text(processed_crash, 'cpu_name') AS cpu_name,
json_object_field_text(processed_crash, 'os_name') AS os_name,
json_object_field_text(processed_crash, 'signature') AS signature,
trim('"' from (
string_to_array(
json_object_field_text(processed_crash, 'cpu_info'), '|')
)[2]
) AS core_count
FROM processed_crashes
WITH crash AS (
SELECT json_object_field_text(processed_crash, 'cpu_name') AS cpu_name,
trim('"' from (
string_to_array(
json_object_field_text(processed_crash, 'cpu_info'), '|')
)[2]
) AS core_count,
product_version_id,
signature_id,
reports_clean.date_processed::date,
-- addons
WITH crash AS (
SELECT json_array_elements(processed_crash->'addons') AS addons,
product_version_id,
signature_id,
reports_clean.date_processed::date,
reports_clean.os_name
FROM processed_crashes
JOIN reports_clean ON (processed_crashes.uuid::text = reports_clean.uuid)
JOIN product_versions USING (product_version_id)
$ peep install -r requirements.txt
The following packages had no hashes specified in the requirements file, which
leaves them open to tampering. Vet these packages to your satisfaction, then
add these "sha256" lines like so:
Traceback (most recent call last):
File "/Users/rhelmer/src/socorro/socorro-virtualenv/bin/peep", line 9, in <module>
load_entry_point('peep==0.8', 'console_scripts', 'peep')()
File "/Users/rhelmer/src/socorro/socorro-virtualenv/lib/python2.6/site-packages/peep/__init__.py", line 366, in main
UPDATE reports_clean_buffer
SET release_channel = json_object_field_text(rewrite, 'rewrite_build_type_to'),
product_version_id = product_versions.product_version_id
FROM update_channel_map, product_versions
JOIN raw_crashes as rc on (uuid::uuid = rc.uuid)
WHERE product_versions.version_string = trim(both '"' from (rewrite->'Version')::text)
AND product_versions.product_name = 'B2G'
AND (rewrite->'Android_Manufacturer')::text = (rc.raw_crash->'Android_Manufacturer')::text
AND (rewrite->'Android_Model')::text = (rc.raw_crash->'Android_Model')::text
AND (rewrite->'Android_Version')::text = (rc.raw_crash->'Android_Version')::text
-- Filter B2G reports using update_channel_map
UPDATE reports_clean_buffer
SET release_channel = json_object_field_text(rewrite, 'rewrite_build_type_to'),
product_version_id = product_versions.product_version_id
FROM update_channel_map, product_versions
JOIN raw_crashes as rc on (uuid::uuid = rc.uuid)
WHERE product_versions.version_string = trim(both '"' from (rewrite->'Version')::text)
AND product_versions.product_name = 'B2G'
AND (rewrite->'Android_Manufacturer')::text = (rc.raw_crash->'Android_Manufacturer')::text
UPDATE reports_clean_buffer
SET release_channel = json_object_field_text(rewrite, 'rewrite_build_type_to'),
product_version_id = product_versions.product_version_id
FROM update_channel_map, product_versions
JOIN raw_crashes as rc on (uuid::uuid = rc.uuid)
WHERE product_versions.version_string = trim(both '"' from (rewrite->'Version')::text)
AND rc.date_processed
BETWEEN (fromtime - interval '1 day') AND (fromtime + interval '1 day' )
AND product_versions.product_name = 'B2G'
--AND (rewrite->'Android_Manufacturer')::text = (rc.raw_crash->'Android_Manufacturer')::text
UPDATE reports_clean_buffer
SET release_channel = json_object_field_text(rewrite, 'rewrite_build_type_to'),
product_version_id = product_versions.product_version_id
FROM update_channel_map, product_versions
--JOIN raw_crashes as rc on (uuid::uuid = rc.uuid)
WHERE product_versions.version_string = trim(both '"' from (rewrite->'Version')::text)
--AND rc.date_processed
-- BETWEEN (fromtime - interval '1 day') AND (fromtime + interval '1 day' )
AND product_versions.product_name = 'B2G'
--AND (rewrite->'Android_Manufacturer')::text = (rc.raw_crash->'Android_Manufacturer')::text
WITH rewrite_plan AS (
SELECT json_object_field_text(ucm.rewrite, 'rewrite_build_type_to') as release_channel,
json_array_elements(ucm.rewrite->'BuildID') AS buildid,
product_versions.product_version_id
FROM product_productid_map ppm
JOIN update_channel_map ucm USING (productid)
JOIN product_versions ON ppm.product_name = product_versions.product_name
WHERE product_versions.version_string = trim(both '"' FROM (ucm.rewrite->'Version')::text)
AND product_versions.product_name = 'B2G'
)