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

mozilla / blurts-server / #12377

pending completion
#12377

push

circleci

mozilla-pontoon
Pontoon: Update Spanish (Argentina) (es-AR) localization of Firefox Monitor Website

Co-authored-by: Marcelo Poli <enzomatrix@gmail.com>

282 of 1374 branches covered (20.52%)

Branch coverage included in aggregate %.

959 of 3725 relevant lines covered (25.74%)

2.11 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