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