-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from atlanhq/DQ-384-contract-impact-analysis
DQ-384 feat(contract): add support for contract impact analysis
- Loading branch information
Showing
18 changed files
with
7,341 additions
and
876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: GitHub-Jira Link Action | ||
run-name: ${{ github.actor }} is ensuring Jira ID is present in PR title | ||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize, reopened] | ||
branches: [main, staging, develop] | ||
|
||
jobs: | ||
Enforce-GitHub-Jira-Link-Action: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.pull_request.head.ref != 'staging' && github.event.pull_request.head.ref != 'develop' && github.event.pull_request.head.ref != 'main' }} | ||
steps: | ||
- name: Enforce Pull Request Title includes Jira Issue Key | ||
uses: ryanvade/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,7 @@ | |
node_modules/ | ||
event.json | ||
.idea | ||
.DS_Store | ||
.DS_Store | ||
.vscode/ | ||
contracts/ | ||
.atlan/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { | ||
ATLAN_API_TOKEN, | ||
ATLAN_INSTANCE_URL, | ||
} from "../utils/get-environment-variables.js"; | ||
|
||
import fetch from "node-fetch"; | ||
|
||
export default async function getAssetClassifications() { | ||
var myHeaders = { | ||
Authorization: `Bearer ${ATLAN_API_TOKEN}`, | ||
"Content-Type": "application/json", | ||
}; | ||
|
||
var requestOptions = { | ||
method: "GET", | ||
headers: myHeaders, | ||
redirect: "follow", | ||
}; | ||
|
||
var response = await fetch( | ||
`${ATLAN_INSTANCE_URL}/api/meta/types/typedefs?type=classification`, | ||
requestOptions | ||
) | ||
.then((e) => e.json()) | ||
.catch((err) => { | ||
return { | ||
error: err | ||
} | ||
}); | ||
if (response.error) return response | ||
|
||
return response?.classificationDefs; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import { | ||
ATLAN_API_TOKEN, | ||
ATLAN_INSTANCE_URL, | ||
} from "../utils/get-environment-variables.js"; | ||
|
||
import fetch from "node-fetch"; | ||
import { | ||
getErrorAssetNotFound, | ||
} from "../templates/atlan.js"; | ||
import stringify from "json-stringify-safe"; | ||
|
||
export default async function getContractAsset({ | ||
dataset, | ||
assetQualifiedName, | ||
}) { | ||
var myHeaders = { | ||
Authorization: `Bearer ${ATLAN_API_TOKEN}`, | ||
"Content-Type": "application/json", | ||
}; | ||
|
||
var raw = stringify( | ||
{ | ||
dsl: { | ||
from: 0, | ||
size: 1, | ||
query: { | ||
bool: { | ||
must: [ | ||
{ | ||
match: { | ||
__state: "ACTIVE" | ||
} | ||
}, | ||
{ | ||
term: { | ||
qualifiedName: assetQualifiedName | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
attributes: [ | ||
"guid", | ||
"name", | ||
"description", | ||
"userDescription", | ||
"sourceURL", | ||
"qualifiedName", | ||
"connectorName", | ||
"certificateStatus", | ||
"certificateUpdatedBy", | ||
"certificateUpdatedAt", | ||
"ownerUsers", | ||
"ownerGroups", | ||
"classificationNames", | ||
"meanings" | ||
], | ||
suppressLogs: true, | ||
showSearchScore: false, | ||
excludeClassifications: true, | ||
includeClassificationNames: true, | ||
excludeMeanings: false | ||
} | ||
); | ||
|
||
var requestOptions = { | ||
method: "POST", | ||
headers: myHeaders, | ||
body: raw, | ||
}; | ||
|
||
var response = await fetch( | ||
`${ATLAN_INSTANCE_URL}/api/meta/search/indexsearch`, | ||
requestOptions | ||
) | ||
.then((e) => e.json()) | ||
.catch((err) => { | ||
return { | ||
error: err, | ||
comment: getErrorAssetNotFound(dataset) | ||
} | ||
}); | ||
|
||
if (!response?.entities?.length) { | ||
return { | ||
error: "asset not found", | ||
comment: getErrorAssetNotFound(dataset), | ||
}; | ||
} | ||
|
||
return response.entities[0]; | ||
} |
Oops, something went wrong.