Skip to content

Commit

Permalink
Merge branch 'staging' into bug-fixes
Browse files Browse the repository at this point in the history
# Conflicts:
#	dist/index.js
#	src/main/print-downstream-assets.js
#	src/utils/create-comment.js
  • Loading branch information
Jaagrav committed Jan 18, 2023
2 parents bc3ff77 + 01e9c7d commit 83f79de
Show file tree
Hide file tree
Showing 8 changed files with 1,385 additions and 1,386 deletions.
Binary file removed .DS_Store
Binary file not shown.
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,37 @@

## Overview

*Have you changed a dbt model and realised that it broke a table or a dashboard downstream 💔?*
*Have you ever changed a dbt model only to later find it broke a downstream table or dashboard? 💔*

To solve that, we’ve created a GitHub action that will add Atlan's lineage context right in your pull request. So before
merging the PR, you know the downstream impact of the change. Here's how it'll look like 👇
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.

![Github Action comment screenshot](https://iili.io/HI7d0zB.png)
Here's what it looks like 👇

![GitHub Action comment screenshot](https://iili.io/HI7d0zB.png)

## Prerequisites

- **Atlan API key**[How to create Atlan api key.](https://ask.atlan.com/hc/en-us/articles/8312649180049)
- **Atlan API token**before you can run the action, you need an [Atlan API token](https://ask.atlan.com/hc/en-us/articles/8312649180049).

## How to setup
## Configure the action

1. Set Atlan Instance URL and API Token as repository secrets in your repository.
1. [How to set GitHub Action secrets in your repository.](https://github.com/Azure/actions-workflow-samples/blob/master/assets/create-secrets-for-GitHub-workflows.md#creating-secrets)
1. Create [repository secrets](https://github.com/Azure/actions-workflow-samples/blob/master/assets/create-secrets-for-GitHub-workflows.md#creating-secrets) in your repository:
- `ATLAN_INSTANCE_URL` with the URL of your Atlan instance.
- `ATLAN_API_TOKEN` with the value of the API token.

![Actions Secrets Screenshot](https://iili.io/HI7gfx2.png)
![Actions Secrets Screenshot](https://iili.io/HI7gfx2.png)

2. Add the GitHub Action to your workflow
1. Create a file in the root directory of your repository, `.github/workflows/atlan-action.yml`
2. Add the following code to your workflow file.
2. Add the GitHub Action to your workflow:
1. Create a workflow file in your repository: `.github/workflows/atlan-dbt.yml`
2. Add the following code to the workflow file:

```yaml
name: Atlan dbt action

on:
pull_request:
types: [opened, edited, synchronize, reopened, closed]

jobs:
get-downstream-impact:
name: Get Downstream Assets
Expand All @@ -44,18 +46,17 @@ merging the PR, you know the downstream impact of the change. Here's how it'll l
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
ATLAN_INSTANCE_URL: ${{secrets.ATLAN_INSTANCE_URL}}
ATLAN_API_TOKEN: ${{secrets.ATLAN_API_TOKEN}}

```
## How to test
## Test the action
After you've completed both steps in setup, try creating a PR where you've changed any model file. You'll see Atlan
Github action running in action and adding comments in your pull request.
To test the action, after you've completed the configuration above create a pull request with a changed dbt model file. You should see the Atlan
GitHub action running and then adding comments in your pull request.
## Inputs
| Name | Description | Required |
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| GITHUB_TOKEN | Needed to write comments on PRs to print all the downstream assets. https://dev.to/github/the-githubtoken-in-github-actions-how-it-works-change-permissions-customizations-3cgp | true |
| ATLAN_INSTANCE_URL | Needed for making API requests to the user's tenant. | true |
| ATLAN_API_TOKEN | Needed for authenticating API requests to the user's tenant. https://ask.atlan.com/hc/en-us/articles/8312649180049 | true |
| `GITHUB_TOKEN` | Needed to write comments on PRs to print all the downstream assets. https://dev.to/github/the-githubtoken-in-github-actions-how-it-works-change-permissions-customizations-3cgp | true |
| `ATLAN_INSTANCE_URL` | Needed for making API requests to the user's tenant. | true |
| `ATLAN_API_TOKEN` | Needed for authenticating API requests to the user's tenant. https://ask.atlan.com/hc/en-us/articles/8312649180049 | true |
Loading

0 comments on commit 83f79de

Please sign in to comment.