Skip to content

Commit d138a64

Browse files
authored
ci(graphql,workflows): Format .md, .graphql, and workflow .yml files via prettier (#13220)
1 parent 45ebaa7 commit d138a64

File tree

387 files changed

+18221
-17620
lines changed

Some content is hidden

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

387 files changed

+18221
-17620
lines changed

.github/.codecov.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
comment:
22
layout: "condensed_header, condensed_files, condensed_footer"
33
hide_project_coverage: true
4-
require_changes: false # if true: only post the comment if coverage changes
4+
require_changes: false # if true: only post the comment if coverage changes
55

66
codecov:
77
#due to ci-optimization, reports for modules that have not changed may be quite old
@@ -57,4 +57,4 @@ coverage:
5757
patch:
5858
default:
5959
target: 75% # for new code added in the patch
60-
only_pulls: true
60+
only_pulls: true

.github/ISSUE_TEMPLATE/--bug-report.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name: "\U0001F41EBug report"
33
about: Create a report to help us improve
44
title: A short description of the bug
55
labels: bug
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Additional context**
3233
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/datahub-v1-0-rc-bug-report.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ about: Report issues found in DataHub v1.0 Release Candidates
44
title: "[v1.0-rc/bug] Description of Bug"
55
labels: bug, datahub-v1.0-rc
66
assignees: chriscollins3456, david-leifker, maggiehays
7-
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots and/or screen recordings to help explain the issue.
2525

2626
**System details (please complete the following information):**
27-
- DataHub Version Tag [e.g. v1.0-rc1]
28-
- OS: [e.g. iOS]
29-
- Browser [e.g. chrome, safari]
27+
28+
- DataHub Version Tag [e.g. v1.0-rc1]
29+
- OS: [e.g. iOS]
30+
- Browser [e.g. chrome, safari]
3031

3132
**Additional context**
3233
Add any other context about the problem here.

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ runs:
4949
using: "composite"
5050
steps:
5151
- name: Check trigger type
52-
id: trigger # Add an ID to reference this step
52+
id: trigger # Add an ID to reference this step
5353
shell: bash
5454
run: |
5555
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
@@ -104,4 +104,3 @@ runs:
104104
actions:
105105
- "datahub-actions/**"
106106
- "docker/datahub-actions/**"
107-

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ runs:
156156
cache-to: |
157157
type=inline
158158
159-
# TODO add code for vuln scanning?
159+
# TODO add code for vuln scanning?

.github/actions/ensure-codegen-updated/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: 'Ensure codegen is updated'
2-
description: 'Will check the local filesystem against git, and abort if there are uncommitted changes.'
1+
name: "Ensure codegen is updated"
2+
description: "Will check the local filesystem against git, and abort if there are uncommitted changes."
33

44
runs:
55
using: "composite"

.github/pr-labeler-config.yml

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

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

1616
product:
17-
- changed-files:
18-
- any-glob-to-any-file:
19-
- "datahub-web-react/**/*"
20-
- "datahub-frontend/**/*"
21-
- "datahub-graphql-core/**/*"
22-
- "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/**/*"
2323

2424
docs:
25-
- changed-files:
26-
- any-glob-to-any-file:
27-
- "docs/**/*"
25+
- changed-files:
26+
- any-glob-to-any-file:
27+
- "docs/**/*"
2828

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

.github/pull_request_template.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
## Checklist
32

43
- [ ] The PR conforms to DataHub's [Contributing Guideline](https://github.com/datahub-project/datahub/blob/master/docs/CONTRIBUTING.md) (particularly [Commit Message Format](https://github.com/datahub-project/datahub/blob/master/docs/CONTRIBUTING.md#commit-message-format))

.github/scripts/generate_pre_commit.py

+35-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class ProjectType(Enum):
1919

2020
JAVA = auto()
2121
PYTHON = auto()
22+
PRETTIER = auto()
2223

2324

2425
@dataclass
@@ -27,6 +28,8 @@ class Project:
2728

2829
path: str
2930
type: ProjectType
31+
taskName: str | None = None # Used for prettier projects
32+
filePattern: str | None = None # Used for prettier projects
3033

3134
@property
3235
def gradle_path(self) -> str:
@@ -151,8 +154,12 @@ def generate_config(self) -> dict:
151154
for project in self.projects:
152155
if project.type == ProjectType.PYTHON:
153156
hooks.append(self._generate_lint_fix_hook(project))
154-
else: # ProjectType.JAVA
157+
elif project.type == ProjectType.JAVA:
155158
hooks.append(self._generate_spotless_hook(project))
159+
elif project.type == ProjectType.PRETTIER:
160+
hooks.append(self._generate_prettier_hook(project))
161+
else:
162+
print(f"Warning: Unsupported project type {project.type} for {project.path}")
156163

157164
config = {"repos": [{"repo": "local", "hooks": hooks}]}
158165

@@ -203,6 +210,17 @@ def _generate_spotless_hook(self, project: Project) -> dict:
203210
"pass_filenames": False,
204211
}
205212

213+
def _generate_prettier_hook(self, project: Project) -> dict:
214+
"""Generate a prettier hook for projects."""
215+
return {
216+
"id": f"{project.project_id}-{project.taskName}",
217+
"name": f"{project.taskName}",
218+
"entry": f"./gradlew {project.gradle_path}:{project.taskName}",
219+
"language": "system",
220+
"files": project.filePattern,
221+
"pass_filenames": False,
222+
}
223+
206224

207225
class PrecommitDumper(yaml.Dumper):
208226
"""Custom YAML dumper that maintains proper indentation."""
@@ -253,7 +271,21 @@ def main():
253271

254272
# Find projects
255273
finder = ProjectFinder(root_dir)
256-
projects = finder.find_all_projects()
274+
prettier_projects = [
275+
Project(
276+
path="datahub-web-react",
277+
type=ProjectType.PRETTIER,
278+
taskName="mdPrettierWriteChanged",
279+
filePattern="^.*\\.md$",
280+
),
281+
Project(
282+
path="datahub-web-react",
283+
type=ProjectType.PRETTIER,
284+
taskName="githubActionsPrettierWriteChanged",
285+
filePattern="^\\.github/.*\\.(yml|yaml)$"
286+
),
287+
]
288+
projects = [*prettier_projects, *finder.find_all_projects()]
257289

258290
# Print summary
259291
print("Found projects:")
@@ -276,4 +308,4 @@ def main():
276308

277309

278310
if __name__ == "__main__":
279-
main()
311+
main()

.github/scripts/pre-commit-override.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ repos:
66
entry: ./gradlew :smoke-test:cypressLintFix
77
language: system
88
files: ^smoke-test/tests/cypress/.*\.tsx$
9-
pass_filenames: false
9+
pass_filenames: false

0 commit comments

Comments
 (0)