From 8babec55c635706830e886bec5ec84d88d672619 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 20 Mar 2024 11:30:24 +0100 Subject: [PATCH 1/9] fix: demo feedback --- .github/workflows/integration-flows.yaml | 44 ++++++++++++------- .github/workflows/push-container.yaml | 20 ++++----- package-lock.json | 29 +++++++----- package.json | 1 + packages/shared/lib/clients/sync.client.ts | 12 +++-- .../lib/services/sync/orchestrator.service.ts | 17 +++---- packages/webapp/package.json | 2 +- scripts/flows.js | 9 ++-- scripts/publish.sh | 19 +++++--- 9 files changed, 88 insertions(+), 65 deletions(-) diff --git a/.github/workflows/integration-flows.yaml b/.github/workflows/integration-flows.yaml index 6cffe6be64..7c82ab8a25 100644 --- a/.github/workflows/integration-flows.yaml +++ b/.github/workflows/integration-flows.yaml @@ -7,7 +7,6 @@ on: - staging/** pull_request: - concurrency: group: flows-compile--${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -27,23 +26,34 @@ jobs: - name: Install nango CLI run: | - # Build, install CLI and verify it can run - npm install - npm run build -w @nangohq/node -w @nangohq/shared -w nango - npm install -g ./packages/cli - NANGO_CLI_UPGRADE_MODE=ignore nango version --debug + # Build, install CLI and verify it can run + npm install + npm run build -w @nangohq/node -w @nangohq/shared -w nango + npm install -g ./packages/cli + NANGO_CLI_UPGRADE_MODE=ignore nango version --debug - name: Compile with Nango run: | - set -e - cd integration-templates - for dir in */; do - if [[ "$dir" != "." && "$dir" != "integration-templates/" ]]; then - cd "$dir" - mkdir -p nango-integrations - find . -maxdepth 1 ! -name '.' ! -name 'nango-integrations' -exec mv -t nango-integrations {} + - cd nango-integrations - NANGO_CLI_UPGRADE_MODE=ignore nango compile - cd ../../ + set -e + cd integration-templates + for dir in */; do + if [[ "$dir" != "." && "$dir" != "integration-templates/" ]]; then + cd "$dir" + mkdir -p nango-integrations + find . -maxdepth 1 ! -name '.' ! -name 'nango-integrations' -exec mv -t nango-integrations {} + + cd nango-integrations + NANGO_CLI_UPGRADE_MODE=ignore nango compile + cd ../../ + fi + done + + - name: Make sure flows.yaml is compiled + run: | + node ./scripts/flows.js + + REPO_DIRTY=$(git status --short) + if [[ ! -z "$REPO_DIRTY" ]]; then + echo -e "\r⛔️ flows.yaml hasn't been compiled, please run:" + echo -e "node ./scripts/flows.js" + exit 1 fi - done diff --git a/.github/workflows/push-container.yaml b/.github/workflows/push-container.yaml index 1bd849a66b..4070c86346 100644 --- a/.github/workflows/push-container.yaml +++ b/.github/workflows/push-container.yaml @@ -23,21 +23,19 @@ jobs: - uses: docker/setup-buildx-action@v3 - uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '18.x' - uses: docker/login-action@v3 if: env.CAN_PUSH == 'true' with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push container env: - PUSH: ${{ (env.CAN_PUSH == 'true') && '--push' || '' }} + PUSH: ${{ (env.CAN_PUSH == 'true') && '--push' || '' }} run: | - echo "Building: '${{ inputs.package }}'" - echo "Tags: ${{ inputs.tags }}" - - npm i - npm run ${{ inputs.run-cmd }} - node scripts/flows.js - docker buildx build -f packages/${{ inputs.package }}/Dockerfile --platform linux/amd64 ${{ inputs.tags }} . --no-cache ${{ env.PUSH }} + echo "Building: '${{ inputs.package }}'" + echo "Tags: ${{ inputs.tags }}" + npm i + npm run ${{ inputs.run-cmd }} + docker buildx build -f packages/${{ inputs.package }}/Dockerfile --platform linux/amd64 ${{ inputs.tags }} . --no-cache ${{ env.PUSH }} diff --git a/package-lock.json b/package-lock.json index 5301e40c6f..6fcc8d4841 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", "husky": "^8.0.3", + "js-yaml": "4.1.0", "lint-staged": "15.2.2", "onchange": "^7.1.0", "prettier": "3.2.5", @@ -21884,13 +21885,13 @@ } }, "node_modules/posthog-js": { - "version": "1.57.2", - "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.57.2.tgz", - "integrity": "sha512-ER4gkYZasrd2Zwmt/yLeZ5G/nZJ6tpaYBCpx3CvocDx+3F16WdawJlYMT0IyLKHXDniC5+AsjzFd6fi8uyYlJA==", + "version": "1.116.2", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.116.2.tgz", + "integrity": "sha512-s76+xH91mLt/J05sy7XV4/BzfwTJFU+BoBcv9adYOjD3SAUjUFg21+G2rq9A1rRvMHh0lms4t16TRMlO4L463A==", "dev": true, "dependencies": { - "fflate": "^0.4.1", - "rrweb-snapshot": "^1.1.14" + "fflate": "^0.4.8", + "preact": "^10.19.3" } }, "node_modules/posthog-node": { @@ -21908,6 +21909,16 @@ "version": "2.0.7", "license": "MIT" }, + "node_modules/preact": { + "version": "10.20.0", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.20.0.tgz", + "integrity": "sha512-wU7iZw2BjsaKDal3pDRDy/HpPB6cuFOnVUCcw9aIPKG98+ZrXx3F+szkos8BVME5bquyKDKvRlOJFG8kMkcAbg==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "dev": true, @@ -22950,12 +22961,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rrweb-snapshot": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/rrweb-snapshot/-/rrweb-snapshot-1.1.14.tgz", - "integrity": "sha512-eP5pirNjP5+GewQfcOQY4uBiDnpqxNRc65yKPW0eSoU1XamDfc4M8oqpXGMyUyvLyxFDB0q0+DChuxxiU2FXBQ==", - "dev": true - }, "node_modules/run-async": { "version": "3.0.0", "license": "MIT", @@ -33887,7 +33892,7 @@ "ms": "2.1.3", "postcss": "8.4.35", "postcss-loader": "8.1.1", - "posthog-js": "1.57.2", + "posthog-js": "1.116.2", "query-string": "8.1.0", "react": "18.2.0", "react-code-blocks": "0.0.9-0", diff --git a/package.json b/package.json index 3f39791a20..69ecc1cd27 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", "husky": "^8.0.3", + "js-yaml": "4.1.0", "lint-staged": "15.2.2", "onchange": "^7.1.0", "prettier": "3.2.5", diff --git a/packages/shared/lib/clients/sync.client.ts b/packages/shared/lib/clients/sync.client.ts index 71ce524518..fd600e4bf5 100644 --- a/packages/shared/lib/clients/sync.client.ts +++ b/packages/shared/lib/clients/sync.client.ts @@ -1,12 +1,16 @@ -import { Client, Connection, ScheduleOverlapPolicy, ScheduleDescription } from '@temporalio/client'; +import type { ScheduleDescription } from '@temporalio/client'; +import { Client, Connection, ScheduleOverlapPolicy } from '@temporalio/client'; import type { NangoConnection, Connection as NangoFullConnection } from '../models/Connection.js'; -import ms, { StringValue } from 'ms'; +import type { StringValue } from 'ms'; +import ms from 'ms'; import fs from 'fs-extra'; import type { Config as ProviderConfig } from '../models/Provider.js'; import type { NangoIntegrationData, NangoConfig, NangoIntegration } from '../models/NangoConfig.js'; -import { Sync, SyncStatus, SyncType, ScheduleStatus, SyncCommand, SyncWithSchedule } from '../models/Sync.js'; +import type { Sync, SyncWithSchedule } from '../models/Sync.js'; +import { SyncStatus, SyncType, ScheduleStatus, SyncCommand } from '../models/Sync.js'; import type { ServiceResponse } from '../models/Generic.js'; -import { LogActionEnum, LogLevel } from '../models/Activity.js'; +import type { LogLevel } from '../models/Activity.js'; +import { LogActionEnum } from '../models/Activity.js'; import { SYNC_TASK_QUEUE, WEBHOOK_TASK_QUEUE } from '../constants.js'; import { createActivityLog, diff --git a/packages/shared/lib/services/sync/orchestrator.service.ts b/packages/shared/lib/services/sync/orchestrator.service.ts index bb82a5793b..76da1d9fd9 100644 --- a/packages/shared/lib/services/sync/orchestrator.service.ts +++ b/packages/shared/lib/services/sync/orchestrator.service.ts @@ -21,22 +21,19 @@ import SyncClient from '../../clients/sync.client.js'; import configService from '../config.service.js'; import type { LogLevel } from '../../models/Activity.js'; import type { Connection } from '../../models/Connection.js'; -import type { Job as SyncJob, Schedule as SyncSchedule } from '../../models/Sync.js'; -import { NangoError } from '../../utils/error.js'; -import type { Config as ProviderConfig } from '../../models/Provider.js'; -import type { ServiceResponse } from '../../models/Generic'; -import { - SyncStatus, - ScheduleStatus, - SyncConfigType, +import type { + Job as SyncJob, + Schedule as SyncSchedule, SyncDeploymentResult, IncomingFlowConfig, Sync, SyncType, - SyncCommand, - CommandToActivityLog, ReportedSyncJobStatus } from '../../models/Sync.js'; +import { NangoError } from '../../utils/error.js'; +import type { Config as ProviderConfig } from '../../models/Provider.js'; +import type { ServiceResponse } from '../../models/Generic'; +import { SyncStatus, ScheduleStatus, SyncConfigType, SyncCommand, CommandToActivityLog } from '../../models/Sync.js'; interface CreateSyncArgs { connections: Connection[]; diff --git a/packages/webapp/package.json b/packages/webapp/package.json index c619f9e79f..1d588e4dfc 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -56,7 +56,7 @@ "ms": "2.1.3", "postcss": "8.4.35", "postcss-loader": "8.1.1", - "posthog-js": "1.57.2", + "posthog-js": "1.116.2", "query-string": "8.1.0", "react": "18.2.0", "react-code-blocks": "0.0.9-0", diff --git a/scripts/flows.js b/scripts/flows.js index 8d7a4cfe1b..fe4a9b0bad 100644 --- a/scripts/flows.js +++ b/scripts/flows.js @@ -1,6 +1,7 @@ -import fs from 'fs'; -import path from 'path'; +import fs from 'node:fs'; +import path from 'node:path'; import yaml from 'js-yaml'; +import { exec } from 'node:child_process'; const rootDir = './integration-templates'; @@ -60,4 +61,6 @@ fs.readdirSync(rootDir).forEach((serviceDir) => { } }); -fs.writeFileSync(path.join('./packages/shared', 'flows.yaml'), yaml.dump(output)); +const filePath = path.join('./packages/shared', 'flows.yaml'); +fs.writeFileSync(filePath, yaml.dump(output)); +exec(`npx prettier ${filePath} -w`); diff --git a/scripts/publish.sh b/scripts/publish.sh index 009034a353..d936eae187 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -8,7 +8,7 @@ set -x # $1: package name # $2: package version function bump_and_npm_publish { - if npm view "$1@$2" > /dev/null 2>&1; then + if npm view "$1@$2" >/dev/null 2>&1; then echo "Package '$1@$2' already exists" else echo "Publishing '$1@$2'" @@ -22,23 +22,26 @@ VERSION=$1 # ensure version is of format x.y.z if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "VERSION '$VERSION' is not of format x.y.z" - exit 1 + echo "VERSION '$VERSION' is not of format x.y.z" + exit 1 fi npm install # Node client bump_and_npm_publish "@nangohq/node" "$VERSION" -pushd "$GIT_ROOT_DIR/packages/shared"; npm install @nangohq/node@^$VERSION; popd; +pushd "$GIT_ROOT_DIR/packages/shared" +npm install @nangohq/node@^$VERSION +popd # Shared -node scripts/flows.js bump_and_npm_publish "@nangohq/shared" "$VERSION" # Update all packages to use the new shared version package_dirs=("cli" "server" "runner" "jobs" "persist") for dir in "${package_dirs[@]}"; do - pushd "$GIT_ROOT_DIR/packages/$dir"; npm install @nangohq/shared@^$VERSION; popd; + pushd "$GIT_ROOT_DIR/packages/$dir" + npm install @nangohq/shared@^$VERSION + popd done # CLI @@ -46,7 +49,9 @@ bump_and_npm_publish "nango" "$VERSION" # Frontend bump_and_npm_publish "@nangohq/frontend" "$VERSION" -pushd "$GIT_ROOT_DIR/packages/webapp"; npm install @nangohq/frontend@^$VERSION; popd; +pushd "$GIT_ROOT_DIR/packages/webapp" +npm install @nangohq/frontend@^$VERSION +popd # DEBUG: show changes in CI git diff From ef79fd94d7a1405df892d99512a787b9c6236d47 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 20 Mar 2024 11:37:18 +0100 Subject: [PATCH 2/9] unwanted changes --- packages/shared/lib/clients/sync.client.ts | 12 ++++-------- .../lib/services/sync/orchestrator.service.ts | 17 ++++++++++------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/packages/shared/lib/clients/sync.client.ts b/packages/shared/lib/clients/sync.client.ts index fd600e4bf5..71ce524518 100644 --- a/packages/shared/lib/clients/sync.client.ts +++ b/packages/shared/lib/clients/sync.client.ts @@ -1,16 +1,12 @@ -import type { ScheduleDescription } from '@temporalio/client'; -import { Client, Connection, ScheduleOverlapPolicy } from '@temporalio/client'; +import { Client, Connection, ScheduleOverlapPolicy, ScheduleDescription } from '@temporalio/client'; import type { NangoConnection, Connection as NangoFullConnection } from '../models/Connection.js'; -import type { StringValue } from 'ms'; -import ms from 'ms'; +import ms, { StringValue } from 'ms'; import fs from 'fs-extra'; import type { Config as ProviderConfig } from '../models/Provider.js'; import type { NangoIntegrationData, NangoConfig, NangoIntegration } from '../models/NangoConfig.js'; -import type { Sync, SyncWithSchedule } from '../models/Sync.js'; -import { SyncStatus, SyncType, ScheduleStatus, SyncCommand } from '../models/Sync.js'; +import { Sync, SyncStatus, SyncType, ScheduleStatus, SyncCommand, SyncWithSchedule } from '../models/Sync.js'; import type { ServiceResponse } from '../models/Generic.js'; -import type { LogLevel } from '../models/Activity.js'; -import { LogActionEnum } from '../models/Activity.js'; +import { LogActionEnum, LogLevel } from '../models/Activity.js'; import { SYNC_TASK_QUEUE, WEBHOOK_TASK_QUEUE } from '../constants.js'; import { createActivityLog, diff --git a/packages/shared/lib/services/sync/orchestrator.service.ts b/packages/shared/lib/services/sync/orchestrator.service.ts index 76da1d9fd9..bb82a5793b 100644 --- a/packages/shared/lib/services/sync/orchestrator.service.ts +++ b/packages/shared/lib/services/sync/orchestrator.service.ts @@ -21,19 +21,22 @@ import SyncClient from '../../clients/sync.client.js'; import configService from '../config.service.js'; import type { LogLevel } from '../../models/Activity.js'; import type { Connection } from '../../models/Connection.js'; -import type { - Job as SyncJob, - Schedule as SyncSchedule, +import type { Job as SyncJob, Schedule as SyncSchedule } from '../../models/Sync.js'; +import { NangoError } from '../../utils/error.js'; +import type { Config as ProviderConfig } from '../../models/Provider.js'; +import type { ServiceResponse } from '../../models/Generic'; +import { + SyncStatus, + ScheduleStatus, + SyncConfigType, SyncDeploymentResult, IncomingFlowConfig, Sync, SyncType, + SyncCommand, + CommandToActivityLog, ReportedSyncJobStatus } from '../../models/Sync.js'; -import { NangoError } from '../../utils/error.js'; -import type { Config as ProviderConfig } from '../../models/Provider.js'; -import type { ServiceResponse } from '../../models/Generic'; -import { SyncStatus, ScheduleStatus, SyncConfigType, SyncCommand, CommandToActivityLog } from '../../models/Sync.js'; interface CreateSyncArgs { connections: Connection[]; From adae2dd3cd7de4291561b884d2c606ac8b8ebab1 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 20 Mar 2024 11:50:27 +0100 Subject: [PATCH 3/9] compile file --- packages/shared/flows.yaml | 155 ++++++++----------------------------- 1 file changed, 31 insertions(+), 124 deletions(-) diff --git a/packages/shared/flows.yaml b/packages/shared/flows.yaml index fda9df471c..99e4a15b91 100644 --- a/packages/shared/flows.yaml +++ b/packages/shared/flows.yaml @@ -3,7 +3,7 @@ integrations: actions: algolia-create-contacts: description: | - Action to add a single record contact to an index in Asana + Action to add a single record contact to an index output: AlgoliaContact input: AlgoliaCreateContactInput endpoint: POST /algolia/create-contacts @@ -20,8 +20,9 @@ integrations: syncs: asana-tasks: runs: every 30min - description: | - Fetches tasks from Asana, retrieving tasks from only the first project of the first workspace + description: > + Fetches a list of tasks from Asana, retrieving tasks from only the + first project of the first workspace scopes: - default output: AsanaTask @@ -43,8 +44,9 @@ integrations: description: | Fetches a list of all candidates from your ashby account metadata: - description: | - We need to save a candidatelastsyncToken to track and update candidates' synchronizations + description: > + We need to save a candidatelastsyncToken to track and update + candidates' synchronizations scopes: candidatelastsyncToken sync_type: incremental endpoint: /ashby/candidates @@ -54,8 +56,9 @@ integrations: description: | Fetches a list of all jobs from your ashby account metadata: - description: | - We need to save a jobslastsyncToken to track and update jobs' synchronizations + description: > + We need to save a jobslastsyncToken to track and update jobs' + synchronizations scopes: jobslastsyncToken sync_type: incremental endpoint: /ashby/jobs @@ -270,8 +273,9 @@ integrations: clari-copilot-call: runs: every hour output: ClariCopilotCall - description: | - Fetches a list of calls from your account. For the first sync, it will go back to the past one year + description: > + Fetches a list of calls from your account. For the first sync, it will + go back to the past one year sync_type: incremental endpoint: /clari-copilot/call models: @@ -452,7 +456,7 @@ integrations: scopes: public_repo description: | Fetches GitHub issues from our showcase repository. - endpoint: /github/demo-issues + endpoint: GET /github/demo-issues actions: github-write-file: scopes: repo @@ -468,10 +472,10 @@ integrations: output: GithubRepo description: | List github repos from an organization. - github-issues-demo-action: - endpoint: POST /github/demo-write-issue - input: GithubWriteIssueInput - output: GithubWriteIssueResult + github-create-demo-issue: + endpoint: POST /github/create-demo-issue + input: GithubCreateIssueInput + output: GithubCreateIssueResult description: | Create a GitHub issue in Nango's showcase repository. models: @@ -532,9 +536,9 @@ integrations: id: integer title: string url: string - GithubWriteIssueInput: + GithubCreateIssueInput: title: string - GithubWriteIssueResult: + GithubCreateIssueResult: url: string | undefined status: number google-calendar: @@ -741,7 +745,7 @@ integrations: into a buffer and return a base64 encoded string that can later be converted into a PDF using an external tool. output: string - endpoint: /google-drive/fetch-pdf + endpoint: POST /google-drive/fetch-pdf scopes: https://www.googleapis.com/auth/drive.readonly models: DocumentMetadata: @@ -1349,106 +1353,7 @@ integrations: projectName: string createdAt: date updatedAt: date - lever-basic: - actions: - lever-create-note: - description: | - Action to create a note and add it to a candidate profile in Lever - output: LeverOpportunityNote - input: LeverCreateNoteInput - endpoint: POST /lever/create-note - scopes: - - notes:write:admin - lever-create-opportunity: - description: | - Action to create candidates and opportunities in Lever - output: LeverOpportunity - input: LeverCreateOpportunityInput - endpoint: POST /lever/create-opportunity - scopes: - - opportunities:write:admin - syncs: - lever-opportunities: - runs: every 6 hours - description: | - Fetches a list of all pipeline opportunities for contacts in Lever - output: LeverOpportunity - sync_type: incremental - endpoint: /lever/opportunities - scopes: - - opportunities:read:admin - lever-opportunities-applications: - runs: every 6 hours - description: | - Fetches a list of all applications for a candidate in Lever - output: LeverOpportunityApplication - sync_type: full - endpoint: /lever/opportunities-applications - scopes: - - applications:read:admin - lever-opportunities-feedbacks: - runs: every 6 hours - description: | - Fetches a list of all feedback forms for a candidate for a specific Opportunity in lever - output: LeverOpportunityFeedback - sync_type: full - endpoint: /lever/opportunities-feedbacks - scopes: - - feedback:read:admin - lever-opportunities-interviews: - runs: every 6 hours - description: | - Fetches a list of all interviewers for a specific Opportunity in lever - output: LeverOpportunityInterview - sync_type: full - endpoint: /lever/opportunities-interviews - scopes: - - interviews:read:admin - lever-opportunities-notes: - runs: every 6 hours - description: | - Fetches a list of all notes for a specific candidate in lever - output: LeverOpportunityNote - sync_type: full - endpoint: /lever/opportunities-notes - scopes: - - notes:read:admin - lever-opportunities-offers: - runs: every 6 hours - description: | - Fetches a list of all offers for a specific candidate in lever. - output: LeverOpportunityOffer - sync_type: full - endpoint: /lever/opportunities-offers - scopes: - - offers:write:admin - lever-postings: - runs: every 6 hours - description: | - Fetches a list of all postings in Lever - output: LeverPosting - sync_type: full - endpoint: /lever/postings - scopes: - - postings:read:admin - lever-postings-apply: - runs: every 6 hours - description: | - Fetches a list of all questions included in a posting’s application form in Lever - output: LeverPostingApply - sync_type: full - endpoint: /lever/postings-apply - scopes: - - postings:read:admin - lever-stage: - runs: every 6 hours - description: | - Fetches a list of all pipeline stages in Lever - output: LeverStage - sync_type: full - endpoint: /lever/stage - scopes: - - stages:read:admin + lever: models: LeverOpportunity: id: string @@ -1661,28 +1566,28 @@ integrations: linear-issues: runs: every 5min description: | - Fetch a list of issues from Linear + Fetches a list of issues from Linear output: LinearIssue sync_type: incremental endpoint: /linear/issues linear-projects: runs: every 5min description: | - Fetch a list of projects from Linear + Fetches a list of projects from Linear output: LinearProject sync_type: incremental endpoint: /linear/projects linear-teams: runs: every 5min description: | - Fetch a list of teams from Linear + Fetches a list of teams from Linear output: LinearTeam sync_type: incremental endpoint: /linear/teams linear-roadmaps: runs: every 5min description: | - Fetch a list of roadmaps from Linear + Fetches a list of roadmaps from Linear output: LinearRoadmap sync_type: incremental endpoint: /linear/roadmaps @@ -1781,8 +1686,8 @@ integrations: next-cloud-users: runs: every hour description: | - Fetch a list of all users' details from NextCloud account - output: 'NextCloudUser' + Fetches a list of all users' details from NextCloud account + output: NextCloudUser sync_type: full endpoint: /next-cloud-ocs/next-cloud-users models: @@ -2234,7 +2139,7 @@ integrations: teamtailor-candidates: runs: every 6 hours description: | - Fetches a list of all candidates from your teamtailor account + Fetches a list of all candidates from your teamtailor account. output: TeamtailorCandidate sync_type: full endpoint: /teamtailor/candidates @@ -2320,6 +2225,8 @@ integrations: syncs: wildix-pbx-colleagues: runs: every 1 hour + description: | + Fetches a list of users from PBX output: WildixPbxColleague sync_type: full endpoint: /wildix-pbx/colleagues From dba93d6b2893accda846329e55ae5f0a103832c1 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:04:33 +0100 Subject: [PATCH 4/9] log more stuff --- .github/workflows/integration-flows.yaml | 2 ++ scripts/flows.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-flows.yaml b/.github/workflows/integration-flows.yaml index 7c82ab8a25..1cdb8ba310 100644 --- a/.github/workflows/integration-flows.yaml +++ b/.github/workflows/integration-flows.yaml @@ -53,6 +53,8 @@ jobs: REPO_DIRTY=$(git status --short) if [[ ! -z "$REPO_DIRTY" ]]; then + git log -p + echo "" echo -e "\r⛔️ flows.yaml hasn't been compiled, please run:" echo -e "node ./scripts/flows.js" exit 1 diff --git a/scripts/flows.js b/scripts/flows.js index fe4a9b0bad..0bffe91502 100644 --- a/scripts/flows.js +++ b/scripts/flows.js @@ -63,4 +63,6 @@ fs.readdirSync(rootDir).forEach((serviceDir) => { const filePath = path.join('./packages/shared', 'flows.yaml'); fs.writeFileSync(filePath, yaml.dump(output)); -exec(`npx prettier ${filePath} -w`); +exec(`npx prettier ${filePath} -w`, (error) => { + console.error(error); +}); From 5d7b85d734f6373c166868f9a803b46b10d19460 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:12:04 +0100 Subject: [PATCH 5/9] fethc depth --- .github/workflows/integration-flows.yaml | 13 ------------- .github/workflows/tests.yaml | 17 ++++++++++++++++- scripts/flows.js | 4 +++- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/integration-flows.yaml b/.github/workflows/integration-flows.yaml index 1cdb8ba310..6b81caaacb 100644 --- a/.github/workflows/integration-flows.yaml +++ b/.github/workflows/integration-flows.yaml @@ -46,16 +46,3 @@ jobs: cd ../../ fi done - - - name: Make sure flows.yaml is compiled - run: | - node ./scripts/flows.js - - REPO_DIRTY=$(git status --short) - if [[ ! -z "$REPO_DIRTY" ]]; then - git log -p - echo "" - echo -e "\r⛔️ flows.yaml hasn't been compiled, please run:" - echo -e "node ./scripts/flows.js" - exit 1 - fi diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 96182d2967..444bb744f3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -7,7 +7,6 @@ on: - staging/** pull_request: - concurrency: group: tests-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -21,6 +20,9 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: '0' + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: @@ -28,3 +30,16 @@ jobs: - run: npm run build:hosted - run: npm run test:unit - run: npm run test:integration + + - name: Make sure flows.yaml is compiled + run: | + node ./scripts/flows.js + + REPO_DIRTY=$(git status --short) + if [[ ! -z "$REPO_DIRTY" ]]; then + git log -p + echo "" + echo -e "\r⛔️ flows.yaml hasn't been compiled, please run:" + echo -e "node ./scripts/flows.js" + exit 1 + fi diff --git a/scripts/flows.js b/scripts/flows.js index 0bffe91502..812599733c 100644 --- a/scripts/flows.js +++ b/scripts/flows.js @@ -64,5 +64,7 @@ fs.readdirSync(rootDir).forEach((serviceDir) => { const filePath = path.join('./packages/shared', 'flows.yaml'); fs.writeFileSync(filePath, yaml.dump(output)); exec(`npx prettier ${filePath} -w`, (error) => { - console.error(error); + if (error) { + console.error('An error occured during prettier', error); + } }); From 1bb1fe38183f93b6e55da8fa77a863a223cf9fd1 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:20:20 +0100 Subject: [PATCH 6/9] test failing --- packages/shared/flows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/flows.yaml b/packages/shared/flows.yaml index 99e4a15b91..eb1f9a2992 100644 --- a/packages/shared/flows.yaml +++ b/packages/shared/flows.yaml @@ -473,7 +473,7 @@ integrations: description: | List github repos from an organization. github-create-demo-issue: - endpoint: POST /github/create-demo-issue + endpoint: POST /githusb/create-demo-issue input: GithubCreateIssueInput output: GithubCreateIssueResult description: | From ec4d87e6f3e35296292a6040114dcd626a13ae06 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:26:31 +0100 Subject: [PATCH 7/9] make it less big --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 444bb744f3..e4a3d1ce01 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,7 +37,7 @@ jobs: REPO_DIRTY=$(git status --short) if [[ ! -z "$REPO_DIRTY" ]]; then - git log -p + git diff echo "" echo -e "\r⛔️ flows.yaml hasn't been compiled, please run:" echo -e "node ./scripts/flows.js" From 7fee95426724df747a42d253cdac219cee02bf4a Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:30:20 +0100 Subject: [PATCH 8/9] revert fake error --- packages/shared/flows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/flows.yaml b/packages/shared/flows.yaml index eb1f9a2992..99e4a15b91 100644 --- a/packages/shared/flows.yaml +++ b/packages/shared/flows.yaml @@ -473,7 +473,7 @@ integrations: description: | List github repos from an organization. github-create-demo-issue: - endpoint: POST /githusb/create-demo-issue + endpoint: POST /github/create-demo-issue input: GithubCreateIssueInput output: GithubCreateIssueResult description: | From 9e938efacaf80762df0bd85d01a60ac365bcef2f Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:28:31 +0100 Subject: [PATCH 9/9] build on pre-commit --- .husky/pre-commit | 2 ++ scripts/flows.js | 1 + 2 files changed, 3 insertions(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index abf1181ca3..676b404b7e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,6 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" +node ./scripts/flows.js +git add ./packages/shared/flows.yaml npx lint-staged --allow-empty diff --git a/scripts/flows.js b/scripts/flows.js index 812599733c..6087fc7221 100644 --- a/scripts/flows.js +++ b/scripts/flows.js @@ -66,5 +66,6 @@ fs.writeFileSync(filePath, yaml.dump(output)); exec(`npx prettier ${filePath} -w`, (error) => { if (error) { console.error('An error occured during prettier', error); + process.exit(1); } });