Skip to content

Commit

Permalink
Merge pull request #13 from rtekal/rtekal-pl-join-ui-ERModelRelation
Browse files Browse the repository at this point in the history
Rtekal pl join UI er model relation
  • Loading branch information
rtekal authored Jan 22, 2024
2 parents 085e472 + 8e727c3 commit 07c6a18
Show file tree
Hide file tree
Showing 947 changed files with 45,836 additions and 27,331 deletions.
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/node_modules/
datahub-frontend/build/
metadata-ingestion/venv/
*/build/
*/*/build/
*/venv/
out
**/*.class
# Have to copy gradle/wrapper/gradle-wrapper.jar, can't exclude ALL jars
Expand Down
11 changes: 10 additions & 1 deletion .github/actions/docker-custom-build-and-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,20 @@ runs:
push: false
cache-from: type=registry,ref=${{ steps.docker_meta.outputs.tags }}
cache-to: type=inline
- name: Single Tag
if: ${{ inputs.publish != 'true' }}
shell: bash
run: |
TAGS="""
${{ steps.docker_meta.outputs.tags }}
"""
echo "SINGLE_TAG=$(echo $TAGS | tr '\n' ' ' | awk -F' ' '{ print $1 }')" >> $GITHUB_OUTPUT
id: single_tag
- name: Upload image locally for testing (if not publishing)
uses: ishworkh/docker-image-artifact-upload@v1
if: ${{ inputs.publish != 'true' }}
with:
image: ${{ steps.docker_meta.outputs.tags }}
image: ${{ steps.single_tag.outputs.SINGLE_TAG }}

# Code for building multi-platform images and pushing to Docker Hub.
- name: Set up QEMU
Expand Down
28 changes: 20 additions & 8 deletions .github/scripts/check_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
elif urn == "urn:li:dataHubPolicy:editor-platform-policy":
editor_platform_policy_privileges = policy["info"]["privileges"]
elif urn == "urn:li:dataHubPolicy:7":
all_user_platform_policy_privilges = policy["info"]["privileges"]
all_user_platform_policy_privileges = policy["info"]["privileges"]
try:
doc_type = policy["info"]["type"]
privileges = policy["info"]["privileges"]
Expand Down Expand Up @@ -54,10 +54,22 @@
)
assert len(diff_policies) == 0, f"Missing privileges for root user are {diff_policies}"

diff_policies = set(editor_platform_policy_privileges).difference(
set(all_user_platform_policy_privilges)
)
assert "MANAGE_POLICIES" not in all_user_platform_policy_privilges
assert (
len(diff_policies) == 0
), f"Missing privileges for all user policies are {diff_policies}"
# All users privileges checks
assert "MANAGE_POLICIES" not in all_user_platform_policy_privileges
assert "MANAGE_USERS_AND_GROUPS" not in all_user_platform_policy_privileges
assert "MANAGE_SECRETS" not in all_user_platform_policy_privileges
assert "MANAGE_USER_CREDENTIALS" not in all_user_platform_policy_privileges
assert "MANAGE_ACCESS_TOKENS" not in all_user_platform_policy_privileges
assert "EDIT_ENTITY" not in all_user_platform_policy_privileges
assert "DELETE_ENTITY" not in all_user_platform_policy_privileges

# Editor checks
assert "MANAGE_POLICIES" not in editor_platform_policy_privileges
assert "MANAGE_USERS_AND_GROUPS" not in editor_platform_policy_privileges
assert "MANAGE_SECRETS" not in editor_platform_policy_privileges
assert "MANAGE_USER_CREDENTIALS" not in editor_platform_policy_privileges
assert "MANAGE_ACCESS_TOKENS" not in editor_platform_policy_privileges
# These don't prevent a user from modifying entities they are an asset owner of, i.e. their own profile info
assert "EDIT_CONTACT_INFO" not in editor_platform_policy_privileges
assert "EDIT_USER_PROFILE" not in editor_platform_policy_privileges
assert "EDIT_ENTITY_OWNERS" not in editor_platform_policy_privileges
6 changes: 3 additions & 3 deletions .github/scripts/docker_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ export SHORT_SHA=$(get_short_sha)
echo "SHORT_SHA: $SHORT_SHA"

function get_tag {
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG}\,${SHORT_SHA},g" -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1,g')
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG},g" -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1,g'),${SHORT_SHA}
}

function get_tag_slim {
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG}-slim\,${SHORT_SHA}-slim,g" -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-slim,g')
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG}-slim,g" -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-slim,g'),${SHORT_SHA}-slim
}

function get_tag_full {
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG}-full\,${SHORT_SHA}-full,g" -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-full,g')
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${MAIN_BRANCH_TAG}-full,g" -e 's,refs/tags/,,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-full,g'),${SHORT_SHA}-full
}

function get_python_docker_release_v {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/airflow-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ on:
- "metadata-models/**"
pull_request:
branches:
- master
- "**"
paths:
- ".github/**"
- ".github/workflows/airflow-plugin.yml"
- "metadata-ingestion-modules/airflow-plugin/**"
- "metadata-ingestion/**"
- "metadata-models/**"
Expand Down
29 changes: 14 additions & 15 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- "**.md"
pull_request:
branches:
- master
- "**"
paths-ignore:
- "docs/**"
- "**.md"
Expand All @@ -24,26 +24,19 @@ jobs:
strategy:
fail-fast: false
matrix:
command:
[
command: [
# metadata-ingestion and airflow-plugin each have dedicated build jobs
"./gradlew build -x :metadata-ingestion:build -x :metadata-ingestion:check -x docs-website:build -x :metadata-integration:java:spark-lineage:test -x :metadata-io:test -x :metadata-ingestion-modules:airflow-plugin:build -x :metadata-ingestion-modules:airflow-plugin:check -x :datahub-frontend:build -x :datahub-web-react:build --parallel",
"./gradlew :datahub-frontend:build :datahub-web-react:build --parallel",
]
timezone:
[
"UTC",
"America/New_York",
"except_metadata_ingestion",
"frontend",
]
timezone: ["UTC", "America/New_York"]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: szenius/[email protected]
with:
timezoneLinux: ${{ matrix.timezone }}
- uses: actions/checkout@v3
with:
fetch-depth: 800
- uses: hsheth2/sane-checkout-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand All @@ -53,9 +46,15 @@ jobs:
with:
python-version: "3.10"
cache: pip
- name: Gradle build (and test)
- name: Gradle build (and test) for metadata ingestion
# we only need the timezone runs for frontend tests
if: ${{ matrix.command == 'except_metadata_ingestion' && matrix.timezone == 'America/New_York' }}
run: |
./gradlew build -x :metadata-ingestion:build -x :metadata-ingestion:check -x docs-website:build -x :metadata-integration:java:spark-lineage:test -x :metadata-io:test -x :metadata-ingestion-modules:airflow-plugin:build -x :metadata-ingestion-modules:airflow-plugin:check -x :datahub-frontend:build -x :datahub-web-react:build --parallel
- name: Gradle build (and test) for frontend
if: ${{ matrix.command == 'frontend' }}
run: |
${{ matrix.command }}
./gradlew :datahub-frontend:build :datahub-web-react:build --parallel
env:
NODE_OPTIONS: "--max-old-space-size=3072"
- uses: actions/upload-artifact@v3
Expand Down
25 changes: 7 additions & 18 deletions .github/workflows/check-datahub-jars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ on:
push:
branches:
- master
paths-ignore:
- "docker/**"
- "docs/**"
- "**.md"
paths:
- "metadata-integration"
pull_request:
branches:
- master
paths-ignore:
- "docker/**"
- "docs/**"
- "**.md"
- "**"
paths:
- "metadata-integration"
release:
types: [published]

Expand All @@ -28,17 +24,10 @@ jobs:
max-parallel: 1
fail-fast: false
matrix:
command:
[
"datahub-client",
"datahub-protobuf",
"spark-lineage"
]
command: ["datahub-client", "datahub-protobuf", "spark-lineage"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 800
- uses: hsheth2/sane-checkout-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
days-before-issue-stale: 30
days-before-issue-close: 30
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity. If you believe this is still an issue on the latest DataHub release please leave a comment with the version that you tested it with. If this is a question/discussion please head to https://slack.datahubproject.io. For feature requests please use https://feature-requests.datahubproject.io"
stale-issue-message:
"This issue is stale because it has been open for 30 days with no activity. If you believe this is still an issue on the latest DataHub release please leave a comment with the version that you tested it with. If this is a question/discussion please head to https://slack.datahubproject.io.\
\ For feature requests please use https://feature-requests.datahubproject.io"
close-issue-message: "This issue was closed because it has been inactive for 30 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- ".github/workflows/code-checks.yml"
pull_request:
branches:
- master
- "**"
paths:
- "metadata-io/**"
- "datahub-web-react/**"
Expand All @@ -21,27 +21,20 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true


jobs:
code_check:
strategy:
fail-fast: false
matrix:
command:
[
"check_event_type.py",
"check_policies.py"
]
command: ["check_event_type.py", "check_policies.py"]
name: run code checks
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: run check ${{ matrix.command }}
run: |
python .github/scripts/${{ matrix.command }}
run: |-
python .github/scripts/${{ matrix.command }}
5 changes: 2 additions & 3 deletions .github/workflows/docker-ingestion-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ jobs:
name: Build and Push Docker Image to Docker Hub
runs-on: ubuntu-latest
needs: setup
if: ${{ needs.setup.outputs.publish == 'true' }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/docker-postgres-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- ".github/workflows/docker-postgres-setup.yml"
pull_request:
branches:
- master
- "**"
paths:
- "docker/postgres-setup/**"
- ".github/workflows/docker-postgres-setup.yml"
Expand Down Expand Up @@ -46,9 +46,7 @@ jobs:
needs: setup
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 800
uses: hsheth2/sane-checkout-action@v1
- name: Build and push
uses: ./.github/actions/docker-custom-build-and-push
with:
Expand All @@ -61,4 +59,3 @@ jobs:
context: .
file: ./docker/postgres-setup/Dockerfile
platforms: linux/amd64,linux/arm64

Loading

0 comments on commit 07c6a18

Please sign in to comment.