Skip to content

Commit b48cbed

Browse files
Merge branch 'master' into chore-ruff
2 parents 682465d + b28291b commit b48cbed

File tree

33 files changed

+1303
-251
lines changed

33 files changed

+1303
-251
lines changed

.github/workflows/pr-labeler.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ jobs:
5252
"chakru-r",
5353
"brock-acryl",
5454
"mminichino",
55-
"jayacryl"
55+
"jayacryl",
56+
"v-tarasevich-blitz-brain",
57+
"ryota-cloud",
58+
"annadoesdesign"
5659
]'),
5760
github.actor
5861
)

build.gradle

+42-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.apache.tools.ant.filters.ReplaceTokens
2+
3+
14
buildscript {
25
ext.jdkVersionDefault = 17
36
ext.javaClassVersionDefault = 11
@@ -396,25 +399,56 @@ configure(subprojects.findAll {! it.name.startsWith('spark-lineage')}) {
396399
}
397400
}
398401

402+
apply plugin: 'com.gorylenko.gradle-git-properties'
403+
gitProperties {
404+
keys = ['git.commit.id','git.commit.id.describe','git.commit.time']
405+
// using any tags (not limited to annotated tags) for "git.commit.id.describe" property
406+
// see http://ajoberstar.org/grgit/grgit-describe.html for more info about the describe method and available parameters
407+
// 'it' is an instance of org.ajoberstar.grgit.Grgit
408+
customProperty 'git.commit.id.describe', { it.describe(tags: true) }
409+
gitPropertiesResourceDir = rootProject.buildDir
410+
failOnNoGitDirectory = false
411+
}
412+
413+
def gitPropertiesGenerated = false
414+
415+
apply from: 'gradle/versioning/versioning-global.gradle'
416+
417+
tasks.register("generateGitPropertiesGlobal", com.gorylenko.GenerateGitPropertiesTask) {
418+
doFirst {
419+
if (!gitPropertiesGenerated) {
420+
println "Generating git.properties"
421+
gitPropertiesGenerated = true
422+
} else {
423+
// Skip actual execution if already run
424+
onlyIf { false }
425+
}
426+
}
427+
}
428+
399429
subprojects {
400430

401431
apply plugin: 'maven-publish'
402-
apply plugin: 'com.gorylenko.gradle-git-properties'
403432
apply plugin: 'com.diffplug.spotless'
404433

405-
gitProperties {
406-
keys = ['git.commit.id','git.commit.id.describe','git.commit.time']
407-
// using any tags (not limited to annotated tags) for "git.commit.id.describe" property
408-
// see http://ajoberstar.org/grgit/grgit-describe.html for more info about the describe method and available parameters
409-
// 'it' is an instance of org.ajoberstar.grgit.Grgit
410-
customProperty 'git.commit.id.describe', { it.describe(tags: true) }
411-
failOnNoGitDirectory = false
434+
def gitPropertiesTask = tasks.register("copyGitProperties", Copy) {
435+
dependsOn rootProject.tasks.named("generateGitPropertiesGlobal")
436+
def sourceFile = file("${rootProject.buildDir}/git.properties")
437+
from sourceFile
438+
into "$project.buildDir/resources/main"
412439
}
413440

414441
plugins.withType(JavaPlugin).configureEach {
442+
project.tasks.named(JavaPlugin.CLASSES_TASK_NAME).configure{
443+
dependsOn gitPropertiesTask
444+
}
415445
if (project.name == 'datahub-web-react') {
416446
return
417447
}
448+
/* TODO: evaluate ignoring jar timestamps for increased caching (compares checksum instead)
449+
jar {
450+
preserveFileTimestamps = false
451+
}*/
418452

419453
dependencies {
420454
implementation externalDependency.annotationApi

datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/resolvers/config/AppConfigResolver.java

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public CompletableFuture<AppConfig> get(final DataFetchingEnvironment environmen
140140
visualConfig.setAppTitle(_visualConfiguration.getAppTitle());
141141
}
142142
visualConfig.setHideGlossary(_visualConfiguration.isHideGlossary());
143+
visualConfig.setShowFullTitleInLineage(_visualConfiguration.isShowFullTitleInLineage());
143144
}
144145
if (_visualConfiguration != null && _visualConfiguration.getQueriesTab() != null) {
145146
QueriesTabConfig queriesTabConfig = new QueriesTabConfig();

datahub-graphql-core/src/main/resources/app.graphql

+5
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ type VisualConfig {
276276
Configuration for search results
277277
"""
278278
searchResult: SearchResultsVisualConfig
279+
280+
"""
281+
Show full title in lineage view by default
282+
"""
283+
showFullTitleInLineage: Boolean
279284
}
280285

281286
"""

datahub-web-react/build.gradle

+1-2
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,13 @@ task yarnBuild(type: YarnTask, dependsOn: [yarnInstall, yarnGenerate]) {
111111
outputs.dir('dist')
112112
}
113113

114-
task cleanExtraDirs {
114+
clean {
115115
delete 'node_modules/.yarn-integrity'
116116
delete 'dist'
117117
delete 'tmp'
118118
delete 'just'
119119
delete fileTree(dir: 'src', include: '*.generated.ts')
120120
}
121-
clean.finalizedBy(cleanExtraDirs)
122121

123122
configurations {
124123
assets

datahub-web-react/src/app/lineage/LineageVizInsideZoom.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { SchemaField, SchemaFieldRef } from '../../types.generated';
1010
import { useIsShowColumnsMode } from './utils/useIsShowColumnsMode';
1111
import { LineageVizControls } from './controls/LineageVizControls';
1212
import LineageVizRootSvg from './LineageVizRootSvg';
13+
import { useAppConfig } from '../useAppConfig';
1314

1415
const ControlsDiv = styled.div`
1516
display: flex;
@@ -65,12 +66,15 @@ export default function LineageVizInsideZoom({
6566
fineGrainedMap,
6667
refetchCenterNode,
6768
}: Props) {
69+
const appConfig = useAppConfig();
70+
const showFullTitle = appConfig.config.visualConfig.showFullTitleInLineage;
71+
6872
const [collapsedColumnsNodes, setCollapsedColumnsNodes] = useState<Record<string, boolean>>({});
6973
const [selectedField, setSelectedField] = useState<SchemaFieldRef | null>(null);
7074
const [highlightedEdges, setHighlightedEdges] = useState<ColumnEdge[]>([]);
7175
const [visibleColumnsByUrn, setVisibleColumnsByUrn] = useState<Record<string, Set<string>>>({});
7276
const [columnsByUrn, setColumnsByUrn] = useState<Record<string, SchemaField[]>>({});
73-
const [showExpandedTitles, setShowExpandedTitles] = useState(false);
77+
const [showExpandedTitles, setShowExpandedTitles] = useState(showFullTitle ?? false);
7478
const showColumns = useIsShowColumnsMode();
7579

7680
useEffect(() => {

datahub-web-react/src/graphql/app.graphql

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ query appConfig {
3737
visualConfig {
3838
logoUrl
3939
faviconUrl
40+
showFullTitleInLineage
4041
queriesTab {
4142
queriesTabResultSize
4243
}

datahub-web-react/src/graphql/browseV2.graphql

+1-24
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,7 @@ query getBrowseResultsV2($input: BrowseV2Input!) {
77
entity {
88
urn
99
type
10-
... on Container {
11-
properties {
12-
name
13-
}
14-
}
15-
... on DataFlow {
16-
properties {
17-
name
18-
}
19-
}
20-
... on DataPlatformInstance {
21-
platform {
22-
name
23-
properties {
24-
displayName
25-
}
26-
}
27-
instanceId
28-
}
29-
... on Dataset {
30-
properties {
31-
name
32-
}
33-
}
10+
...entityDisplayNameFields
3411
}
3512
}
3613
start

datahub-web-react/src/graphql/fragments.graphql

+1-24
Original file line numberDiff line numberDiff line change
@@ -1308,30 +1308,7 @@ fragment browsePathV2Fields on BrowsePathV2 {
13081308
entity {
13091309
urn
13101310
type
1311-
... on Container {
1312-
properties {
1313-
name
1314-
}
1315-
}
1316-
... on DataFlow {
1317-
properties {
1318-
name
1319-
}
1320-
}
1321-
... on DataPlatformInstance {
1322-
platform {
1323-
name
1324-
properties {
1325-
displayName
1326-
}
1327-
}
1328-
instanceId
1329-
}
1330-
... on Dataset {
1331-
properties {
1332-
name
1333-
}
1334-
}
1311+
...entityDisplayNameFields
13351312
}
13361313
}
13371314
}

docs-website/docusaurus.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@ module.exports = {
290290
additionalLanguages: ["ini", "java", "graphql", "shell-session"],
291291
},
292292
algolia: {
293+
// This is the "Search API Key" in Algolia, which means that it is ok to be public.
294+
apiKey: "2adf840a044a5ecbf7bdaac88cbf9ee5",
293295
appId: "RK0UG797F3",
294-
apiKey: "39d7eb90d8b31d464e309375a52d674f",
295296
indexName: "datahubproject",
296297
insights: true,
297298
contextualSearch: true,

docs-website/src/theme/Layout/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function LayoutWrapper(props) {
99
<SecondNavbar />
1010
{props.children}
1111
</Layout>
12-
<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=92db07cf-8934-4b30-857a-3fcfda4c86dd" />
12+
<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=92db07cf-8934-4b30-857a-3fcfda4c86dd" style={{ display: 'none' }} />
1313
</>
1414
);
1515
}

docs/automations/ai-docs.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ With AI-powered documentation, you can automatically generate documentation for
1818

1919
## Configuring
2020

21-
No configuration is required - just hit "Generate" on any table or column in the UI.
21+
Ensure you have edit dataset description privileges.
22+
23+
Once permissions are obtained, no configuration is required - just hit "Generate" on any table or column in the UI.
2224

2325
## How it works
2426

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/**
2+
Applies a consistent versioning scheme to all projects using this script
3+
4+
Uses git tags to mint versions by default.
5+
git tags can be of a few forms:
6+
- short sha (typical for a PR or a commit) (e.g. 38960ae)
7+
- versioned tags (typical for a release) (e.g. v0.8.45, v0.8.45.1, v0.8.45rc1, v0.8.45.1rc4)
8+
9+
Produces the following variables and supports token replacement
10+
- version: server version amenable for creating jars
11+
- fullVersion: full version string
12+
- cliMajorVersion: cli version amenable for binding to server as a default
13+
0.8.44 or 0.8.44-1 (for clean tags) or 0.8.45-SNAPSHOT (for unclean repositories)
14+
15+
All inference can be overridden by passing in the releaseVersion property
16+
e.g. -PreleaseVersion=0.2.3.4 will set the jar version to 0.2.3-4
17+
18+
**/
19+
20+
import groovy.json.JsonBuilder
21+
22+
def detailedVersionString = "0.0.0-unknown-SNAPSHOT"
23+
def cliMajorVersion = "0.15.0" // base default cli major version
24+
def snapshotVersion = false
25+
def javaVersion = ""
26+
27+
if (project.hasProperty("releaseVersion")) {
28+
version = releaseVersion
29+
detailedVersionString = releaseVersion
30+
} else {
31+
try {
32+
// apply this plugin in a try-catch block so that we can handle cases without .git directory
33+
apply plugin: "com.palantir.git-version"
34+
def details = versionDetails()
35+
detailedVersionString = gitVersion()
36+
version = details.lastTag
37+
version = version.startsWith("v")? version.substring(1): version
38+
def suffix = details.isCleanTag? "": "-SNAPSHOT"
39+
snapshotVersion = ! details.isCleanTag
40+
}
41+
catch (Exception e) {
42+
e.printStackTrace()
43+
// last fall back
44+
version = detailedVersionString
45+
}
46+
}
47+
48+
// trim version if it is of size 4 to size 3
49+
def versionParts = version.tokenize(".")
50+
cliMajorVersion = version
51+
if (versionParts.size() > 3) {
52+
// at-least 4 part version
53+
// we check if the 4th part is a .0 in which case we want to create a release
54+
if ((versionParts.size() == 4) && (versionParts[3] == '0')) {
55+
versionParts = versionParts[0..2]
56+
}
57+
version = versionParts[0..2].join('.')
58+
if (versionParts.size() > 3) {
59+
version = version + "-" + versionParts[3..versionParts.size()-1].join('-')
60+
}
61+
}
62+
63+
if (snapshotVersion) {
64+
if (versionParts[versionParts.size()-1].isInteger()) {
65+
def base_version = versionParts[0..versionParts.size()-2].join('.')
66+
version = base_version + '.' + (versionParts[versionParts.size()-1].toInteger()+1).toString() + "-SNAPSHOT"
67+
cliMajorVersion = base_version + "." + versionParts[versionParts.size()-1]
68+
} else {
69+
// we are unable to part the last token as an integer, so we just append SNAPSHOT to this version
70+
version = versionParts[0..versionParts.size()-1].join('.') + '-SNAPSHOT'
71+
cliMajorVersion = versionParts[0..versionParts.size()-1].join('.')
72+
}
73+
74+
// differences from metadata-integration/java/versioning.gradle
75+
if (versionParts[versionParts.size()-1].isInteger()) {
76+
javaVersion = versionParts[0..versionParts.size()-2].join('.') + '.' + (versionParts[versionParts.size()-1].toInteger()+1).toString() + "-SNAPSHOT"
77+
} else {
78+
// we are unable to part the last token as an integer, so we just append SNAPSHOT to this version
79+
javaVersion = versionParts[0..versionParts.size()-1].join('.') + '-SNAPSHOT'
80+
}
81+
}
82+
83+
// Note: No task, we want this executed during config phase, once for rootProject.
84+
def data = [
85+
fullVersion: detailedVersionString,
86+
cliMajorVersion: cliMajorVersion,
87+
version: version,
88+
javaVersion: javaVersion
89+
]
90+
91+
// Convert to JSON
92+
def jsonBuilder = new JsonBuilder(data)
93+
def outputFile = file("${rootProject.buildDir}/version.json")
94+
95+
// Ensure buildDir exists
96+
rootProject.buildDir.mkdirs()
97+
98+
// Write to file
99+
outputFile.text = jsonBuilder.toPrettyString()
100+
101+
println "git.properties JSON data written to ${outputFile}"

0 commit comments

Comments
 (0)