name -> full_name + fixed error message for missing access token
This commit is contained in:
@@ -4,7 +4,7 @@ const table = new Table({
|
|||||||
name: 'raw.github_repo',
|
name: 'raw.github_repo',
|
||||||
columns: [
|
columns: [
|
||||||
{ name: 'observed_timestamp', type: 'numeric', isPrimary: true },
|
{ name: 'observed_timestamp', type: 'numeric', isPrimary: true },
|
||||||
{ name: 'name', type: 'varchar', isPrimary: true },
|
{ name: 'full_name', type: 'varchar', isPrimary: true },
|
||||||
|
|
||||||
{ name: 'created_at', type: 'numeric', isNullable: false },
|
{ name: 'created_at', type: 'numeric', isNullable: false },
|
||||||
{ name: 'updated_at', type: 'numeric', isNullable: false },
|
{ name: 'updated_at', type: 'numeric', isNullable: false },
|
||||||
|
@@ -4,7 +4,7 @@ const table = new Table({
|
|||||||
name: 'raw.github_pull_request',
|
name: 'raw.github_pull_request',
|
||||||
columns: [
|
columns: [
|
||||||
{ name: 'observed_timestamp', type: 'numeric', isPrimary: true },
|
{ name: 'observed_timestamp', type: 'numeric', isPrimary: true },
|
||||||
{ name: 'repo_name', type: 'varchar', isPrimary: true },
|
{ name: 'repo_full_name', type: 'varchar', isPrimary: true },
|
||||||
{ name: 'pull_request_number', type: 'numeric', isPrimary: true },
|
{ name: 'pull_request_number', type: 'numeric', isPrimary: true },
|
||||||
|
|
||||||
{ name: 'created_at', type: 'numeric', isNullable: false },
|
{ name: 'created_at', type: 'numeric', isNullable: false },
|
||||||
|
@@ -4,7 +4,7 @@ const table = new Table({
|
|||||||
name: 'raw.github_fork',
|
name: 'raw.github_fork',
|
||||||
columns: [
|
columns: [
|
||||||
{ name: 'observed_timestamp', type: 'numeric', isPrimary: true },
|
{ name: 'observed_timestamp', type: 'numeric', isPrimary: true },
|
||||||
{ name: 'name', type: 'varchar', isPrimary: true },
|
{ name: 'full_name', type: 'varchar', isPrimary: true },
|
||||||
{ name: 'owner_login', type: 'varchar', isPrimary: true },
|
{ name: 'owner_login', type: 'varchar', isPrimary: true },
|
||||||
|
|
||||||
{ name: 'created_at', type: 'numeric', isNullable: false },
|
{ name: 'created_at', type: 'numeric', isNullable: false },
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { fetchAsync } from '@0x/utils';
|
import { fetchAsync } from '@0x/utils';
|
||||||
|
|
||||||
export interface GithubRepoResponse {
|
export interface GithubRepoResponse {
|
||||||
name: string;
|
full_name: string;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
updated_at: string;
|
updated_at: string;
|
||||||
pushed_at: string;
|
pushed_at: string;
|
||||||
@@ -27,7 +27,7 @@ export interface GithubPullRequestResponse {
|
|||||||
};
|
};
|
||||||
base: {
|
base: {
|
||||||
repo: {
|
repo: {
|
||||||
name: string;
|
full_name: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -7,8 +7,8 @@ export class GithubFork {
|
|||||||
@PrimaryColumn({ name: 'observed_timestamp', type: 'bigint', transformer: numberToBigIntTransformer })
|
@PrimaryColumn({ name: 'observed_timestamp', type: 'bigint', transformer: numberToBigIntTransformer })
|
||||||
public observedTimestamp!: number;
|
public observedTimestamp!: number;
|
||||||
|
|
||||||
@PrimaryColumn({ name: 'name' })
|
@PrimaryColumn({ name: 'full_name' })
|
||||||
public name!: string;
|
public fullName!: string;
|
||||||
|
|
||||||
@PrimaryColumn({ name: 'owner_login' })
|
@PrimaryColumn({ name: 'owner_login' })
|
||||||
public ownerLogin!: string;
|
public ownerLogin!: string;
|
||||||
|
@@ -7,8 +7,8 @@ export class GithubPullRequest {
|
|||||||
@PrimaryColumn({ name: 'observed_timestamp', type: 'bigint', transformer: numberToBigIntTransformer })
|
@PrimaryColumn({ name: 'observed_timestamp', type: 'bigint', transformer: numberToBigIntTransformer })
|
||||||
public observedTimestamp!: number;
|
public observedTimestamp!: number;
|
||||||
|
|
||||||
@PrimaryColumn({ name: 'repo_name' })
|
@PrimaryColumn({ name: 'repo_full_name' })
|
||||||
public repoName!: string;
|
public repoFullName!: string;
|
||||||
|
|
||||||
@PrimaryColumn({ name: 'pull_request_number', transformer: numberToBigIntTransformer })
|
@PrimaryColumn({ name: 'pull_request_number', transformer: numberToBigIntTransformer })
|
||||||
public pullRequestNumber!: number;
|
public pullRequestNumber!: number;
|
||||||
|
@@ -7,8 +7,8 @@ export class GithubRepo {
|
|||||||
@PrimaryColumn({ name: 'observed_timestamp', type: 'bigint', transformer: numberToBigIntTransformer })
|
@PrimaryColumn({ name: 'observed_timestamp', type: 'bigint', transformer: numberToBigIntTransformer })
|
||||||
public observedTimestamp!: number;
|
public observedTimestamp!: number;
|
||||||
|
|
||||||
@PrimaryColumn({ name: 'name' })
|
@PrimaryColumn({ name: 'full_name' })
|
||||||
public name!: string;
|
public fullName!: string;
|
||||||
|
|
||||||
@Column({ name: 'created_at', type: 'bigint', transformer: numberToBigIntTransformer })
|
@Column({ name: 'created_at', type: 'bigint', transformer: numberToBigIntTransformer })
|
||||||
public createdAt!: number;
|
public createdAt!: number;
|
||||||
|
@@ -9,7 +9,7 @@ export function parseGithubForks(response: GithubForkResponse[], observedTimesta
|
|||||||
const result: GithubFork[] = response.map(fork => {
|
const result: GithubFork[] = response.map(fork => {
|
||||||
const parsedFork = new GithubFork();
|
const parsedFork = new GithubFork();
|
||||||
parsedFork.observedTimestamp = observedTimestamp;
|
parsedFork.observedTimestamp = observedTimestamp;
|
||||||
parsedFork.name = fork.name;
|
parsedFork.fullName = fork.full_name;
|
||||||
parsedFork.ownerLogin = fork.owner.login;
|
parsedFork.ownerLogin = fork.owner.login;
|
||||||
parsedFork.createdAt = Date.parse(fork.created_at);
|
parsedFork.createdAt = Date.parse(fork.created_at);
|
||||||
parsedFork.updatedAt = Date.parse(fork.updated_at);
|
parsedFork.updatedAt = Date.parse(fork.updated_at);
|
||||||
|
@@ -12,7 +12,7 @@ export function parseGithubPulls(
|
|||||||
return response.map(pull => {
|
return response.map(pull => {
|
||||||
const parsedPullRequest = new GithubPullRequest();
|
const parsedPullRequest = new GithubPullRequest();
|
||||||
parsedPullRequest.observedTimestamp = observedTimestamp;
|
parsedPullRequest.observedTimestamp = observedTimestamp;
|
||||||
parsedPullRequest.repoName = pull.base.repo.name;
|
parsedPullRequest.repoFullName = pull.base.repo.full_name;
|
||||||
parsedPullRequest.createdAt = Date.parse(pull.created_at);
|
parsedPullRequest.createdAt = Date.parse(pull.created_at);
|
||||||
parsedPullRequest.updatedAt = Date.parse(pull.updated_at);
|
parsedPullRequest.updatedAt = Date.parse(pull.updated_at);
|
||||||
parsedPullRequest.closedAt = pull.closed_at ? Date.parse(pull.closed_at) : null;
|
parsedPullRequest.closedAt = pull.closed_at ? Date.parse(pull.closed_at) : null;
|
||||||
|
@@ -8,7 +8,7 @@ import { GithubRepo } from '../../entities';
|
|||||||
export function parseGithubRepo(rawRepo: GithubRepoResponse, observedTimestamp: number): GithubRepo {
|
export function parseGithubRepo(rawRepo: GithubRepoResponse, observedTimestamp: number): GithubRepo {
|
||||||
const parsedRepo = new GithubRepo();
|
const parsedRepo = new GithubRepo();
|
||||||
parsedRepo.observedTimestamp = observedTimestamp;
|
parsedRepo.observedTimestamp = observedTimestamp;
|
||||||
parsedRepo.name = rawRepo.name;
|
parsedRepo.fullName = rawRepo.full_name;
|
||||||
parsedRepo.createdAt = Date.parse(rawRepo.created_at);
|
parsedRepo.createdAt = Date.parse(rawRepo.created_at);
|
||||||
parsedRepo.updatedAt = Date.parse(rawRepo.updated_at);
|
parsedRepo.updatedAt = Date.parse(rawRepo.updated_at);
|
||||||
parsedRepo.pushedAt = Date.parse(rawRepo.pushed_at);
|
parsedRepo.pushedAt = Date.parse(rawRepo.pushed_at);
|
||||||
|
@@ -24,7 +24,7 @@ let connection: Connection;
|
|||||||
connection = await createConnection(ormConfig as ConnectionOptions);
|
connection = await createConnection(ormConfig as ConnectionOptions);
|
||||||
const accessToken = process.env.GITHUB_ACCESS_TOKEN;
|
const accessToken = process.env.GITHUB_ACCESS_TOKEN;
|
||||||
if (accessToken === undefined) {
|
if (accessToken === undefined) {
|
||||||
throw new Error('Missing required env var: BLOXY_API_KEY');
|
throw new Error('Missing required env var: GITHUB_ACCESS_TOKEN');
|
||||||
}
|
}
|
||||||
const githubSource = new GithubSource(GITHUB_OWNER, GITHUB_REPO, GITHUB_BRANCH, accessToken);
|
const githubSource = new GithubSource(GITHUB_OWNER, GITHUB_REPO, GITHUB_BRANCH, accessToken);
|
||||||
const observedTimestamp = Date.now();
|
const observedTimestamp = Date.now();
|
||||||
|
@@ -12,7 +12,7 @@ chaiSetup.configure();
|
|||||||
// tslint:disable:custom-no-magic-numbers
|
// tslint:disable:custom-no-magic-numbers
|
||||||
const fork: GithubFork = {
|
const fork: GithubFork = {
|
||||||
observedTimestamp: Date.now(),
|
observedTimestamp: Date.now(),
|
||||||
name: '0x-monorepo',
|
fullName: 'NoahZinsmeister/0x-monorepo',
|
||||||
ownerLogin: 'NoahZinsmeister',
|
ownerLogin: 'NoahZinsmeister',
|
||||||
createdAt: 1552181010000,
|
createdAt: 1552181010000,
|
||||||
updatedAt: 1552191123000,
|
updatedAt: 1552191123000,
|
||||||
@@ -33,7 +33,7 @@ const fork: GithubFork = {
|
|||||||
|
|
||||||
const pullRequest: GithubPullRequest = {
|
const pullRequest: GithubPullRequest = {
|
||||||
observedTimestamp: Date.now(),
|
observedTimestamp: Date.now(),
|
||||||
repoName: '0x-monorepo',
|
repoFullName: '0xProject/0x-monorepo',
|
||||||
pullRequestNumber: 1684,
|
pullRequestNumber: 1684,
|
||||||
state: 'open',
|
state: 'open',
|
||||||
title: '[WIP] Pull Github data',
|
title: '[WIP] Pull Github data',
|
||||||
@@ -46,7 +46,7 @@ const pullRequest: GithubPullRequest = {
|
|||||||
|
|
||||||
const repo: GithubRepo = {
|
const repo: GithubRepo = {
|
||||||
observedTimestamp: Date.now(),
|
observedTimestamp: Date.now(),
|
||||||
name: '0x-monorepo',
|
fullName: '0xProject/0x-monorepo',
|
||||||
createdAt: 1495549053000,
|
createdAt: 1495549053000,
|
||||||
updatedAt: 1551908929000,
|
updatedAt: 1551908929000,
|
||||||
pushedAt: 1551916745000,
|
pushedAt: 1551916745000,
|
||||||
|
@@ -13,7 +13,7 @@ import { GithubFork } from '../../../src/entities';
|
|||||||
|
|
||||||
const ParsedGithubFork = new GithubFork();
|
const ParsedGithubFork = new GithubFork();
|
||||||
ParsedGithubFork.observedTimestamp = Date.now();
|
ParsedGithubFork.observedTimestamp = Date.now();
|
||||||
ParsedGithubFork.name = '0x-monorepo';
|
ParsedGithubFork.fullName = 'NoahZinsmeister/0x-monorepo';
|
||||||
ParsedGithubFork.ownerLogin = 'NoahZinsmeister';
|
ParsedGithubFork.ownerLogin = 'NoahZinsmeister';
|
||||||
ParsedGithubFork.createdAt = 1552181010000; // tslint:disable-line:custom-no-magic-numbers
|
ParsedGithubFork.createdAt = 1552181010000; // tslint:disable-line:custom-no-magic-numbers
|
||||||
ParsedGithubFork.updatedAt = 1552191123000; // tslint:disable-line:custom-no-magic-numbers
|
ParsedGithubFork.updatedAt = 1552191123000; // tslint:disable-line:custom-no-magic-numbers
|
||||||
|
@@ -6,7 +6,7 @@ import { GithubPullRequest } from '../../../src/entities';
|
|||||||
|
|
||||||
const ParsedGithubPullRequest: GithubPullRequest = {
|
const ParsedGithubPullRequest: GithubPullRequest = {
|
||||||
observedTimestamp: Date.now(),
|
observedTimestamp: Date.now(),
|
||||||
repoName: '0x-monorepo',
|
repoFullName: '0xProject/0x-monorepo',
|
||||||
pullRequestNumber: 1684,
|
pullRequestNumber: 1684,
|
||||||
state: 'open',
|
state: 'open',
|
||||||
title: '[WIP] Pull Github data',
|
title: '[WIP] Pull Github data',
|
||||||
|
@@ -6,7 +6,7 @@ import { GithubRepo } from '../../../src/entities';
|
|||||||
|
|
||||||
const ParsedGithubRepo: GithubRepo = {
|
const ParsedGithubRepo: GithubRepo = {
|
||||||
observedTimestamp: Date.now(),
|
observedTimestamp: Date.now(),
|
||||||
name: '0x-monorepo',
|
fullName: '0xProject/0x-monorepo',
|
||||||
createdAt: 1495549053000,
|
createdAt: 1495549053000,
|
||||||
updatedAt: 1551908929000,
|
updatedAt: 1551908929000,
|
||||||
pushedAt: 1551916745000,
|
pushedAt: 1551916745000,
|
||||||
|
Reference in New Issue
Block a user