Skip to content

Commit

Permalink
feat(github-event): pass data correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
hulkoba committed Jun 19, 2018
1 parent 48c73fe commit 5f7c743
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion 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, repositoriesAdded }) {
module.exports = async function ({ installation, repositories_added: repositoriesAdded }) {
const { repositories: reposDb } = await dbs()
const logs = dbs.getLogsDb()

Expand Down
2 changes: 1 addition & 1 deletion jobs/github-event/installation_repositories/removed.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const statsd = require('../../../lib/statsd')
const env = require('../../../lib/env')
const { maybeUpdatePaymentsJob } = require('../../../lib/payments')

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

Expand Down
2 changes: 1 addition & 1 deletion jobs/github-event/marketplace_purchase/cancelled.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const Log = require('gk-log')
const dbs = require('../../../lib/dbs')
const upsert = require('../../../lib/upsert')

module.exports = async function ({ marketplacePurchase }) {
module.exports = async function ({ marketplace_purchase: marketplacePurchase }) {
const { payments } = await dbs()
const logs = dbs.getLogsDb()
const log = Log({
Expand Down
2 changes: 1 addition & 1 deletion jobs/github-event/marketplace_purchase/changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const dbs = require('../../../lib/dbs')
const upsert = require('../../../lib/upsert')
const normalizePlanName = require('../../../lib/normalize-plan-name')

module.exports = async function ({ marketplacePurchase }) {
module.exports = async function ({ marketplace_purchase: marketplacePurchase }) {
const { payments } = await dbs()
const logs = dbs.getLogsDb()
const log = Log({
Expand Down
2 changes: 1 addition & 1 deletion jobs/github-event/marketplace_purchase/purchased.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const dbs = require('../../../lib/dbs')
const upsert = require('../../../lib/upsert')
const normalizePlanName = require('../../../lib/normalize-plan-name')

module.exports = async function ({ marketplacePurchase }) {
module.exports = async function ({ marketplace_purchase: marketplacePurchase }) {
const { payments } = await dbs()
const logs = dbs.getLogsDb()
const log = Log({
Expand Down
10 changes: 5 additions & 5 deletions test/jobs/github-event/installation_repositories/added.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test('github-event installation_repositories but empty list of repos', async ()
id: 2
}
},
repositoriesAdded: [
repositories_added: [
]
})

Expand Down Expand Up @@ -67,7 +67,7 @@ test('github-event installation_repositories added', async () => {
id: 2
}
},
repositoriesAdded: [
repositories_added: [
{ id: 31, full_name: 'bar/repo1' },
{ id: 32, full_name: 'bar/repo2' }
]
Expand Down Expand Up @@ -134,7 +134,7 @@ test('github-event installation_repositories added with intermittent 404s', asyn
id: 2
}
},
repositoriesAdded: [
repositories_added: [
{ id: 31, full_name: 'bar/repo1' },
{ id: 32, full_name: 'bar/repo2' }
]
Expand Down Expand Up @@ -200,7 +200,7 @@ test('github-event installation_repositories added with too many 404s', async ()
id: 2
}
},
repositoriesAdded: [
repositories_added: [
{ id: 31, full_name: 'bar/repo1' },
{ id: 32, full_name: 'bar/repo2' }
]
Expand Down Expand Up @@ -238,7 +238,7 @@ test('github-event installation_repositories added with a non 404 error', async
id: 2
}
},
repositoriesAdded: [
repositories_added: [
{ id: 31, full_name: 'bar/repo1' },
{ id: 32, full_name: 'bar/repo2' }
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test('github-event installation_repositories removed', async () => {
type: 'installation_repositories',
action: 'removed',
installation: { account: { id: 2 } },
repositoriesRemoved: [{ id: 22 }, { id: 25 }, { id: 26 }]
repositories_removed: [{ id: 22 }, { id: 25 }, { id: 26 }]
})
expect(newJobs).toBeFalsy()

Expand Down
2 changes: 1 addition & 1 deletion test/jobs/github-event/marketplace_purchase/cancelled.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('marketplace canceled', async () => {
})

const newJobs = await cancelPurchase({
marketplacePurchase: {
marketplace_purchase: {
account: {
type: 'Organization',
id: 444,
Expand Down
2 changes: 1 addition & 1 deletion test/jobs/github-event/marketplace_purchase/changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('marketplace changed', async () => {
})

const newJobs = await changePurchase({
marketplacePurchase: {
marketplace_purchase: {
account: {
type: 'Organization',
id: 444,
Expand Down
10 changes: 5 additions & 5 deletions test/jobs/github-event/marketplace_purchase/purchased.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('marketplace purchased', async () => {
const { payments } = await dbs()

const newJob = await purchasePurchase({
marketplacePurchase: {
marketplace_purchase: {
account: {
type: 'Organization',
id: 444,
Expand Down Expand Up @@ -43,7 +43,7 @@ describe('marketplace purchased', async () => {
})

const newJob = await purchasePurchase({
marketplacePurchase: {
marketplace_purchase: {
account: {
type: 'Organization',
id: 445,
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('marketplace purchased', async () => {
const newJob = await purchasePurchase({
action: 'purchased',
effective_date: '2017-04-06T02:01:16Z',
marketplacePurchase: {
marketplace_purchase: {
account: {
type: 'Organization',
id: 446,
Expand Down Expand Up @@ -123,7 +123,7 @@ describe('marketplace purchased', async () => {
})

const newJob = await purchasePurchase({
marketplacePurchase: {
marketplace_purchase: {
account: {
type: 'Organization',
id: 447,
Expand Down Expand Up @@ -165,7 +165,7 @@ describe('marketplace purchased', async () => {
const newJob = await purchasePurchase({
action: 'purchased',
effective_date: '2017-04-06T02:01:16Z',
marketplacePurchase: {
marketplace_purchase: {
account: {
type: 'Organization',
id: 448,
Expand Down
4 changes: 2 additions & 2 deletions test/lib/enterprise-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const lolex = require('lolex')
const enterpriseSetup = require('../../lib/enterprise-setup')

describe('enterprise setup', () => {
test('creates LogsDb for actual and next month', async() => {
test('creates LogsDb for actual and next month', async () => {
const clock = lolex.install()
const enterpriseDbs = await enterpriseSetup()

Expand All @@ -15,7 +15,7 @@ describe('enterprise setup', () => {
clock.uninstall()
})

test('removes LogsDbs if there are older than 12 month', async() => {
test('removes LogsDbs if there are older than 12 month', async () => {
const clock = lolex.install()

let enterpriseDbs = await enterpriseSetup()
Expand Down

0 comments on commit 5f7c743

Please sign in to comment.