Skip to content

Commit 34b6b0d

Browse files
enhancement(analytics): add properties to segment events
1 parent eb81104 commit 34b6b0d

File tree

5 files changed

+35667
-48
lines changed

5 files changed

+35667
-48
lines changed

adapters/integrations/github-integration.js

+21-18
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
1-
// githubIntegration.js
2-
import IntegrationInterface from "./contract/contract.js";
3-
import github from "@actions/github";
4-
import stringify from "json-stringify-safe";
51
import {
2+
ATLAN_INSTANCE_URL,
3+
IGNORE_MODEL_ALIAS_MATCHING,
4+
IS_DEV,
5+
} from "../utils/get-environment-variables.js";
6+
import {
7+
auth,
68
getCertificationImage,
79
getConnectorImage,
810
getEnvironments,
9-
auth,
1011
truncate,
1112
} from "../utils/index.js";
1213
import {
14+
createResource,
1315
getAsset,
16+
getClassifications,
1417
getDownstreamAssets,
1518
sendSegmentEvent,
16-
createResource,
17-
getClassifications,
1819
} from "../api/index.js";
1920
import {
20-
getSetResourceOnAssetComment,
21-
getErrorResponseStatus401,
22-
getErrorResponseStatusUndefined,
2321
getAssetInfo,
2422
getDownstreamTable,
25-
getViewAssetButton,
26-
getMDCommentForModel,
23+
getErrorResponseStatus401,
24+
getErrorResponseStatusUndefined,
2725
getMDCommentForMaterialisedView,
26+
getMDCommentForModel,
27+
getSetResourceOnAssetComment,
2828
getTableMD,
29+
getViewAssetButton,
2930
} from "../templates/github-integration.js";
30-
import { getNewModelAddedComment, getBaseComment } from "../templates/atlan.js";
31-
import {
32-
IS_DEV,
33-
ATLAN_INSTANCE_URL,
34-
IGNORE_MODEL_ALIAS_MATCHING,
35-
} from "../utils/get-environment-variables.js";
31+
import { getBaseComment, getNewModelAddedComment } from "../templates/atlan.js";
32+
33+
// githubIntegration.js
34+
import IntegrationInterface from "./contract/contract.js";
35+
import github from "@actions/github";
3636
import logger from "../logger/logger.js";
37+
import stringify from "json-stringify-safe";
3738
var headSHA;
3839
const integrationName = "github";
3940
export default class GitHubIntegration extends IntegrationInterface {
@@ -575,6 +576,8 @@ export default class GitHubIntegration extends IntegrationInterface {
575576
...properties,
576577
github_action_id: `https://github.com/${context?.payload?.repository?.full_name}/actions/runs/${context?.runId}`,
577578
domain,
579+
base_asset_type: "dbtModel",
580+
action_repo_name: "dbt-action"
578581
},
579582
});
580583

adapters/integrations/gitlab-integration.js

+33-30
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,48 @@
1-
// gitlabIntegration.js
2-
import IntegrationInterface from "./contract/contract.js";
3-
import { Gitlab } from "@gitbeaker/rest";
41
import {
5-
createResource,
6-
getAsset,
7-
getDownstreamAssets,
8-
sendSegmentEvent,
9-
getClassifications,
10-
} from "../api/index.js";
2+
ATLAN_INSTANCE_URL,
3+
CI_COMMIT_MESSAGE,
4+
CI_COMMIT_SHA,
5+
CI_JOB_URL,
6+
CI_PROJECT_ID,
7+
CI_PROJECT_NAME,
8+
CI_PROJECT_NAMESPACE,
9+
CI_PROJECT_PATH,
10+
IGNORE_MODEL_ALIAS_MATCHING,
11+
IS_DEV,
12+
getCIMergeRequestIID,
13+
} from "../utils/get-environment-variables.js";
1114
import {
1215
auth,
13-
getConnectorImage,
1416
getCertificationImage,
17+
getConnectorImage,
1518
getGitLabEnvironments,
1619
truncate,
1720
} from "../utils/index.js";
18-
import stringify from "json-stringify-safe";
1921
import {
20-
getSetResourceOnAssetComment,
21-
getErrorResponseStatus401,
22-
getErrorResponseStatusUndefined,
22+
createResource,
23+
getAsset,
24+
getClassifications,
25+
getDownstreamAssets,
26+
sendSegmentEvent,
27+
} from "../api/index.js";
28+
import {
2329
getAssetInfo,
2430
getDownstreamTable,
25-
getViewAssetButton,
26-
getMDCommentForModel,
31+
getErrorResponseStatus401,
32+
getErrorResponseStatusUndefined,
2733
getMDCommentForMaterialisedView,
34+
getMDCommentForModel,
35+
getSetResourceOnAssetComment,
2836
getTableMD,
37+
getViewAssetButton,
2938
} from "../templates/gitlab-integration.js";
30-
import { getNewModelAddedComment, getBaseComment } from "../templates/atlan.js";
31-
import {
32-
IS_DEV,
33-
ATLAN_INSTANCE_URL,
34-
CI_PROJECT_PATH,
35-
CI_PROJECT_ID,
36-
CI_JOB_URL,
37-
IGNORE_MODEL_ALIAS_MATCHING,
38-
CI_COMMIT_MESSAGE,
39-
CI_PROJECT_NAME,
40-
CI_COMMIT_SHA,
41-
getCIMergeRequestIID,
42-
CI_PROJECT_NAMESPACE,
43-
} from "../utils/get-environment-variables.js";
39+
import { getBaseComment, getNewModelAddedComment } from "../templates/atlan.js";
40+
41+
import { Gitlab } from "@gitbeaker/rest";
42+
// gitlabIntegration.js
43+
import IntegrationInterface from "./contract/contract.js";
4444
import logger from "../logger/logger.js";
45+
import stringify from "json-stringify-safe";
4546
const integrationName = "gitlab";
4647
var CI_MERGE_REQUEST_IID;
4748

@@ -647,6 +648,8 @@ ${content}`;
647648
...properties,
648649
gitlab_job_id: CI_JOB_URL,
649650
domain,
651+
base_asset_type: "dbtModel",
652+
action_repo_name: "dbt-action"
650653
},
651654
});
652655

0 commit comments

Comments
 (0)