Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAI-441 - Update Jenkins spec + refactor + add Phabricator source skeleton #100

Merged
merged 1 commit into from Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions destinations/faros-destination/package.json
@@ -1,6 +1,6 @@
{
"name": "faros-destination",
"version": "0.1.19",
"version": "0.1.20",
"private": true,
"description": "Faros Destination for Airbyte",
"keywords": [
Expand Down Expand Up @@ -30,7 +30,7 @@
"watch": "tsc -b -w src test"
},
"dependencies": {
"faros-airbyte-cdk": "^0.1.19",
"faros-airbyte-cdk": "^0.1.20",
"faros-feeds-sdk": "^0.8.30",
"jsonata": "^1.8.5",
"object-sizeof": "^1.6.1",
Expand Down
2 changes: 1 addition & 1 deletion faros-airbyte-cdk/package.json
@@ -1,6 +1,6 @@
{
"name": "faros-airbyte-cdk",
"version": "0.1.19",
"version": "0.1.20",
"description": "Airbyte Connector Development Kit (CDK) for JavaScript/TypeScript",
"keywords": [
"airbyte",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
@@ -1,5 +1,5 @@
{
"version": "0.1.19",
"version": "0.1.20",
"packages": [
"faros-airbyte-cdk",
"destinations/**",
Expand Down
6 changes: 4 additions & 2 deletions sources/example-source/package.json
@@ -1,8 +1,10 @@
{
"name": "example-source",
"version": "0.1.19",
"version": "0.1.20",
"description": "Example Airbyte source",
"keywords": [
"airbyte",
"source",
"faros"
],
"homepage": "https://www.faros.ai",
Expand All @@ -29,7 +31,7 @@
"dependencies": {
"axios": "^0.21.4",
"commander": "^8.2.0",
"faros-airbyte-cdk": "^0.1.19",
"faros-airbyte-cdk": "^0.1.20",
"verror": "^1.10.0"
},
"jest": {
Expand Down
12 changes: 7 additions & 5 deletions sources/example-source/resources/spec.json
Expand Up @@ -13,18 +13,20 @@
"properties": {
"server_url": {
"type": "string",
"description": "Jenkins Server URL",
"examples": ["https://my-jenkins-server.example.com"]
"title": "Jenkins Server URL",
"examples": [
"https://my-jenkins-server.example.com"
]
},
"user": {
"type": "string",
"description": "Jenkins User"
"title": "Jenkins User"
},
"token": {
"type": "string",
"description": "Jenkins Token",
"title": "Jenkins Token",
"airbyte_secret": true
}
}
}
}
}
2 changes: 1 addition & 1 deletion sources/example-source/src/index.ts
Expand Up @@ -9,7 +9,7 @@ import {
} from 'faros-airbyte-cdk';
import VError from 'verror';

import {JenkinsBuilds} from './stream';
import {JenkinsBuilds} from './streams';

/** The main entry point. */
export function mainCommand(): Command {
Expand Down
3 changes: 3 additions & 0 deletions sources/example-source/src/streams/index.ts
@@ -0,0 +1,3 @@
import {JenkinsBuilds} from './builds';

export {JenkinsBuilds};
4 changes: 2 additions & 2 deletions sources/jenkins-source/package.json
@@ -1,6 +1,6 @@
{
"name": "jenkins-source",
"version": "0.1.7",
"version": "0.1.20",
"description": "Jenkins Airbyte source",
"keywords": [
"airbyte",
Expand Down Expand Up @@ -31,7 +31,7 @@
},
"dependencies": {
"axios": "^0.21.4",
"faros-airbyte-cdk": "^0.1.19",
"faros-airbyte-cdk": "^0.1.20",
"jenkins": "^0.28.1",
"typescript-memoize": "^1.0.1",
"verror": "^1.10.0"
Expand Down
9 changes: 6 additions & 3 deletions sources/jenkins-source/resources/spec.json
Expand Up @@ -13,7 +13,7 @@
"properties": {
"server_url": {
"type": "string",
"description": "Jenkins Server URL",
"title": "Jenkins Server URL",
"examples": [
"https://my-jenkins-server.example.com"
]
Expand All @@ -24,23 +24,26 @@
},
"token": {
"type": "string",
"description": "Jenkins Token",
"title": "Jenkins Token",
"airbyte_secret": true
},
"depth": {
"type": "number",
"title": "Depth",
"description": "Jenkins JSON API does not support deep scan, it is required to generate a suitable tree for the corresponding depth. Job in some cases have many sub jobs, depth needs to quantify how many sub jobs are showed. If depth is not provided we will try to compute it automatically"
},
"pageSize": {
"type": "number",
"default": 10,
"title": "Page Size",
"description": "Quantity of jobs on a single page fetched from Jenkins"
},
"last100Builds": {
"type": "boolean",
"default": false,
"title": "Last 100 Builds Only",
"description": "Fetch only 100 last builds from Jenkins server"
}
}
}
}
}
8 changes: 5 additions & 3 deletions sources/jenkins-source/src/index.ts
Expand Up @@ -8,7 +8,8 @@ import {
} from 'faros-airbyte-cdk';
import VError from 'verror';

import {Jenkins, JenkinsBuilds, JenkinsConfig, JenkinsJobs} from './stream';
import {Jenkins, JenkinsConfig} from './jenkins';
import {JenkinsBuilds, JenkinsJobs} from './streams';

/** The main entry point. */
export function mainCommand(): Command {
Expand All @@ -22,9 +23,10 @@ export class JenkinsSource extends AirbyteSourceBase {
async spec(): Promise<AirbyteSpec> {
return new AirbyteSpec(require('../resources/spec.json'));
}
async checkConnection(config: JenkinsConfig): Promise<[boolean, VError | undefined]> {
async checkConnection(
config: JenkinsConfig
): Promise<[boolean, VError | undefined]> {
const [client, errorMessage] = await Jenkins.validateClient(config);

if (client) {
return [true, undefined];
}
Expand Down