diff --git a/adapters/integrations/atlan-contract-impact-analysis-github.js b/adapters/integrations/atlan-contract-impact-analysis-github.js index 5920e3f..5ca1fa5 100644 --- a/adapters/integrations/atlan-contract-impact-analysis-github.js +++ b/adapters/integrations/atlan-contract-impact-analysis-github.js @@ -76,7 +76,7 @@ export default class ContractIntegration extends IntegrationInterface { total_assets = await this.printDownstreamAssets({ octokit, context }); } - if (total_assets !== 0) { + if (total_assets !== 0 && total_assets != undefined) { await this.sendSegmentEventOfIntegration({ action: `${actionName}_run`, properties: { @@ -112,7 +112,6 @@ export default class ContractIntegration extends IntegrationInterface { ); try { - const changedFiles = await this.getChangedFiles({ octokit, context }); let comments = ``; let warningComments = ``; let totalChangedFiles = 0; @@ -144,6 +143,8 @@ export default class ContractIntegration extends IntegrationInterface { return; } + const changedFiles = await this.getChangedFiles({ octokit, context }); + for (const { fileName, filePath, status } of changedFiles) { // Skipping non yaml files if (!filePath.endsWith('.yaml') && !filePath.endsWith('.yml')) { diff --git a/adapters/integrations/github-integration.js b/adapters/integrations/github-integration.js index 9c69ec2..d8c7b00 100644 --- a/adapters/integrations/github-integration.js +++ b/adapters/integrations/github-integration.js @@ -78,7 +78,7 @@ export default class GitHubIntegration extends IntegrationInterface { total_assets = await this.setResourceOnAsset({ octokit, context }); } - if (total_assets !== 0) { + if (total_assets !== 0 && total_assets != undefined) { await this.sendSegmentEventOfIntegration({ action: "dbt_ci_action_run", properties: { diff --git a/adapters/integrations/gitlab-integration.js b/adapters/integrations/gitlab-integration.js index 2ecc26e..0926b78 100644 --- a/adapters/integrations/gitlab-integration.js +++ b/adapters/integrations/gitlab-integration.js @@ -43,6 +43,7 @@ import { Gitlab } from "@gitbeaker/rest"; import IntegrationInterface from "./contract/contract.js"; import logger from "../logger/logger.js"; import stringify from "json-stringify-safe"; + const integrationName = "gitlab"; var CI_MERGE_REQUEST_IID; @@ -117,7 +118,7 @@ export default class GitLabIntegration extends IntegrationInterface { }); } - if (total_assets !== 0) + if (total_assets !== 0 && total_assets != undefined) await this.sendSegmentEventOfIntegration({ action: "dbt_ci_action_run", properties: { diff --git a/dist/index.js b/dist/index.js index c63786d..9f7591a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29832,7 +29832,7 @@ class ContractIntegration extends IntegrationInterface { total_assets = await this.printDownstreamAssets({ octokit, context }); } - if (total_assets !== 0) { + if (total_assets !== 0 && total_assets != undefined) { await this.sendSegmentEventOfIntegration({ action: `${actionName}_run`, properties: { @@ -29868,7 +29868,6 @@ class ContractIntegration extends IntegrationInterface { ); try { - const changedFiles = await this.getChangedFiles({ octokit, context }); let comments = ``; let warningComments = ``; let totalChangedFiles = 0; @@ -29900,6 +29899,8 @@ class ContractIntegration extends IntegrationInterface { return; } + const changedFiles = await this.getChangedFiles({ octokit, context }); + for (const { fileName, filePath, status } of changedFiles) { // Skipping non yaml files if (!filePath.endsWith('.yaml') && !filePath.endsWith('.yml')) { @@ -30685,7 +30686,7 @@ class GitHubIntegration extends IntegrationInterface { total_assets = await this.setResourceOnAsset({ octokit, context }); } - if (total_assets !== 0) { + if (total_assets !== 0 && total_assets != undefined) { await this.sendSegmentEventOfIntegration({ action: "dbt_ci_action_run", properties: { @@ -39182,6 +39183,7 @@ var { + const gitlab_integration_integrationName = "gitlab"; var CI_MERGE_REQUEST_IID; @@ -39256,7 +39258,7 @@ class GitLabIntegration extends IntegrationInterface { }); } - if (total_assets !== 0) + if (total_assets !== 0 && total_assets != undefined) await this.sendSegmentEventOfIntegration({ action: "dbt_ci_action_run", properties: {