Skip to content

Commit 77e39e9

Browse files
Revert "DQ-384 rename(dbt-action): change dbt-action to atlan action"
1 parent d8e827a commit 77e39e9

12 files changed

+61
-166
lines changed

.github/workflows/test-action.yml

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: Test Action
33
on:
44
pull_request:
55
types: [opened, edited, synchronize, reopened, closed]
6-
paths:
7-
- 'test/**'
86

97
jobs:
108
get-downstream-assets:

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Atlan Action
1+
# Atlan dbt Action
22

33
![atlan<>dbt](https://user-images.githubusercontent.com/14099191/209542321-54d5557e-8abf-4d9a-9f6d-dcacb856f25f.png)
44

55
## Overview
66

7-
_Have you ever changed a dbt model or a [data contract](https://ask.atlan.com/hc/en-us/articles/9281528742799-How-to-create-data-contracts) only to later find it broke a downstream table or dashboard? 💔_
7+
_Have you ever changed a dbt model only to later find it broke a downstream table or dashboard? 💔_
88

99
We've created a GitHub Action to help you out — putting Atlan's impact analysis right into your pull request. So now, before merging the PR, you can see the potential downstream impact of your changes.
1010

@@ -31,7 +31,7 @@ Here's what it looks like 👇
3131
2. Add the following code to the workflow file:
3232

3333
```yaml
34-
name: Atlan action
34+
name: Atlan dbt action
3535

3636
on:
3737
pull_request:
@@ -43,7 +43,7 @@ Here's what it looks like 👇
4343
runs-on: ubuntu-latest
4444
steps:
4545
- name: Run Action
46-
uses: atlanhq/atlan-action@v2
46+
uses: atlanhq/dbt-action@v1
4747
with:
4848
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
4949
ATLAN_INSTANCE_URL: ${{secrets.ATLAN_INSTANCE_URL}}
@@ -52,7 +52,7 @@ Here's what it looks like 👇
5252
5353
## Test the action
5454
55-
After you've completed the configuration above, create a pull request with a changed dbt model or data contract file to test the action. You should see the Atlan GitHub action running and then adding comments in your pull request:
55+
After you've completed the configuration above, create a pull request with a changed dbt model file to test the action. You should see the Atlan GitHub action running and then adding comments in your pull request:
5656
5757
- The GitHub workflow will add and update a single comment for every file change.
5858
- The impacted assets in the comment will be displayed in a collapsible section and grouped by source and asset type.
@@ -84,7 +84,7 @@ jobs:
8484
runs-on: ubuntu-latest
8585
steps:
8686
- name: Run Action
87-
uses: atlanhq/atlan-action@v2
87+
uses: atlanhq/dbt-action@v1
8888
with:
8989
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
9090
ATLAN_INSTANCE_URL: ${{secrets.ATLAN_INSTANCE_URL}}
@@ -105,7 +105,7 @@ jobs:
105105
runs-on: ubuntu-latest
106106
steps:
107107
- name: Run Action
108-
uses: atlanhq/atlan-action@v2
108+
uses: atlanhq/dbt-action@v1
109109
with:
110110
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
111111
ATLAN_INSTANCE_URL: ${{secrets.ATLAN_INSTANCE_URL}}

SETUP.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ It is a very useful and easy to use library, which runs your Github Actions loca
3131

3232
Since you as a developer would be using your Github PAT to test the action locally, you'll need to locally run the clone of your fork, in order to generate the event.json file, follow the following steps:
3333

34-
- [Fork this repo.](https://github.com/atlanhq/atlan-action/fork)
34+
- [Fork this repo.](https://github.com/atlanhq/dbt-action/fork)
3535
- Create a pull request from `test-action` branch to `main` branch. Once you do so, it will automatically run the action.
3636
- Go to your forked repo's `Actions` page and open the workflow with the name `Test Action`.
3737
- Click on the one and only job, `Get Downstream Assets`.
@@ -58,4 +58,4 @@ Once and if `act` is setup properly, then you can simply use the command `npm st
5858

5959
## Contributing
6060

61-
Please make sure to use the command `npm run sync` in order to sync changes, since the workflow [`.github/workflows/package-action.yml`](https://github.com/atlanhq/atlan-action/blob/main/.github/workflows/package-action.yml) updates the `dist/` in order to package the action code in case you forget to package the action before pushing.
61+
Please make sure to use the command `npm run sync` in order to sync changes, since the workflow [`.github/workflows/package-action.yml`](https://github.com/atlanhq/dbt-action/blob/main/.github/workflows/package-action.yml) updates the `dist/` in order to package the action code in case you forget to package the action before pushing.

action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: "Atlan Action"
2-
description: "Whenever you make a change to a dbt model or a data contract, Atlan will add downstream lineage impact context right in your pull requests."
1+
name: "Atlan dbt Action"
2+
description: "Whenever you make a change to a dbt model, Atlan will add downstream lineage impact context right in your pull requests."
33
author: "Atlan"
44

55
inputs:

adapters/api/get-contract-asset.js

-9
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ export default async function getContractAsset({
3535
term: {
3636
qualifiedName: assetQualifiedName
3737
}
38-
},
39-
{
40-
terms: {
41-
"__typeName.keyword": [
42-
"Table",
43-
"MaterialisedView",
44-
"View"
45-
]
46-
}
4738
}
4839
]
4940
}

adapters/integrations/atlan-contract-impact-analysis-github.js

+1
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ ${viewAssetButton}`;
843843

844844
// Iterate through the object to find relevant keys
845845
for (const [key, value] of Object.entries(configYaml)) {
846+
console.log(key);
846847
if (key.startsWith('data_source ')) {
847848
// Trim the prefix and add to the Map
848849
const trimmedKey = key.replace('data_source ', '');

adapters/integrations/gitlab-integration.js

+15-58
Original file line numberDiff line numberDiff line change
@@ -779,66 +779,23 @@ ${content}`;
779779
CI_COMMIT_SHA,
780780
"getAssetName"
781781
);
782-
const startRegex =
783-
/{{\s*config\s*\(/im;
784-
const startMatch = fileContents.match(startRegex);
785-
let configSection = ''
786-
if (startMatch) {
787-
const startIndex = startMatch.index;
788-
const openParensIndex = fileContents.indexOf('(', startIndex) + 1;
789-
let openParensCount = 1;
790-
let endIndex = openParensIndex;
791-
792-
while (openParensCount > 0 && endIndex < fileContents.length) {
793-
const char = fileContents[endIndex];
794-
795-
if (char === '(') {
796-
openParensCount++;
797-
} else if (char === ')') {
798-
openParensCount--;
799-
}
800-
endIndex++;
801-
}
802-
803-
const endMarker = '}}';
804-
const finalEndIndex = fileContents.indexOf(endMarker, endIndex) + endMarker.length;
805-
806-
configSection = fileContents.substring(startIndex, finalEndIndex);
807-
logger.withInfo(
808-
"Extracted config section",
809-
integrationName,
810-
CI_COMMIT_SHA,
811-
"getAssetName"
812-
);
813-
814-
if (configSection){
815-
logger.withInfo(
816-
"Executing final regex",
817-
integrationName,
818-
CI_COMMIT_SHA,
819-
"getAssetName"
820-
);
821-
822-
var matches = regExp.exec(configSection);
823-
824-
logger.withInfo(
825-
"Successfully executed regex matching",
826-
integrationName,
827-
CI_COMMIT_SHA,
828-
"getAssetName"
829-
);
782+
var matches = regExp.exec(fileContents);
830783

831-
}
832-
if (matches) {
833-
logger.withInfo(
834-
`Found a match: ${matches[1].trim()}`,
835-
integrationName,
836-
CI_COMMIT_SHA,
837-
"getAssetName"
838-
);
784+
logger.withInfo(
785+
"Successfully executed regex matching",
786+
integrationName,
787+
CI_COMMIT_SHA,
788+
"getAssetName"
789+
);
839790

840-
return matches[1].trim();
841-
}
791+
if (matches) {
792+
logger.withInfo(
793+
`Found a match: ${matches[1].trim()}`,
794+
integrationName,
795+
CI_COMMIT_SHA,
796+
"getAssetName"
797+
);
798+
return matches[1].trim();
842799
}
843800
}
844801

adapters/templates/github-integration.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function getErrorResponseStatus401 (ATLAN_INSTANCE_URL, context) {
55
66
Atlan Instance URL: ${ATLAN_INSTANCE_URL}
77
8-
Set your repository action secrets [here](https://github.com/${context.payload.repository.full_name}/settings/secrets/actions). For more information on how to setup the Atlan Action, please read the [setup documentation here](https://github.com/atlanhq/atlan-action/blob/main/README.md).`
8+
Set your repository action secrets [here](https://github.com/${context.payload.repository.full_name}/settings/secrets/actions). For more information on how to setup the Atlan dbt Action, please read the [setup documentation here](https://github.com/atlanhq/dbt-action/blob/main/README.md).`
99
}
1010

1111
export function getErrorResponseStatusUndefined(ATLAN_INSTANCE_URL, context) {
@@ -16,7 +16,7 @@ Atlan Instance URL: ${ATLAN_INSTANCE_URL}
1616
Make sure your Atlan Instance URL is set in the following format.
1717
\`https://tenant.atlan.com\`
1818
19-
Set your repository action secrets [here](https://github.com/${context.payload.repository.full_name}/settings/secrets/actions). For more information on how to setup the Atlan Action, please read the [setup documentation here](https://github.com/atlanhq/atlan-action/blob/main/README.md).`
19+
Set your repository action secrets [here](https://github.com/${context.payload.repository.full_name}/settings/secrets/actions). For more information on how to setup the Atlan dbt Action, please read the [setup documentation here](https://github.com/atlanhq/dbt-action/blob/main/README.md).`
2020
}
2121

2222
export function getSetResourceOnAssetComment(tableMd, setResourceFailed) {

adapters/templates/gitlab-integration.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { getCertificationImage, getConnectorImage, getImageURL } from "../utils/index.js";
1+
import { getImageURL, getConnectorImage, getCertificationImage } from "../utils/index.js";
22

33
export function getErrorResponseStatus401 (ATLAN_INSTANCE_URL, CI_PROJECT_NAME, CI_PROJECT_NAMESPACE) {
44
return `We couldn't connect to your Atlan Instance, please make sure to set the valid Atlan Bearer Token as \`ATLAN_API_TOKEN\` as this repository's CI/CD variable.
55
66
Atlan Instance URL: ${ATLAN_INSTANCE_URL}
77
8-
Set your CI/CD variables [here](https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/settings/ci_cd). For more information on how to setup the Atlan Action, please read the [setup documentation here](https://ask.atlan.com/hc/en-us/articles/8284983222415).`
8+
Set your CI/CD variables [here](https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/settings/ci_cd). For more information on how to setup the Atlan dbt Action, please read the [setup documentation here](https://ask.atlan.com/hc/en-us/articles/8284983222415).`
99
}
1010

1111
export function getErrorResponseStatusUndefined(ATLAN_INSTANCE_URL, CI_PROJECT_NAME, CI_PROJECT_NAMESPACE) {
@@ -16,7 +16,7 @@ Atlan Instance URL: ${ATLAN_INSTANCE_URL}
1616
Make sure your Atlan Instance URL is set in the following format.
1717
\`https://tenant.atlan.com\`
1818
19-
Set your CI/CD variables [here](https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/settings/ci_cd). For more information on how to setup the Atlan Action, please read the [setup documentation here](https://ask.atlan.com/hc/en-us/articles/8284983222415).`
19+
Set your CI/CD variables [here](https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/settings/ci_cd). For more information on how to setup the Atlan dbt Action, please read the [setup documentation here](https://ask.atlan.com/hc/en-us/articles/8284983222415).`
2020
}
2121

2222
export function getSetResourceOnAssetComment(tableMd, setResourceFailed) {

dist/index.js

+20-71
Original file line numberDiff line numberDiff line change
@@ -24831,7 +24831,7 @@ function getErrorResponseStatus401 (ATLAN_INSTANCE_URL, context) {
2483124831

2483224832
Atlan Instance URL: ${ATLAN_INSTANCE_URL}
2483324833

24834-
Set your repository action secrets [here](https://github.com/${context.payload.repository.full_name}/settings/secrets/actions). For more information on how to setup the Atlan Action, please read the [setup documentation here](https://github.com/atlanhq/atlan-action/blob/main/README.md).`
24834+
Set your repository action secrets [here](https://github.com/${context.payload.repository.full_name}/settings/secrets/actions). For more information on how to setup the Atlan dbt Action, please read the [setup documentation here](https://github.com/atlanhq/dbt-action/blob/main/README.md).`
2483524835
}
2483624836

2483724837
function getErrorResponseStatusUndefined(ATLAN_INSTANCE_URL, context) {
@@ -24842,7 +24842,7 @@ Atlan Instance URL: ${ATLAN_INSTANCE_URL}
2484224842
Make sure your Atlan Instance URL is set in the following format.
2484324843
\`https://tenant.atlan.com\`
2484424844

24845-
Set your repository action secrets [here](https://github.com/${context.payload.repository.full_name}/settings/secrets/actions). For more information on how to setup the Atlan Action, please read the [setup documentation here](https://github.com/atlanhq/atlan-action/blob/main/README.md).`
24845+
Set your repository action secrets [here](https://github.com/${context.payload.repository.full_name}/settings/secrets/actions). For more information on how to setup the Atlan dbt Action, please read the [setup documentation here](https://github.com/atlanhq/dbt-action/blob/main/README.md).`
2484624846
}
2484724847

2484824848
function getSetResourceOnAssetComment(tableMd, setResourceFailed) {
@@ -25120,15 +25120,6 @@ async function getContractAsset({
2512025120
term: {
2512125121
qualifiedName: assetQualifiedName
2512225122
}
25123-
},
25124-
{
25125-
terms: {
25126-
"__typeName.keyword": [
25127-
"Table",
25128-
"MaterialisedView",
25129-
"View"
25130-
]
25131-
}
2513225123
}
2513325124
]
2513425125
}
@@ -30597,6 +30588,7 @@ ${viewAssetButton}`;
3059730588

3059830589
// Iterate through the object to find relevant keys
3059930590
for (const [key, value] of Object.entries(configYaml)) {
30591+
console.log(key);
3060030592
if (key.startsWith('data_source ')) {
3060130593
// Trim the prefix and add to the Map
3060230594
const trimmedKey = key.replace('data_source ', '');
@@ -39065,7 +39057,7 @@ function gitlab_integration_getErrorResponseStatus401 (ATLAN_INSTANCE_URL, CI_PR
3906539057

3906639058
Atlan Instance URL: ${ATLAN_INSTANCE_URL}
3906739059

39068-
Set your CI/CD variables [here](https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/settings/ci_cd). For more information on how to setup the Atlan Action, please read the [setup documentation here](https://ask.atlan.com/hc/en-us/articles/8284983222415).`
39060+
Set your CI/CD variables [here](https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/settings/ci_cd). For more information on how to setup the Atlan dbt Action, please read the [setup documentation here](https://ask.atlan.com/hc/en-us/articles/8284983222415).`
3906939061
}
3907039062

3907139063
function gitlab_integration_getErrorResponseStatusUndefined(ATLAN_INSTANCE_URL, CI_PROJECT_NAME, CI_PROJECT_NAMESPACE) {
@@ -39076,7 +39068,7 @@ Atlan Instance URL: ${ATLAN_INSTANCE_URL}
3907639068
Make sure your Atlan Instance URL is set in the following format.
3907739069
\`https://tenant.atlan.com\`
3907839070

39079-
Set your CI/CD variables [here](https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/settings/ci_cd). For more information on how to setup the Atlan Action, please read the [setup documentation here](https://ask.atlan.com/hc/en-us/articles/8284983222415).`
39071+
Set your CI/CD variables [here](https://gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/settings/ci_cd). For more information on how to setup the Atlan dbt Action, please read the [setup documentation here](https://ask.atlan.com/hc/en-us/articles/8284983222415).`
3908039072
}
3908139073

3908239074
function gitlab_integration_getSetResourceOnAssetComment(tableMd, setResourceFailed) {
@@ -39910,66 +39902,23 @@ ${content}`;
3991039902
CI_COMMIT_SHA,
3991139903
"getAssetName"
3991239904
);
39913-
const startRegex =
39914-
/{{\s*config\s*\(/im;
39915-
const startMatch = fileContents.match(startRegex);
39916-
let configSection = ''
39917-
if (startMatch) {
39918-
const startIndex = startMatch.index;
39919-
const openParensIndex = fileContents.indexOf('(', startIndex) + 1;
39920-
let openParensCount = 1;
39921-
let endIndex = openParensIndex;
39922-
39923-
while (openParensCount > 0 && endIndex < fileContents.length) {
39924-
const char = fileContents[endIndex];
39925-
39926-
if (char === '(') {
39927-
openParensCount++;
39928-
} else if (char === ')') {
39929-
openParensCount--;
39930-
}
39931-
endIndex++;
39932-
}
39933-
39934-
const endMarker = '}}';
39935-
const finalEndIndex = fileContents.indexOf(endMarker, endIndex) + endMarker.length;
39936-
39937-
configSection = fileContents.substring(startIndex, finalEndIndex);
39938-
logger_logger.withInfo(
39939-
"Extracted config section",
39940-
gitlab_integration_integrationName,
39941-
CI_COMMIT_SHA,
39942-
"getAssetName"
39943-
);
39944-
39945-
if (configSection){
39946-
logger_logger.withInfo(
39947-
"Executing final regex",
39948-
gitlab_integration_integrationName,
39949-
CI_COMMIT_SHA,
39950-
"getAssetName"
39951-
);
39952-
39953-
var matches = regExp.exec(configSection);
39954-
39955-
logger_logger.withInfo(
39956-
"Successfully executed regex matching",
39957-
gitlab_integration_integrationName,
39958-
CI_COMMIT_SHA,
39959-
"getAssetName"
39960-
);
39905+
var matches = regExp.exec(fileContents);
3996139906

39962-
}
39963-
if (matches) {
39964-
logger_logger.withInfo(
39965-
`Found a match: ${matches[1].trim()}`,
39966-
gitlab_integration_integrationName,
39967-
CI_COMMIT_SHA,
39968-
"getAssetName"
39969-
);
39907+
logger_logger.withInfo(
39908+
"Successfully executed regex matching",
39909+
gitlab_integration_integrationName,
39910+
CI_COMMIT_SHA,
39911+
"getAssetName"
39912+
);
3997039913

39971-
return matches[1].trim();
39972-
}
39914+
if (matches) {
39915+
logger_logger.withInfo(
39916+
`Found a match: ${matches[1].trim()}`,
39917+
gitlab_integration_integrationName,
39918+
CI_COMMIT_SHA,
39919+
"getAssetName"
39920+
);
39921+
return matches[1].trim();
3997339922
}
3997439923
}
3997539924

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)