Skip to content

fix: EnrichmentTarget call in DataInsightsEnricherBehaviorIT passes 7 args to 5-component record (main compile error blocking #151) - #152

Merged
BMJLearnToHelloWorld merged 2 commits into
mainfrom
fix/main-enrichment-target-args
Nov 6, 2026
Merged

BMJLearnToHelloWorld merged 2 commits into
mainfrom
fix/main-enrichment-target-args

Conversation

@BMJLearnToHelloWorld

@BMJLearnToHelloWorld BMJLearnToHelloWorld commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

主干编译修复:EnrichmentTarget 调用实参数量错误

问题

maven-sonarcloud-ci 在主干代码上编译失败,挡住了 PR #151 的合入:

openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/DataInsightsEnricherBehaviorIT.java:552:constructor EnrichmentTarget in record ...EnrichmentTarget cannot be applied to given types

该 workflow 只在 pull_request_target(paths 含 openmetadata-service/**)时运行,主干 push 不触发;PR #151 因含 2 个 Java 文件(Bai 的 spotless 删除 import)触发了它,暴露了主干上已有的 breakage。

证据链(均已逐字核对官方 pin a3012259ca)

  • record 定义(主干 2566dc4 与官方逐字相同):EnrichmentTarget(entity, entityMap, changeSummary, context, shape) —— 5 个分量。
  • 官方同一测试同一行(:552):new EnrichmentTarget(table, entityMap, Map.of(), context, VersionShape.LATEST_HYDRATED) —— 5 个实参。
  • 主干的调用传了 7 个实参,多出的 0L, 86_400_000L 正是 EnrichmentContext 的窗口起止时间戳,上一行 new EnrichmentContext("table", TABLE_FIELDS, 0L, 86_400_000L) 里已经传过一次 —— 移植时把 context 的参数重复写进了 target 调用。
  • 全树 9 处 new EnrichmentTarget( 调用点逐个核对:其余 8 处均为 5 个实参,只有这一处是 7 个。
  • 两文件最后一次改动均为主干提交 2c1b462(M-Next Wave 0 (g) 上游 P0+P1 移植)。

修复

只改这一处调用,去掉多余的两个实参;修后的行与官方 :552 逐字节相同。record 定义不动,其他文件不动,PR #151 分支不动。

验证(请注意)

  • 本 VM 跑不了 Maven 编译(Java 联网被拦),本地只做了逐字核对。
  • 本 PR 自己的 CI 跑不到该编译:maven-sonar-build.yml 的 paths 不含 openmetadata-integration-tests/**;openmetadata-service-unit-tests.yml 的 in-job filter 也不含它;integration-tests 系列 workflow 只在 push 时触发。因此本 PR 合入后,由以下两处验证:
    1. 合入主干的 push 会触发 integration-tests 系列 workflow(mvn clean install -pl :openmetadata-integration-tests -am,含该文件编译);
    2. PR Airflow plugin Phase 2: clean-room rebuild of openmetadata-airflow-apis (steps 0-7) #151 的 CI 重跑——须先把 Airflow plugin Phase 2: clean-room rebuild of openmetadata-airflow-apis (steps 0-7) #151 分支从主干更新(新头含已修文件)再重跑;裸重跑无效,因为该 workflow 的 Checkout 写死检出 PR head(仍是旧代码)。更新后重跑时,其 openmetadata-service/** 文件触发 maven-sonarcloud-ci,mvn verify -DskipTests 会全 reactor test-compile,含该文件。

合入由 parent 在复核后做。

方案 (a):4 行 import 删除已并入(2026-11-06)

  • 并入内容:MetricGroupResource.java 删 import java.util.Map;(1 行);MetricResource.java 删 import org.openmetadata.service.exception.EntityNotFoundException;、import org.openmetadata.service.security.AuthorizationException;、import org.openmetadata.service.security.policyevaluator.ResourceContext;(3 行)。4 行删除与 Bai 在 Airflow plugin Phase 2: clean-room rebuild of openmetadata-airflow-apis (steps 0-7) #151 分支的 ad1c3374 逐字节相同(已 cmp 核实),PR 现为 3 文件 +1/−6。
  • 并入原因:这 4 个 import 在主干上未被使用,导致 java-checkstyle(mvn spotless:apply 后 git diff-files)失败,挡住了本 PR 的合入;主干自身跑该 job 亦失败。
  • 合入后安排(Bai 2026-11-06 20:39 定):合入后真正移植缺失的使用这些 import 的代码,让 import 真正被使用,而不是把缺口记为残留了事。移植另起一轮。

对齐程度(Bai 2026-11-06 20:41 要求:明确写出,不要只写“已修复”/“已对齐”)

  1. **EnrichmentTarget 修复:与官方完全一致。**修后的行与官方 :552 逐字节相同;EnrichmentTarget record 定义与官方逐字节相同(5 个分量,顺序一致)。
  2. **4 行 import 删除:与官方不一致。**官方同样有这 4 个 import,而且有使用它们的代码(见第 3 条)。删除只是为了让 spotless 通过(合规),不是与官方对齐——不要把删除理解为对齐官方。
  3. **两文件整体对官方的对齐程度(合入本 PR 后仍缺的部分):**合入后,MetricGroupResource.java 与 MetricResource.java 仍缺官方的以下代码,须在合入后移植一轮中补齐:
    • MetricGroupResource 的 MembershipVisibility 记录与 membershipVisibility() 方法(成员可见性解析,逐请求缓存);
    • MetricResource 的导航栏域过滤逻辑(pickedMetrics / canViewMetric / groupInPick,经 EntityUtil.navbarDomainMemberIds);
    • MetricResource 的 ResourceContext 相关代码(new ResourceContext<>(...) 构造与 catch (AuthorizationException | EntityNotFoundException ...))。
      这三项在主干全树零命中(MembershipVisibility、navbarDomainMemberIds、cachedDecisions、groupInDomainPick 均无命中),系 Wave 0 (g) 移植(2c1b4626)漏掉的权限相关代码。

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@BMJLearnToHelloWorld
BMJLearnToHelloWorld merged commit 4ef4fe9 into main Nov 6, 2026
60 of 66 checks passed
@BMJLearnToHelloWorld
BMJLearnToHelloWorld deleted the fix/main-enrichment-target-args branch November 12, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant