Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

My first Apache Kafka PR deleted three lines. I almost deleted the wrong one.

说明与用途

在 Gradle 文件中删除重复的依赖声明行可能会改变 classpath 顺序,尽管解析的模块集合保持不变。作者删除了每对重复声明中的后置行,保持了顺序,PR 被合并。

问题

Removing a duplicate dependency declaration in a Gradle build file can change classpath order and break tests, yet the change appears to be a no‑op.

结果

The PR was merged after demonstrating that deleting the later duplicate lines preserved classpath order and test success.

工作流

  • 1. Identified duplicate test dependency declarations in build.gradle.
  • 2. Chose which line to delete based on visual inspection (initially removed the earlier line).
  • 3. Generated dependency reports for both test configurations before and after the change.
  • 4. Compared reports to check for differences in resolved modules and order.
  • 5. Noted that removing the earlier line altered the order of resolved artifacts, potentially affecting classpath precedence.
  • 6. Decided to delete the later line of each duplicate pair instead.
  • 7. Re‑generated dependency reports to confirm byte‑identical outputs.
  • 8. Ran tests (WorkerTest) to ensure no failures.
  • 9. Updated PR description to explain the rationale.
  • 10. Awaited committer approval and merge.

证据

In build.gradle, three test dependencies were declared twice inside the same block: core libs.apachedsCoreApi lines 1221 and 1230 connect:runtime project(':server-common') lines 3842 and 3847 connect:runtime project(':server') lines 3840 and 3848

来源

The resolved sets were identical: 73, 104, 125 and 171 modules, not one difference.

来源

The :core report was not. Fifteen lines had moved. org.apache.directory.api:api-all jumped from position 150 to 87, ahead of apacheds-core-api.

来源

The four reports came back byte-identical, at 241, 418, 498 and 760 lines. Both modules compiled their tests, check passed without the test task, rat passed at the root, and WorkerTest ran 140 tests with no failures as a spot check on the connect side.

来源

  • 记录日期: 2026-10-20T20:41:39.239Z