Skip to content

Commit

Permalink
Merge branch 'feat/integration_support' into PR_main_integration_support
Browse files Browse the repository at this point in the history
  • Loading branch information
ArpitShukla12 committed Nov 8, 2023
2 parents 2f69567 + 8ff1a35 commit fe795dd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions adapters/api/create-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ export default async function createResource(
});
});

if (response?.errorCode) return null;
return response;
}
3 changes: 2 additions & 1 deletion adapters/api/segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ export async function sendSegmentEvent(action, body) {
};

var response = null;

if (!IS_DEV) {
response = await fetch(
`${ATLAN_INSTANCE_URL}/api/service/segment/track`,
requestOptions
)
.then(() => {
.then((resp) => {
console.log("send segment event", action, body);
})
.catch((err) => {
Expand Down
7 changes: 6 additions & 1 deletion adapters/integrations/github-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class GitHubIntegration extends IntegrationInterface {
}

if (total_assets !== 0) {
this.sendSegmentEventOfIntegration({
await this.sendSegmentEventOfIntegration({
action: "dbt_ci_action_run",
properties: {
asset_count: total_assets,
Expand Down Expand Up @@ -412,7 +412,9 @@ export default class GitHubIntegration extends IntegrationInterface {
pull_request.html_url,
this.sendSegmentEventOfIntegration
);

const md = getMDCommentForModel(ATLAN_INSTANCE_URL, model);

tableMd += getTableMD(md, resp);
if (!resp) {
setResourceFailed = true;
Expand All @@ -433,10 +435,12 @@ export default class GitHubIntegration extends IntegrationInterface {
pull_request.html_url,
this.sendSegmentEventOfIntegration
);

const md = getMDCommentForMaterialisedView(
ATLAN_INSTANCE_URL,
materialisedView
);

tableMd += getTableMD(md, resp);
if (!resp) {
setResourceFailed = true;
Expand Down Expand Up @@ -858,6 +862,7 @@ ${content}`;
headSHA,
"createIssueComment"
);

return content;
}

Expand Down
2 changes: 1 addition & 1 deletion adapters/integrations/gitlab-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default class GitLabIntegration extends IntegrationInterface {
}

if (total_assets !== 0)
this.sendSegmentEventOfIntegration({
await this.sendSegmentEventOfIntegration({
action: "dbt_ci_action_run",
properties: {
asset_count: total_assets,
Expand Down
13 changes: 10 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25366,6 +25366,7 @@ async function createResource(
});
});

if (response?.errorCode) return null;
return response;
}

Expand All @@ -25386,12 +25387,13 @@ async function sendSegmentEvent(action, body) {
};

var response = null;

if (!IS_DEV) {
response = await src_fetch(
`${ATLAN_INSTANCE_URL}/api/service/segment/track`,
requestOptions
)
.then(() => {
.then((resp) => {
console.log("send segment event", action, body);
})
.catch((err) => {
Expand Down Expand Up @@ -25571,7 +25573,7 @@ class GitHubIntegration extends IntegrationInterface {
}

if (total_assets !== 0) {
this.sendSegmentEventOfIntegration({
await this.sendSegmentEventOfIntegration({
action: "dbt_ci_action_run",
properties: {
asset_count: total_assets,
Expand Down Expand Up @@ -25906,7 +25908,9 @@ class GitHubIntegration extends IntegrationInterface {
pull_request.html_url,
this.sendSegmentEventOfIntegration
);

const md = getMDCommentForModel(ATLAN_INSTANCE_URL, model);

tableMd += getTableMD(md, resp);
if (!resp) {
setResourceFailed = true;
Expand All @@ -25927,10 +25931,12 @@ class GitHubIntegration extends IntegrationInterface {
pull_request.html_url,
this.sendSegmentEventOfIntegration
);

const md = getMDCommentForMaterialisedView(
ATLAN_INSTANCE_URL,
materialisedView
);

tableMd += getTableMD(md, resp);
if (!resp) {
setResourceFailed = true;
Expand Down Expand Up @@ -26352,6 +26358,7 @@ ${content}`;
headSHA,
"createIssueComment"
);

return content;
}

Expand Down Expand Up @@ -34134,7 +34141,7 @@ class GitLabIntegration extends IntegrationInterface {
}

if (total_assets !== 0)
this.sendSegmentEventOfIntegration({
await this.sendSegmentEventOfIntegration({
action: "dbt_ci_action_run",
properties: {
asset_count: total_assets,
Expand Down

0 comments on commit fe795dd

Please sign in to comment.