Skip to content

Commit 5f838f7

Browse files
authored
Merge branch 'main' into xuanwo/java-alpine-v1
2 parents 7e26316 + db2308a commit 5f838f7

File tree

265 files changed

+4530
-1226
lines changed

Some content is hidden

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

265 files changed

+4530
-1226
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* @Xuanwo
1+
* @Xuanwo @tisonkun
22

33
/core @Xuanwo
44
/bindings/c/ @xyjixyjixyji

.github/scripts/test_behavior/plan.py

Lines changed: 27 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333

3434
LANGUAGE_BINDING = ["java", "python", "nodejs", "go", "c", "cpp"]
3535

36-
BIN = []
37-
3836
INTEGRATIONS = ["object_store"]
3937

4038

@@ -92,8 +90,6 @@ class Hint:
9290
binding_c: bool = field(default=False, init=False)
9391
# Is binding cpp affected?
9492
binding_cpp: bool = field(default=False, init=False)
95-
# Is bin ofs affected?
96-
bin_ofs: bool = field(default=False, init=False)
9793
# Is integration object_store affected ?
9894
integration_object_store: bool = field(default=False, init=False)
9995

@@ -109,6 +105,17 @@ def calculate_hint(changed_files: list[str]) -> Hint:
109105
# Remove all files that end with `.md`
110106
changed_files = [f for f in changed_files if not f.endswith(".md")]
111107

108+
def mark_service_affected(service: str) -> None:
109+
hint.core = True
110+
for language in LANGUAGE_BINDING:
111+
setattr(hint, f"binding_{language}", True)
112+
for integration in INTEGRATIONS:
113+
setattr(hint, f"integration_{integration}", True)
114+
115+
hint.services.add(service)
116+
hint.services.add(service.replace("-", "_"))
117+
hint.services.add(service.replace("_", "-"))
118+
112119
for p in changed_files:
113120
# workflow behavior tests affected
114121
if p == ".github/workflows/test_behavior.yml":
@@ -128,11 +135,6 @@ def calculate_hint(changed_files: list[str]) -> Hint:
128135
setattr(hint, f"binding_{language}", True)
129136
hint.all_service = True
130137

131-
for bin in BIN:
132-
if p == f".github/workflows/test_behavior_bin_{bin}.yml":
133-
setattr(hint, f"bin_{bin}", True)
134-
hint.all_service = True
135-
136138
for integration in INTEGRATIONS:
137139
if p == f".github/workflows/test_behavior_integration_{integration}.yml":
138140
setattr(hint, f"integration_{integration}", True)
@@ -145,7 +147,10 @@ def calculate_hint(changed_files: list[str]) -> Hint:
145147
and not p.startswith("core/edge/")
146148
and not p.startswith("core/fuzz/")
147149
and not p.startswith("core/src/services/")
150+
and not p.startswith("core/core/src/services/")
151+
and not p.startswith("core/services/")
148152
and not p.startswith("core/src/docs/")
153+
and not p.startswith("core/core/src/docs/")
149154
):
150155
hint.core = True
151156
hint.binding_java = True
@@ -154,7 +159,6 @@ def calculate_hint(changed_files: list[str]) -> Hint:
154159
hint.binding_go = True
155160
hint.binding_c = True
156161
hint.binding_cpp = True
157-
hint.bin_ofs = True
158162
for integration in INTEGRATIONS:
159163
setattr(hint, f"integration_{integration}", True)
160164
hint.all_service = True
@@ -181,12 +185,6 @@ def calculate_hint(changed_files: list[str]) -> Hint:
181185
hint.binding_go = True
182186
hint.all_service = True
183187

184-
# bin affected
185-
for bin in BIN:
186-
if p.startswith(f"bin/{bin}"):
187-
setattr(hint, f"bin_{bin}", True)
188-
hint.all_service = True
189-
190188
# integration affected
191189
for integration in INTEGRATIONS:
192190
if p.startswith(f"integrations/{integration}"):
@@ -196,38 +194,27 @@ def calculate_hint(changed_files: list[str]) -> Hint:
196194
# core service affected
197195
match = re.search(r"core/src/services/([^/]+)/", p)
198196
if match:
199-
hint.core = True
200-
for language in LANGUAGE_BINDING:
201-
setattr(hint, f"binding_{language}", True)
202-
for bin in BIN:
203-
setattr(hint, f"bin_{bin}", True)
204-
for integration in INTEGRATIONS:
205-
setattr(hint, f"integration_{integration}", True)
206-
hint.services.add(match.group(1))
197+
mark_service_affected(match.group(1))
198+
199+
# service crate affected
200+
match = re.search(r"core/services/([^/]+)/", p)
201+
if match:
202+
mark_service_affected(match.group(1))
203+
204+
# opendal-core internal service affected
205+
match = re.search(r"core/core/src/services/([^/]+)/", p)
206+
if match:
207+
mark_service_affected(match.group(1))
207208

208209
# core test affected
209210
match = re.search(r".github/services/([^/]+)/", p)
210211
if match:
211-
hint.core = True
212-
for language in LANGUAGE_BINDING:
213-
setattr(hint, f"binding_{language}", True)
214-
for bin in BIN:
215-
setattr(hint, f"bin_{bin}", True)
216-
for integration in INTEGRATIONS:
217-
setattr(hint, f"integration_{integration}", True)
218-
hint.services.add(match.group(1))
212+
mark_service_affected(match.group(1))
219213

220214
# fixture affected
221215
match = re.search(r"fixtures/([^/]+)/", p)
222216
if match:
223-
hint.core = True
224-
for language in LANGUAGE_BINDING:
225-
setattr(hint, f"binding_{language}", True)
226-
for bin in BIN:
227-
setattr(hint, f"bin_{bin}", True)
228-
for integration in INTEGRATIONS:
229-
setattr(hint, f"integration_{integration}", True)
230-
hint.services.add(match.group(1))
217+
mark_service_affected(match.group(1))
231218

232219
return hint
233220

@@ -300,29 +287,6 @@ def generate_language_binding_cases(
300287
return cases
301288

302289

303-
def generate_bin_cases(
304-
cases: list[dict[str, str]], hint: Hint, bin: str
305-
) -> list[dict[str, str]]:
306-
# Return empty if this bin is False
307-
if not getattr(hint, f"bin_{bin}"):
308-
return []
309-
310-
cases = unique_cases(cases)
311-
312-
if bin == "ofs":
313-
supported_services = ["fs", "s3"]
314-
cases = [v for v in cases if v["service"] in supported_services]
315-
316-
# Return all services if all_service is True
317-
if hint.all_service:
318-
return cases
319-
320-
# Filter all cases that not shown up in changed files
321-
cases = [v for v in cases if v["service"] in hint.services]
322-
323-
return cases
324-
325-
326290
def generate_integration_cases(
327291
cases: list[dict[str, str]], hint: Hint, integration: str
328292
) -> list[dict[str, str]]:
@@ -401,14 +365,6 @@ def plan(changed_files: list[str]) -> dict[str, Any]:
401365
}
402366
)
403367

404-
for bin in BIN:
405-
jobs[f"bin_{bin}"] = []
406-
jobs["components"][f"bin_{bin}"] = False
407-
bin_cases = generate_bin_cases(cases, hint, bin)
408-
if len(bin_cases) > 0:
409-
jobs["components"][f"bin_{bin}"] = True
410-
jobs[f"bin_{bin}"].append({"os": "ubuntu-latest", "cases": bin_cases})
411-
412368
for integration in INTEGRATIONS:
413369
jobs[f"integration_{integration}"] = []
414370
jobs["components"][f"integration_{integration}"] = False

.github/scripts/test_behavior/test_plan.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,25 @@ def test_core_cargo_toml(self):
3333
self.assertTrue(result["components"]["core"])
3434

3535
def test_core_services_fs(self):
36-
result = plan(["core/src/services/fs/mod.rs"])
36+
result = plan(["core/services/fs/src/lib.rs"])
3737
self.assertTrue(result["components"]["core"])
3838
self.assertTrue(len(result["core"]) > 0)
3939

4040
cases = [v["service"] for v in result["core"][0]["cases"]]
41-
# Should not contain fs
41+
# Should contain fs
4242
self.assertTrue("fs" in cases)
4343
# Should not contain s3
4444
self.assertFalse("s3" in cases)
4545

46+
def test_core_services_hdfs_native_mapping(self):
47+
result = plan(["core/services/hdfs-native/src/lib.rs"])
48+
self.assertTrue(result["components"]["core"])
49+
self.assertTrue(len(result["core"]) > 0)
50+
51+
cases = [v["service"] for v in result["core"][0]["cases"]]
52+
self.assertTrue("hdfs_native" in cases)
53+
self.assertFalse("fs" in cases)
54+
4655
def test_binding_java(self):
4756
result = plan(["bindings/java/pom.xml"])
4857
self.assertFalse(result["components"]["core"])
@@ -56,7 +65,7 @@ def test_integration_object_store(self):
5665
self.assertTrue(result["components"]["integration_object_store"])
5766
self.assertTrue(len(result["integration_object_store"]) > 0)
5867

59-
result = plan(["core/src/services/fs/mod.rs"])
68+
result = plan(["core/services/fs/src/lib.rs"])
6069
cases = [v["service"] for v in result["integration_object_store"][0]["cases"]]
6170
# Should contain fs
6271
self.assertTrue("fs" in cases)

.github/workflows/ci_bindings_c.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
test:
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: actions/checkout@v5
46+
- uses: actions/checkout@v6
4747

4848
- name: Setup Rust toolchain
4949
uses: ./.github/actions/setup

.github/workflows/ci_bindings_cpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
test:
4545
runs-on: ubuntu-24.04
4646
steps:
47-
- uses: actions/checkout@v5
47+
- uses: actions/checkout@v6
4848
- name: Install dependencies
4949
run: |
5050
sudo apt-get update

.github/workflows/ci_bindings_d.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
dlang: ["ldc-latest", "dmd-latest"]
5050
runs-on: ubuntu-latest
5151
steps:
52-
- uses: actions/checkout@v5
52+
- uses: actions/checkout@v6
5353
- uses: dlang-community/setup-dlang@v2
5454
with:
5555
compiler: ${{ matrix.dlang }}

.github/workflows/ci_bindings_dart.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ jobs:
4646
test:
4747
runs-on: ubuntu-latest
4848
steps:
49-
- uses: actions/checkout@v5
49+
- uses: actions/checkout@v6
5050

5151
- name: Setup Rust toolchain
5252
uses: ./.github/actions/setup
5353

54-
- uses: actions/cache@v4
54+
- uses: actions/cache@v5
5555
with:
5656
path: |
5757
~/.cargo/bin/

.github/workflows/ci_bindings_dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
test:
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: actions/checkout@v5
46+
- uses: actions/checkout@v6
4747
- name: Setup dotnet toolchain
4848
uses: actions/setup-dotnet@v5
4949
with:

.github/workflows/ci_bindings_go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ jobs:
4747
lint:
4848
runs-on: ubuntu-latest
4949
steps:
50-
- uses: actions/checkout@v5
50+
- uses: actions/checkout@v6
5151
- uses: actions/setup-go@v6
5252
with:
5353
go-version: stable
54-
- uses: golangci/golangci-lint-action@v8
54+
- uses: golangci/golangci-lint-action@v9
5555
with:
5656
version: "v2.1"
5757
working-directory: bindings/go

.github/workflows/ci_bindings_haskell.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
test:
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: actions/checkout@v5
46+
- uses: actions/checkout@v6
4747
- name: Setup Haskell toolchain (ghc-9.4.8)
4848
run: |
4949
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
@@ -57,7 +57,7 @@ jobs:
5757
run: |
5858
cargo clippy -- -D warnings
5959
- name: Restore haskell cache
60-
uses: actions/cache/restore@v4
60+
uses: actions/cache/restore@v5
6161
with:
6262
key: ${{ runner.os }}-haskell-${{ hashFiles('**/*.cabal', '**/Setup.hs') }}
6363
path: |
@@ -69,7 +69,7 @@ jobs:
6969
run: |
7070
cabal test
7171
- name: Save haskell cache
72-
uses: actions/cache/save@v4
72+
uses: actions/cache/save@v5
7373
with:
7474
key: ${{ runner.os }}-haskell-${{ hashFiles('**/*.cabal', '**/Setup.hs') }}
7575
path: |
@@ -80,7 +80,7 @@ jobs:
8080
runs-on: ubuntu-latest
8181
if: ${{ startsWith(github.ref, 'refs/tags/') }}
8282
steps:
83-
- uses: actions/checkout@v5
83+
- uses: actions/checkout@v6
8484
- name: Setup Haskell toolchain (ghc-9.2.8)
8585
run: |
8686
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
@@ -90,7 +90,7 @@ jobs:
9090
- name: Setup Rust toolchain
9191
uses: ./.github/actions/setup
9292
- name: Restore haskell cache
93-
uses: actions/cache/restore@v4
93+
uses: actions/cache/restore@v5
9494
with:
9595
key: ${{ runner.os }}-haskell-${{ hashFiles('**/*.cabal', '**/Setup.hs') }}
9696
path: |
@@ -105,7 +105,7 @@ jobs:
105105
tar xf opendal-*.crate --strip-components=1
106106
cabal sdist
107107
- name: Upload artifact
108-
uses: actions/upload-artifact@v4
108+
uses: actions/upload-artifact@v6
109109
with:
110110
name: bindings-haskell-sdist
111111
path: bindings/haskell/target/package/dist-newstyle/sdist/*.tar.gz

0 commit comments

Comments
 (0)