Skip to content

Commit 9fbf8f9

Browse files
authored
Merge branch 'master' into sv--cus-2468-data-products-cache-issue
2 parents 5e1cb78 + c4cc514 commit 9fbf8f9

File tree

3,263 files changed

+569313
-57496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,263 files changed

+569313
-57496
lines changed

.github/.codecov.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
comment:
2+
layout: "header, files, footer" # remove "new" from "header" and "footer"
3+
hide_project_coverage: true # set to false
4+
require_changes: false # if true: only post the comment if coverage changes
5+
6+
codecov:
7+
#due to ci-optimization, reports for modules that have not changed may be quite old
8+
max_report_age: off
9+
10+
flag_management:
11+
default_rules: # the rules that will be followed for any flag added, generally
12+
carryforward: true
13+
statuses:
14+
- type: project
15+
target: auto
16+
threshold: 0% #Not enforcing project coverage yet.
17+
- type: patch
18+
target: 90%
19+
individual_flags: # exceptions to the default rules above, stated flag by flag
20+
- name: frontend
21+
paths:
22+
- "datahub-frontend/**"
23+
- "datahub-web-react/**"
24+
- name: backend
25+
paths:
26+
- "metadata-models/**"
27+
- "datahub-upgrade/**"
28+
- "entity-registry/**"
29+
- "li-utils/**"
30+
- "metadata-auth/**"
31+
- "metadata-dao-impl/**"
32+
- "metadata-events/**"
33+
- "metadata-jobs/**"
34+
- "metadata-service/**"
35+
- "metadata-utils/**"
36+
- "metadata-operation-context/**"
37+
- "datahub-graphql-core/**"
38+
- name: metadata-io
39+
paths:
40+
- "metadata-io/**"
41+
- name: ingestion
42+
paths:
43+
- "metadata-ingestion/**"
44+
- name: ingestion-airflow
45+
paths:
46+
- "metadata-ingestion-modules/airflow-plugin/**"
47+
- name: ingestion-dagster
48+
paths:
49+
- "metadata-ingestion-modules/dagster-plugin/**"
50+
- name: ingestion-gx-plugin
51+
paths:
52+
- "metadata-ingestion-modules/gx-plugin/**"
53+
- name: ingestion-prefect
54+
paths:
55+
- "metadata-ingestion-modules/prefect-plugin/**"
56+
coverage:
57+
status:
58+
project:
59+
default:
60+
target: 0% # no threshold enforcement yet
61+
only_pulls: true
62+
patch:
63+
default:
64+
target: 90% # for new code added in the patch
65+
only_pulls: true

.github/actions/ci-optimization/action.yml

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: 'Identify CI Optimizations'
2-
description: 'Determine if code changes are specific to certain modules.'
1+
name: "Identify CI Optimizations"
2+
description: "Determine if code changes are specific to certain modules."
33

44
outputs:
55
frontend-only:
@@ -13,16 +13,16 @@ outputs:
1313
value: ${{ steps.filter.outputs.frontend == 'false' && steps.filter.outputs.ingestion == 'false' && steps.filter.outputs.backend == 'true' }}
1414
backend-change:
1515
description: "Backend code has changed"
16-
value: ${{ steps.filter.outputs.backend == 'true' }}
16+
value: ${{ steps.filter.outputs.backend == 'true' || steps.trigger.outputs.trigger == 'manual' }}
1717
ingestion-change:
1818
description: "Ingestion code has changed"
19-
value: ${{ steps.filter.outputs.ingestion == 'true' }}
19+
value: ${{ steps.filter.outputs.ingestion == 'true' || steps.trigger.outputs.trigger == 'manual' }}
2020
ingestion-base-change:
2121
description: "Ingestion base image docker image has changed"
2222
value: ${{ steps.filter.outputs.ingestion-base == 'true' }}
2323
frontend-change:
2424
description: "Frontend code has changed"
25-
value: ${{ steps.filter.outputs.frontend == 'true' }}
25+
value: ${{ steps.filter.outputs.frontend == 'true' || steps.trigger.outputs.trigger == 'manual' }}
2626
docker-change:
2727
description: "Docker code has changed"
2828
value: ${{ steps.filter.outputs.docker == 'true' }}
@@ -44,27 +44,35 @@ outputs:
4444
runs:
4545
using: "composite"
4646
steps:
47-
- uses: dorny/paths-filter@v2
47+
- name: Check trigger type
48+
id: trigger # Add an ID to reference this step
49+
shell: bash
50+
run: |
51+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
52+
echo "trigger=manual" >> $GITHUB_OUTPUT
53+
else
54+
echo "trigger=pr" >> $GITHUB_OUTPUT
55+
fi
56+
- uses: dorny/paths-filter@v3
4857
id: filter
4958
with:
59+
token: "" # Empty token forces it to use raw git commands.
5060
filters: |
5161
frontend:
5262
- "datahub-frontend/**"
5363
- "datahub-web-react/**"
54-
- "smoke-test/tests/cypress/**"
5564
- "docker/datahub-frontend/**"
5665
ingestion:
5766
- "metadata-ingestion-modules/**"
5867
- "metadata-ingestion/**"
5968
- "metadata-models/**"
60-
- "smoke-test/**"
61-
- "docker/datahub-ingestion**"
69+
- "docker/datahub-ingestion-base/**"
70+
- "docker/datahub-ingestion/**"
6271
ingestion-base:
6372
- "docker/datahub-ingestion-base/**"
6473
docker:
6574
- "docker/**"
6675
backend:
67-
- ".github/**"
6876
- "metadata-models/**"
6977
- "datahub-upgrade/**"
7078
- "entity-registry/**"
@@ -78,7 +86,6 @@ runs:
7886
- "metadata-utils/**"
7987
- "metadata-operation-context/**"
8088
- "datahub-graphql-core/**"
81-
- "smoke-test/**"
8289
- "docker/**"
8390
kafka-setup:
8491
- "docker/kafka-setup/**"

.github/actions/docker-custom-build-and-push/action.yml

+72-28
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,59 @@ inputs:
2626
build-args:
2727
description: "List of build-time variables. Same as docker/build-push-action"
2828
required: false
29-
tags:
30-
# e.g. latest,head,sha12345
31-
description: "List of tags to use for the Docker image"
29+
image_tag:
30+
# e.g. pr12345 OR head OR v0.1.2.3
31+
description: "Main tag to use for the Docker image"
3232
required: true
33+
flavor:
34+
description: "Image flavor (e.g., slim, full)"
35+
required: false
3336
target:
3437
description: "Sets the target stage to build"
3538
required: false
39+
depot-project:
40+
# Setting this will use native arm64 docker builds instead of QEMU emulation.
41+
# This speeds up builds by 2-3x.
42+
description: "Depot project id"
43+
required: false
44+
3645
outputs:
3746
image_tag:
3847
description: "Docker image tags"
3948
value: ${{ steps.docker_meta.outputs.tags }}
40-
# image_name: ${{ env.DATAHUB_GMS_IMAGE }}
4149

4250
runs:
4351
using: "composite"
4452

4553
steps:
4654
- name: Docker meta
4755
id: docker_meta
48-
uses: crazy-max/ghaction-docker-meta@v1
56+
uses: docker/metadata-action@v5
4957
with:
50-
# list of Docker images to use as base name for tags
5158
images: ${{ inputs.images }}
52-
# add git short SHA as Docker tag
53-
tag-custom: ${{ inputs.tags }}
54-
tag-custom-only: true
59+
flavor: |
60+
latest=false
61+
tags: |
62+
type=raw,value=${{ inputs.image_tag }}
63+
type=raw,value=head,suffix=${{ inputs.flavor && format('-{0}', inputs.flavor) || '' }},enable={{is_default_branch}}
64+
type=sha,prefix=,format=short,suffix=${{ inputs.flavor && format('-{0}', inputs.flavor) || '' }}
65+
66+
- name: Single Tag
67+
id: single_tag
68+
shell: bash
69+
run: |
70+
IMAGES="""
71+
${{ inputs.images }}
72+
"""
73+
TAGS="""
74+
${{ inputs.image_tag }}
75+
"""
76+
echo "SINGLE_IMAGE=$(echo $IMAGES | tr '\n' ' ' | awk -F' |,' '{ print $1 }')" >> "$GITHUB_OUTPUT"
77+
echo "SINGLE_TAG=$(echo $IMAGES | tr '\n' ' ' | awk -F' |,' '{ print $1 }'):$(echo $TAGS | tr '\n' ' ' | awk -F' |,' '{ print $1 }')" >> "$GITHUB_OUTPUT"
5578
5679
# Code for testing the build when not pushing to Docker Hub.
5780
- name: Build and Load image for testing (if not publishing)
58-
uses: docker/build-push-action@v5
81+
uses: docker/build-push-action@v6
5982
if: ${{ inputs.publish != 'true' }}
6083
with:
6184
context: ${{ inputs.context }}
@@ -68,39 +91,57 @@ runs:
6891
target: ${{ inputs.target }}
6992
load: true
7093
push: false
71-
cache-from: type=registry,ref=${{ steps.docker_meta.outputs.tags }}
72-
cache-to: type=inline
73-
- name: Single Tag
74-
if: ${{ inputs.publish != 'true' }}
75-
shell: bash
76-
run: |
77-
TAGS="""
78-
${{ steps.docker_meta.outputs.tags }}
79-
"""
80-
echo "SINGLE_TAG=$(echo $TAGS | tr '\n' ' ' | awk -F' ' '{ print $1 }')" >> $GITHUB_OUTPUT
81-
id: single_tag
94+
cache-from: |
95+
type=registry,ref=${{ steps.single_tag.outputs.SINGLE_IMAGE }}:head${{ inputs.flavor && format('-{0}', inputs.flavor) || '' }}
96+
type=registry,ref=${{ steps.docker_meta.outputs.tags }}
97+
cache-to: |
98+
type=inline
8299
- name: Upload image locally for testing (if not publishing)
83-
uses: ishworkh/docker-image-artifact-upload@v1
100+
uses: ishworkh/container-image-artifact-upload@v2.0.0
84101
if: ${{ inputs.publish != 'true' }}
85102
with:
86103
image: ${{ steps.single_tag.outputs.SINGLE_TAG }}
104+
retention_days: "2"
87105

88106
# Code for building multi-platform images and pushing to Docker Hub.
89107
- name: Set up QEMU
90108
uses: docker/setup-qemu-action@v3
91-
if: ${{ inputs.publish == 'true' }}
109+
if: ${{ inputs.publish == 'true' && inputs.depot-project == '' }}
92110
- name: Set up Docker Buildx
93111
uses: docker/setup-buildx-action@v3
94-
if: ${{ inputs.publish == 'true' }}
112+
if: ${{ inputs.publish == 'true' && inputs.depot-project == '' }}
113+
- name: Setup Depot CLI
114+
uses: depot/setup-action@v1
115+
if: ${{ inputs.publish == 'true' && inputs.depot-project != '' }}
95116
- name: Login to DockerHub
96117
uses: docker/login-action@v3
97118
if: ${{ inputs.publish == 'true' }}
98119
with:
99120
username: ${{ inputs.username }}
100121
password: ${{ inputs.password }}
122+
123+
# Depot variant.
101124
- name: Build and Push Multi-Platform image
102-
uses: docker/build-push-action@v5
103-
if: ${{ inputs.publish == 'true' }}
125+
uses: depot/build-push-action@v1
126+
if: ${{ inputs.publish == 'true' && inputs.depot-project != '' }}
127+
with:
128+
project: ${{ inputs.depot-project }}
129+
context: ${{ inputs.context }}
130+
file: ${{ inputs.file }}
131+
platforms: ${{ inputs.platforms }}
132+
build-args: ${{ inputs.build-args }}
133+
tags: ${{ steps.docker_meta.outputs.tags }}
134+
target: ${{ inputs.target }}
135+
push: true
136+
cache-from: |
137+
type=registry,ref=${{ steps.single_tag.outputs.SINGLE_IMAGE }}:head${{ inputs.flavor && format('-{0}', inputs.flavor) || '' }}
138+
type=registry,ref=${{ steps.docker_meta.outputs.tags }}
139+
cache-to: |
140+
type=inline
141+
142+
- name: Build and Push Multi-Platform image
143+
uses: docker/build-push-action@v6
144+
if: ${{ inputs.publish == 'true' && inputs.depot-project == '' }}
104145
with:
105146
context: ${{ inputs.context }}
106147
file: ${{ inputs.file }}
@@ -109,7 +150,10 @@ runs:
109150
tags: ${{ steps.docker_meta.outputs.tags }}
110151
target: ${{ inputs.target }}
111152
push: true
112-
cache-from: type=registry,ref=${{ steps.docker_meta.outputs.tags }}
113-
cache-to: type=inline
153+
cache-from: |
154+
type=registry,ref=${{ steps.single_tag.outputs.SINGLE_IMAGE }}:head${{ inputs.flavor && format('-{0}', inputs.flavor) || '' }}
155+
type=registry,ref=${{ steps.docker_meta.outputs.tags }}
156+
cache-to: |
157+
type=inline
114158
115159
# TODO add code for vuln scanning?

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/pr-labeler-config.yml

+23-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
ingestion:
2-
- "metadata-ingestion/**/*"
3-
- "metadata-ingestion-modules/**/*"
4-
- "metadata-integration/**/*"
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- "metadata-ingestion/**/*"
5+
- "metadata-ingestion-modules/**/*"
6+
- "metadata-integration/**/*"
57

68
devops:
7-
- "docker/**/*"
8-
- ".github/**/*"
9-
- "perf-test/**/*"
10-
- "metadata-service/**/*"
9+
- changed-files:
10+
- any-glob-to-any-file:
11+
- "docker/**/*"
12+
- ".github/**/*"
13+
- "perf-test/**/*"
14+
- "metadata-service/**/*"
1115

1216
product:
13-
- "datahub-web-react/**/*"
14-
- "datahub-frontend/**/*"
15-
- "datahub-graphql-core/**/*"
16-
- "metadata-io/**/*"
17+
- changed-files:
18+
- any-glob-to-any-file:
19+
- "datahub-web-react/**/*"
20+
- "datahub-frontend/**/*"
21+
- "datahub-graphql-core/**/*"
22+
- "metadata-io/**/*"
1723

1824
docs:
19-
- "docs/**/*"
25+
- changed-files:
26+
- any-glob-to-any-file:
27+
- "docs/**/*"
2028

2129
smoke_test:
22-
- "smoke-test/**/*"
30+
- changed-files:
31+
- any-glob-to-any-file:
32+
- "smoke-test/**/*"

.github/scripts/docker_helpers.sh

+12-4
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ export MAIN_BRANCH="master"
55
export MAIN_BRANCH_TAG="head"
66

77
function get_short_sha {
8-
echo $(git rev-parse --short "$GITHUB_SHA")
8+
echo $(git rev-parse --short "$GITHUB_SHA"|head -c7)
99
}
1010

1111
export SHORT_SHA=$(get_short_sha)
1212
echo "SHORT_SHA: $SHORT_SHA"
1313

1414
function get_tag {
15-
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}
15+
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')
1616
}
1717

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

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

2626
function get_python_docker_release_v {
@@ -38,3 +38,11 @@ function get_unique_tag_slim {
3838
function get_unique_tag_full {
3939
echo $(echo ${GITHUB_REF} | sed -e "s,refs/heads/${MAIN_BRANCH},${SHORT_SHA}-full,g" -e 's,refs/tags/\(.*\),\1-full,g' -e 's,refs/pull/\([0-9]*\).*,pr\1-full,g')
4040
}
41+
42+
function get_platforms_based_on_branch {
43+
if [ "${{ github.event_name }}" == 'push' && "${{ github.ref }}" == "refs/heads/${MAIN_BRANCH}" ]; then
44+
echo "linux/amd64,linux/arm64"
45+
else
46+
echo "linux/amd64"
47+
fi
48+
}

0 commit comments

Comments
 (0)