Skip to content

Commit

Permalink
chore(github-event): disable eslint for github-event variables
Browse files Browse the repository at this point in the history
  • Loading branch information
hulkoba committed Jun 19, 2018
1 parent 5f7c743 commit eec2c0f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
14 changes: 7 additions & 7 deletions jobs/github-event/installation_repositories/added.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const { createDocs } = require('../../../lib/repository-docs')

const max404Retries = 5

module.exports = async function ({ installation, repositories_added: repositoriesAdded }) {
module.exports = async function ({ installation, repositories_added }) { // eslint-disable-line
const { repositories: reposDb } = await dbs()
const logs = dbs.getLogsDb()

Expand All @@ -20,21 +20,21 @@ module.exports = async function ({ installation, repositories_added: repositorie
repoSlug: null,
context: 'installation-repositories-added'
})
log.info('started', { repositoriesAdded })
if (!repositoriesAdded.length) {
log.info('started', { repositories_added })
if (!repositories_added.length) {
log.warn('exited: no repositories selected')
return
}
// spam :(
if (['23046691', '1623538'].includes(installation.account.id) ||
(repositoriesAdded[0] && repositoriesAdded[0].fullName &&
(repositoriesAdded[0].fullName.includes('dalavanmanphonsy') ||
repositoriesAdded[0].fullName.includes('CNXTEoEorg')))) {
(repositories_added[0] && repositories_added[0].fullName &&
(repositories_added[0].fullName.includes('dalavanmanphonsy') ||
repositories_added[0].fullName.includes('CNXTEoEorg')))) {
log.warn('exited: spam')
return
}

const repositories = await Promise.mapSeries(repositoriesAdded, doc => {
const repositories = await Promise.mapSeries(repositories_added, doc => {
const [owner, repo] = doc.full_name.split('/')
return GithubQueue(installation.id).read(github => {
return promiseRetry((retry, number) => {
Expand Down
6 changes: 3 additions & 3 deletions jobs/github-event/installation_repositories/removed.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ const statsd = require('../../../lib/statsd')
const env = require('../../../lib/env')
const { maybeUpdatePaymentsJob } = require('../../../lib/payments')

module.exports = async function ({ installation, repositories_removed: repositoriesRemoved }) {
module.exports = async function ({ installation, repositories_removed }) { // eslint-disable-line
const { repositories: reposDb } = await dbs()
const logs = dbs.getLogsDb()

const accountId = String(installation.account.id)
const repoIds = _.map(repositoriesRemoved, repo => String(repo.id))
const repoIds = _.map(repositories_removed, repo => String(repo.id))
const log = Log({
logsDb: logs,
accountId: installation.account.id,
repoSlug: null,
context: 'installation-repositories-removed'
})
log.info('started', { repositoriesRemoved })
log.info('started', { repositories_removed })
// branches and prs will only be deleted on a complete uninstall
const repositories = _(
(await reposDb.query('by_account', {
Expand Down
8 changes: 4 additions & 4 deletions jobs/github-event/marketplace_purchase/cancelled.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ const Log = require('gk-log')
const dbs = require('../../../lib/dbs')
const upsert = require('../../../lib/upsert')

module.exports = async function ({ marketplace_purchase: marketplacePurchase }) {
module.exports = async function ({ marketplace_purchase }) { // eslint-disable-line
const { payments } = await dbs()
const logs = dbs.getLogsDb()
const log = Log({
logsDb: logs,
accountId: marketplacePurchase.account.id,
accountId: marketplace_purchase.account.id,
repoSlug: null,
context: 'marketplace-purchase-cancelled'
})
log.info('started', { marketplacePurchase })
const accountId = String(marketplacePurchase.account.id)
log.info('started', { marketplace_purchase })
const accountId = String(marketplace_purchase.account.id)

try {
await upsert(payments, accountId, { plan: 'free' })
Expand Down
10 changes: 5 additions & 5 deletions jobs/github-event/marketplace_purchase/changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ const dbs = require('../../../lib/dbs')
const upsert = require('../../../lib/upsert')
const normalizePlanName = require('../../../lib/normalize-plan-name')

module.exports = async function ({ marketplace_purchase: marketplacePurchase }) {
module.exports = async function ({ marketplace_purchase }) { // eslint-disable-line
const { payments } = await dbs()
const logs = dbs.getLogsDb()
const log = Log({
logsDb: logs,
accountId: marketplacePurchase.account.id,
accountId: marketplace_purchase.account.id,
repoSlug: null,
context: 'marketplace-purchase-changed'
})
log.info('started', { marketplacePurchase })
const accountId = String(marketplacePurchase.account.id)
log.info('started', { marketplace_purchase })
const accountId = String(marketplace_purchase.account.id)

try {
const plan = normalizePlanName(marketplacePurchase.plan.name)
const plan = normalizePlanName(marketplace_purchase.plan.name)
await upsert(payments, accountId, { plan })
log.success('database: paymentDoc was updated', { plan })
} catch (error) {
Expand Down
10 changes: 5 additions & 5 deletions jobs/github-event/marketplace_purchase/purchased.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ const dbs = require('../../../lib/dbs')
const upsert = require('../../../lib/upsert')
const normalizePlanName = require('../../../lib/normalize-plan-name')

module.exports = async function ({ marketplace_purchase: marketplacePurchase }) {
module.exports = async function ({ marketplace_purchase }) { // eslint-disable-line
const { payments } = await dbs()
const logs = dbs.getLogsDb()
const log = Log({
logsDb: logs,
accountId: marketplacePurchase.account.id,
accountId: marketplace_purchase.account.id,
repoSlug: null,
context: 'marketplace-purchase-created'
})
log.info('started', { marketplacePurchase })
const accountId = String(marketplacePurchase.account.id)
log.info('started', { marketplace_purchase })
const accountId = String(marketplace_purchase.account.id)
let paymentDoc

await upsert(payments, accountId, {
plan: normalizePlanName(marketplacePurchase.plan.name)
plan: normalizePlanName(marketplace_purchase.plan.name)
})

try {
Expand Down

0 comments on commit eec2c0f

Please sign in to comment.