• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / #12980

pending completion
#12980

push

circleci

Vinnl
Add redundant social media preview tags

Not all social media websites implement the same (or any) fallbacks
for preview cards, so we have to add them redundantly to make sure
they show up everywhere.

282 of 1595 branches covered (17.68%)

Branch coverage included in aggregate %.

959 of 4308 relevant lines covered (22.26%)

1.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/remote-settings.js
1
'use strict'
2

3
const got = require('got')
×
4
const AppConstants = require('../app-constants')
×
5

6
const BREACHES_COLLECTION = 'fxmonitor-breaches'
×
7
const FX_RS_COLLECTION = `${AppConstants.FX_REMOTE_SETTINGS_WRITER_SERVER}/buckets/main-workspace/collections/${BREACHES_COLLECTION}`
×
8
const FX_RS_RECORDS = `${FX_RS_COLLECTION}/records`
×
9
const FX_RS_WRITER_USER = AppConstants.FX_REMOTE_SETTINGS_WRITER_USER
×
10
const FX_RS_WRITER_PASS = AppConstants.FX_REMOTE_SETTINGS_WRITER_PASS
×
11

12
const RemoteSettings = {
×
13

14
  async whichBreachesAreNotInRemoteSettingsYet (breaches) {
15
    const fxRSRecords = await got(FX_RS_RECORDS, {
×
16
      responseType: 'json',
17
      username: FX_RS_WRITER_USER,
18
      password: FX_RS_WRITER_PASS
19
    })
20
    const remoteSettingsBreachesSet = new Set(
×
21
      fxRSRecords.body.data.map(b => b.Name)
×
22
    )
23

24
    return breaches.filter(({ Name }) => !remoteSettingsBreachesSet.has(Name))
×
25
  },
26

27
  async postNewBreachToBreachesCollection (data) {
28
    // Create the record
29
    return await got.post(FX_RS_RECORDS, {
×
30
      username: FX_RS_WRITER_USER,
31
      password: FX_RS_WRITER_PASS,
32
      json: { data },
33
      responseType: 'json'
34
    })
35
  },
36

37
  async requestReviewOnBreachesCollection () {
38
    return await got.patch(FX_RS_COLLECTION, {
×
39
      username: FX_RS_WRITER_USER,
40
      password: FX_RS_WRITER_PASS,
41
      json: { data: { status: 'to-review' } },
42
      responseType: 'json'
43
    })
44
  }
45
}
46

47
module.exports = RemoteSettings
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc