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

DQ-457 enhancement(analytics): add properties to segment events #142

Merged
merged 1 commit into from
Oct 24, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions adapters/integrations/github-integration.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
// githubIntegration.js
import IntegrationInterface from "./contract/contract.js";
import github from "@actions/github";
import stringify from "json-stringify-safe";
import {
ATLAN_INSTANCE_URL,
IGNORE_MODEL_ALIAS_MATCHING,
IS_DEV,
} from "../utils/get-environment-variables.js";
import {
auth,
getCertificationImage,
getConnectorImage,
getEnvironments,
auth,
truncate,
} from "../utils/index.js";
import {
createResource,
getAsset,
getClassifications,
getDownstreamAssets,
sendSegmentEvent,
createResource,
getClassifications,
} from "../api/index.js";
import {
getSetResourceOnAssetComment,
getErrorResponseStatus401,
getErrorResponseStatusUndefined,
getAssetInfo,
getDownstreamTable,
getViewAssetButton,
getMDCommentForModel,
getErrorResponseStatus401,
getErrorResponseStatusUndefined,
getMDCommentForMaterialisedView,
getMDCommentForModel,
getSetResourceOnAssetComment,
getTableMD,
getViewAssetButton,
} from "../templates/github-integration.js";
import { getNewModelAddedComment, getBaseComment } from "../templates/atlan.js";
import {
IS_DEV,
ATLAN_INSTANCE_URL,
IGNORE_MODEL_ALIAS_MATCHING,
} from "../utils/get-environment-variables.js";
import { getBaseComment, getNewModelAddedComment } from "../templates/atlan.js";

// githubIntegration.js
import IntegrationInterface from "./contract/contract.js";
import github from "@actions/github";
import logger from "../logger/logger.js";
import stringify from "json-stringify-safe";
var headSHA;
const integrationName = "github";
export default class GitHubIntegration extends IntegrationInterface {
Expand Down Expand Up @@ -575,6 +576,8 @@ export default class GitHubIntegration extends IntegrationInterface {
...properties,
github_action_id: `https://github.com/${context?.payload?.repository?.full_name}/actions/runs/${context?.runId}`,
domain,
base_asset_type: "dbtModel",
action_repo_name: "dbt-action"
},
});

Expand Down
63 changes: 33 additions & 30 deletions adapters/integrations/gitlab-integration.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
// gitlabIntegration.js
import IntegrationInterface from "./contract/contract.js";
import { Gitlab } from "@gitbeaker/rest";
import {
createResource,
getAsset,
getDownstreamAssets,
sendSegmentEvent,
getClassifications,
} from "../api/index.js";
ATLAN_INSTANCE_URL,
CI_COMMIT_MESSAGE,
CI_COMMIT_SHA,
CI_JOB_URL,
CI_PROJECT_ID,
CI_PROJECT_NAME,
CI_PROJECT_NAMESPACE,
CI_PROJECT_PATH,
IGNORE_MODEL_ALIAS_MATCHING,
IS_DEV,
getCIMergeRequestIID,
} from "../utils/get-environment-variables.js";
import {
auth,
getConnectorImage,
getCertificationImage,
getConnectorImage,
getGitLabEnvironments,
truncate,
} from "../utils/index.js";
import stringify from "json-stringify-safe";
import {
getSetResourceOnAssetComment,
getErrorResponseStatus401,
getErrorResponseStatusUndefined,
createResource,
getAsset,
getClassifications,
getDownstreamAssets,
sendSegmentEvent,
} from "../api/index.js";
import {
getAssetInfo,
getDownstreamTable,
getViewAssetButton,
getMDCommentForModel,
getErrorResponseStatus401,
getErrorResponseStatusUndefined,
getMDCommentForMaterialisedView,
getMDCommentForModel,
getSetResourceOnAssetComment,
getTableMD,
getViewAssetButton,
} from "../templates/gitlab-integration.js";
import { getNewModelAddedComment, getBaseComment } from "../templates/atlan.js";
import {
IS_DEV,
ATLAN_INSTANCE_URL,
CI_PROJECT_PATH,
CI_PROJECT_ID,
CI_JOB_URL,
IGNORE_MODEL_ALIAS_MATCHING,
CI_COMMIT_MESSAGE,
CI_PROJECT_NAME,
CI_COMMIT_SHA,
getCIMergeRequestIID,
CI_PROJECT_NAMESPACE,
} from "../utils/get-environment-variables.js";
import { getBaseComment, getNewModelAddedComment } from "../templates/atlan.js";

import { Gitlab } from "@gitbeaker/rest";
// gitlabIntegration.js
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;

Expand Down Expand Up @@ -647,6 +648,8 @@ ${content}`;
...properties,
gitlab_job_id: CI_JOB_URL,
domain,
base_asset_type: "dbtModel",
action_repo_name: "dbt-action"
},
});

Expand Down
Loading
Loading