From 8a1b8bd0cce0bc021357e6f1c97063924c2085e0 Mon Sep 17 00:00:00 2001 From: Rittik Dasgupta Date: Mon, 30 Sep 2024 13:27:36 +0530 Subject: [PATCH 1/2] rename(repo): change dbt-action to atlan-action --- README.md | 14 +++++++------- SETUP.md | 4 ++-- action.yml | 4 ++-- adapters/templates/github-integration.js | 4 ++-- adapters/templates/gitlab-integration.js | 6 +++--- dist/index.js | 17 +++++++++++++---- package-lock.json | 6 +++--- package.json | 15 ++++++++------- 8 files changed, 40 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index cd7a69a..f2f77e3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Atlan dbt Action +# Atlan Action ![atlan<>dbt](https://user-images.githubusercontent.com/14099191/209542321-54d5557e-8abf-4d9a-9f6d-dcacb856f25f.png) ## Overview -_Have you ever changed a dbt model only to later find it broke a downstream table or dashboard? 💔_ +_Have you ever changed a dbt model or a data contract only to later find it broke a downstream table or dashboard? 💔_ 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. @@ -31,7 +31,7 @@ Here's what it looks like 👇 2. Add the following code to the workflow file: ```yaml - name: Atlan dbt action + name: Atlan action on: pull_request: @@ -43,7 +43,7 @@ Here's what it looks like 👇 runs-on: ubuntu-latest steps: - name: Run Action - uses: atlanhq/dbt-action@v1 + uses: atlanhq/atlan-action@v2 with: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} ATLAN_INSTANCE_URL: ${{secrets.ATLAN_INSTANCE_URL}} @@ -52,7 +52,7 @@ Here's what it looks like 👇 ## Test the action -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: +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: - The GitHub workflow will add and update a single comment for every file change. - 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: runs-on: ubuntu-latest steps: - name: Run Action - uses: atlanhq/dbt-action@v1 + uses: atlanhq/atlan-action@v2 with: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} ATLAN_INSTANCE_URL: ${{secrets.ATLAN_INSTANCE_URL}} @@ -105,7 +105,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run Action - uses: atlanhq/dbt-action@v1 + uses: atlanhq/atlan-action@v2 with: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} ATLAN_INSTANCE_URL: ${{secrets.ATLAN_INSTANCE_URL}} diff --git a/SETUP.md b/SETUP.md index feecfeb..da8f0a0 100644 --- a/SETUP.md +++ b/SETUP.md @@ -31,7 +31,7 @@ It is a very useful and easy to use library, which runs your Github Actions loca 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: -- [Fork this repo.](https://github.com/atlanhq/dbt-action/fork) +- [Fork this repo.](https://github.com/atlanhq/atlan-action/fork) - Create a pull request from `test-action` branch to `main` branch. Once you do so, it will automatically run the action. - Go to your forked repo's `Actions` page and open the workflow with the name `Test Action`. - 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 ## Contributing -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. +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. diff --git a/action.yml b/action.yml index e395d45..6b487d4 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ -name: "Atlan dbt Action" -description: "Whenever you make a change to a dbt model, Atlan will add downstream lineage impact context right in your pull requests." +name: "Atlan Action" +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." author: "Atlan" inputs: diff --git a/adapters/templates/github-integration.js b/adapters/templates/github-integration.js index e83eb76..2c409c9 100644 --- a/adapters/templates/github-integration.js +++ b/adapters/templates/github-integration.js @@ -5,7 +5,7 @@ export function getErrorResponseStatus401 (ATLAN_INSTANCE_URL, context) { Atlan Instance URL: ${ATLAN_INSTANCE_URL} -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).` +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).` } export function getErrorResponseStatusUndefined(ATLAN_INSTANCE_URL, context) { @@ -16,7 +16,7 @@ Atlan Instance URL: ${ATLAN_INSTANCE_URL} Make sure your Atlan Instance URL is set in the following format. \`https://tenant.atlan.com\` -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).` +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).` } export function getSetResourceOnAssetComment(tableMd, setResourceFailed) { diff --git a/adapters/templates/gitlab-integration.js b/adapters/templates/gitlab-integration.js index b7913db..75c00a2 100644 --- a/adapters/templates/gitlab-integration.js +++ b/adapters/templates/gitlab-integration.js @@ -1,11 +1,11 @@ -import { getImageURL, getConnectorImage, getCertificationImage } from "../utils/index.js"; +import { getCertificationImage, getConnectorImage, getImageURL } from "../utils/index.js"; export function getErrorResponseStatus401 (ATLAN_INSTANCE_URL, CI_PROJECT_NAME, CI_PROJECT_NAMESPACE) { 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. Atlan Instance URL: ${ATLAN_INSTANCE_URL} -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).` +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).` } export function getErrorResponseStatusUndefined(ATLAN_INSTANCE_URL, CI_PROJECT_NAME, CI_PROJECT_NAMESPACE) { @@ -16,7 +16,7 @@ Atlan Instance URL: ${ATLAN_INSTANCE_URL} Make sure your Atlan Instance URL is set in the following format. \`https://tenant.atlan.com\` -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).` +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).` } export function getSetResourceOnAssetComment(tableMd, setResourceFailed) { diff --git a/dist/index.js b/dist/index.js index baa20cd..d2667e3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -24831,7 +24831,7 @@ function getErrorResponseStatus401 (ATLAN_INSTANCE_URL, context) { Atlan Instance URL: ${ATLAN_INSTANCE_URL} -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).` +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).` } function getErrorResponseStatusUndefined(ATLAN_INSTANCE_URL, context) { @@ -24842,7 +24842,7 @@ Atlan Instance URL: ${ATLAN_INSTANCE_URL} Make sure your Atlan Instance URL is set in the following format. \`https://tenant.atlan.com\` -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).` +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).` } function getSetResourceOnAssetComment(tableMd, setResourceFailed) { @@ -25120,6 +25120,15 @@ async function getContractAsset({ term: { qualifiedName: assetQualifiedName } + }, + { + terms: { + "__typeName.keyword": [ + "Table", + "MaterialisedView", + "View" + ] + } } ] } @@ -39056,7 +39065,7 @@ function gitlab_integration_getErrorResponseStatus401 (ATLAN_INSTANCE_URL, CI_PR Atlan Instance URL: ${ATLAN_INSTANCE_URL} -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).` +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).` } function gitlab_integration_getErrorResponseStatusUndefined(ATLAN_INSTANCE_URL, CI_PROJECT_NAME, CI_PROJECT_NAMESPACE) { @@ -39067,7 +39076,7 @@ Atlan Instance URL: ${ATLAN_INSTANCE_URL} Make sure your Atlan Instance URL is set in the following format. \`https://tenant.atlan.com\` -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).` +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).` } function gitlab_integration_getSetResourceOnAssetComment(tableMd, setResourceFailed) { diff --git a/package-lock.json b/package-lock.json index 0803521..4ad69f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@atlanhq/dbt-action", + "name": "@atlanhq/atlan-action", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@atlanhq/dbt-action", + "name": "@atlanhq/atlan-action", "version": "1.0.0", "license": "MIT", "dependencies": { @@ -683,4 +683,4 @@ "integrity": "sha512-UmFXIPU+9Eg3E9m/728Bii0lAIuoc+6nbrNUKaRPJOFp91ih44qqGlWtxMB6kXFrRD6po+86ksHM5XHCfk6iPw==" } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 52ddad8..8167e6c 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,20 @@ { - "name": "@atlanhq/dbt-action", + "name": "@atlanhq/atlan-action", "version": "1.0.0", - "description": "Get all the downstream assets that get affected when dbt model sql files are changed on pull request conversations.", + "description": "Get all the downstream assets that get affected when dbt model or data contract sql files are changed on pull request conversations.", "main": "dist/index.js", "type": "module", "repository": { "type": "git", - "url": "git+https://github.com/atlanhq/dbt-action.git" + "url": "git+https://github.com/atlanhq/atlan-action.git" }, "keywords": [ "github", "actions", "atlan", "atlanhq", - "dbt-action" + "dbt-action", + "atlan-action" ], "scripts": { "build": "ncc build adapters/index.js -o dist", @@ -23,9 +24,9 @@ "author": "Jaagrav Seal (https://atlan.com/)", "license": "MIT", "bugs": { - "url": "https://github.com/atlanhq/dbt-action/issues" + "url": "https://github.com/atlanhq/atlan-action/issues" }, - "homepage": "https://github.com/atlanhq/dbt-action#readme", + "homepage": "https://github.com/atlanhq/atlan-action#readme", "dependencies": { "@actions/core": "^1.10.0", "@actions/github": "^5.1.1", @@ -43,4 +44,4 @@ "devDependencies": { "@types/json-stringify-safe": "^5.0.2" } -} +} \ No newline at end of file From a9e002f61bfa39743e0b964c29fba8840c82f4a1 Mon Sep 17 00:00:00 2001 From: Rittik Dasgupta Date: Mon, 30 Sep 2024 16:32:22 +0530 Subject: [PATCH 2/2] doc(readme): add hyperlink to data contract docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f2f77e3..8772a50 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Overview -_Have you ever changed a dbt model or a data contract only to later find it broke a downstream table or dashboard? 💔_ +_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? 💔_ 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.