Skip to content

feat(presto-connector): Add Spotless formatting for the Java plugin. - #39

Open
jackluo923 wants to merge 7 commits into
ci/configurable-runnersfrom
feat/presto-connector-linting
Open

jackluo923 wants to merge 7 commits into
ci/configurable-runnersfrom
feat/presto-connector-linting

Conversation

@jackluo923

@jackluo923 jackluo923 commented Jul 30, 2026 •

Copy link
Copy Markdown
Member

Description

Adds Spotless formatting for the Java plugin — the complete mechanism (configuration, fix and check tooling), but nothing that runs the check:

  • presto-connector/pom.xml: adds the spotless-maven-plugin (3.5.1), configured with the Eclipse formatter profile, import ordering, and unused-import removal. No check execution bound to any build phase.
  • presto-connector/.eclipse-formatter.xml: Eclipse formatter profile (from log4j2-appenders, with 2-space indentation).
  • Taskfile wiring: lint:fix-java (spotless:apply) included in lint:fix, and lint:check-java (spotless:check) — defined but not included in lint:check.
  • README.md: documents the new lint tasks.

Note that this PR deliberately does not format the sources or enforce the check. Nothing at this commit (CI, lint:check, or the Maven build) runs the check. The follow-up stacked on top (#41) commits the auto-formatting output and turns on enforcement atomically.

Breaking changes

None

Validation performed

Summary by CodeRabbit

  • New Features

    • Added Java formatting checks and automatic formatting tasks for the Presto connector.
    • Updated the general fix task to include Java formatting alongside YAML formatting.
  • Documentation

    • Expanded the linting guide with instructions for running Java formatting checks and fixes.
  • Style

    • Standardised Java formatting with a shared Eclipse formatter profile.
    • Added consistent import ordering and automatic removal of unused imports.

@jackluo923
jackluo923 requested review from a team and 20001020ycx as code owners July 30, 2026 20:35
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5a2bda58-1294-49df-9773-a99072259cbe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an Eclipse formatter profile and Spotless Maven configuration for the Presto connector. Taskfiles expose Java check and fix commands, integrate them with shared lint tasks, and document the commands.

Changes

Java quality tooling and lint integration

Layer / File(s) Summary
Spotless formatter configuration
presto-connector/.eclipse-formatter.xml, presto-connector/pom.xml
Adds Eclipse formatting rules and configures Spotless with CleanThat, import ordering, and unused-import removal.
Java lint task workflow
taskfiles/presto-connector/lint.yaml, taskfiles/presto-connector/main.yaml, taskfiles/lint.yaml, README.md
Adds connector Java check and fix tasks, includes them in shared lint workflows, and documents the commands.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: kirkrodrigues, 20001020ycx

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Taskfile
  participant MavenWrapper
  participant Spotless
  Developer->>Taskfile: Run check-java or fix-java
  Taskfile->>MavenWrapper: Invoke spotless:check or spotless:apply
  MavenWrapper->>Spotless: Execute configured Java formatting
  Spotless-->>MavenWrapper: Return validation or formatting result
  MavenWrapper-->>Taskfile: Return task status
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.06% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Spotless formatting support for the Java plugin.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/presto-connector-linting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@presto-connector/pom.xml`:
- Around line 320-342: Bind the Spotless check execution in the
spotless-maven-plugin configuration to the Maven validate phase by adding an
explicit phase to the execution containing the check goal. Preserve the existing
formatting configuration, and remove or tolerate any separate lint invocation
that would otherwise duplicate spotless:check.

In
`@presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpConfig.java`:
- Around line 89-92: Replace each unary negation with the required false
comparison while preserving behavior: update the regex predicate in
ClpConfig.java (89-92), schema-membership predicates in ClpMetadata.java (91 and
107), empty-directory and empty-database-name checks in
ClpMySqlMetadataProvider.java (110-113 and 136-139), and both
polymorphism/type-comparison checks in ClpSchemaTree.java (132-148) to use false
== expression.

In
`@presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpTableHandle.java`:
- Around line 27-33: Reformat the `@JsonCreator` constructors in ClpTableHandle
(presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpTableHandle.java,
lines 27-33) and ClpTableLayoutHandle
(presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpTableLayoutHandle.java,
lines 28-36) so each `@JsonProperty` annotation remains on the same line as its
parameter type and name; alternatively adjust the Eclipse formatter
annotation-wrap setting to preserve this layout for future constructors.

In
`@presto-connector/src/main/java/com/facebook/presto/plugin/clp/codec/ClpColumnHandleCodec.java`:
- Line 48: Replace the negated instanceof checks with the configured
false-comparison style: use false == (handle instanceof ClpColumnHandle) in
ClpColumnHandleCodec, false == (handle instanceof ClpSplit) in ClpSplitCodec,
false == (handle instanceof ClpTableHandle) in ClpTableHandleCodec, and false ==
(handle instanceof ClpTableLayoutHandle) in ClpTableLayoutHandleCodec. Update
the corresponding checks in all four specified files and preserve their existing
behavior.

In
`@presto-connector/src/main/java/com/facebook/presto/plugin/clp/split/filter/ClpMySqlSplitFilterProvider.java`:
- Around line 71-89: Escape the configured column name before interpolating it
into the regex patterns in the mapping loop of ClpMySqlSplitFilterProvider.
Quote key for literal regex matching, then use the escaped value in all three
String.format patterns so names containing metacharacters such as "." cannot
match unintended SQL text.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5a115c1e-f307-4cf6-ad66-c62fd624b73a

📥 Commits

Reviewing files that changed from the base of the PR and between d5a54a4 and ed76f58.

📒 Files selected for processing (59)
  • README.md
  • presto-connector/.eclipse-formatter.xml
  • presto-connector/pom.xml
  • presto-connector/spotbugs-exclude.xml
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpColumnHandle.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpConfig.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpConnector.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpConnectorFactory.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpErrorCode.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpExpression.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpFunctions.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpHandleResolver.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpMetadata.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpModule.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpPlugin.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpRecordSetProvider.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpSplit.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpSplitManager.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpTableHandle.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpTableLayoutHandle.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpTransactionHandle.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/codec/ClpColumnHandleCodec.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/codec/ClpConnectorCodecProvider.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/codec/ClpSplitCodec.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/codec/ClpTableHandleCodec.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/codec/ClpTableLayoutHandleCodec.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/codec/ClpTransactionHandleCodec.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/codec/CodecUtils.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/metadata/ClpMetadataProvider.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/metadata/ClpMySqlMetadataProvider.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/metadata/ClpSchemaTree.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/metadata/ClpSchemaTreeNodeType.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/optimization/ClpComputePushDown.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/optimization/ClpFilterToKqlConverter.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/optimization/ClpPlanOptimizerProvider.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/optimization/ClpUdfRewriter.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/split/ClpMySqlSplitProvider.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/split/ClpSplitProvider.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/split/filter/ClpMySqlSplitFilterProvider.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/split/filter/ClpSplitFilterConfig.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/split/filter/ClpSplitFilterConfigCustomOptionsDeserializer.java
  • presto-connector/src/main/java/com/facebook/presto/plugin/clp/split/filter/ClpSplitFilterProvider.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/ClpMetadataDbSetUp.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/ClpQueryRunner.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/TestClpFilterToKql.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/TestClpMetadata.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/TestClpQueryBase.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/TestClpSplit.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/TestClpUdfRewriter.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/codec/TestClpConnectorCodecProvider.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/mockdb/ClpMockMetadataDatabase.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/mockdb/table/ArchivesTableRows.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/mockdb/table/ColumnMetadataTableRows.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/mockdb/table/DatasetsTableRows.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/split/filter/TestClpMySqlSplitFilterConfig.java
  • presto-connector/src/test/java/com/facebook/presto/plugin/clp/split/filter/TestClpSplitFilterConfigCommon.java
  • taskfiles/lint.yaml
  • taskfiles/presto-connector/lint.yaml
  • taskfiles/presto-connector/main.yaml

Comment thread presto-connector/pom.xml Outdated
Comment thread presto-connector/src/main/java/com/facebook/presto/plugin/clp/ClpConfig.java Outdated
@jackluo923
jackluo923 force-pushed the feat/presto-connector-linting branch from ed76f58 to c053eba Compare July 30, 2026 23:56
@jackluo923
jackluo923 force-pushed the feat/presto-connector-linting branch from c053eba to fa36d8d Compare July 31, 2026 00:15
@jackluo923 jackluo923 changed the title feat(presto-connector): Add Spotless and SpotBugs linting for the Java plugin. feat(presto-connector): Add Spotless formatting checks for the Java plugin. Jul 31, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
presto-connector/pom.xml (1)

319-324: 🎯 Functional Correctness | 🟠 Major

Add the missing <phase>validate</phase> binding.

The surrounding comment says phase:validate, but the check execution at Lines 320–324 has no <phase>. Formatting therefore is not enforced during the Maven validate lifecycle; the direct Taskfile invocation only masks this gap. This is the same unresolved issue raised in the previous review.

Proposed fix
         <execution>
+          <phase>validate</phase>
           <goals>
             <goal>check</goal>
           </goals>
         </execution>
#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
import xml.etree.ElementTree as ET

ns = {"m": "http://maven.apache.org/POM/4.0.0"}
pom = ET.parse("presto-connector/pom.xml")

for execution in pom.findall(
    ".//m:plugin[m:artifactId='spotless-maven-plugin']/m:executions/m:execution",
    ns,
):
    goals = {
        goal.text
        for goal in execution.findall("./m:goals/m:goal", ns)
    }
    if "check" in goals:
        assert execution.findtext("m:phase", namespaces=ns) == "validate"
        break
else:
    raise SystemExit("Spotless check execution not found")
PY
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@presto-connector/pom.xml` around lines 319 - 324, Add the missing validate
lifecycle binding to the Spotless execution containing the check goal in the
Maven configuration. Update that execution, rather than nearby goals or plugins,
so its phase is validate and formatting checks run during Maven validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@presto-connector/pom.xml`:
- Around line 319-324: Add the missing validate lifecycle binding to the
Spotless execution containing the check goal in the Maven configuration. Update
that execution, rather than nearby goals or plugins, so its phase is validate
and formatting checks run during Maven validation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8198dcb5-5ac3-4ad6-9c5e-896a5b73eb40

📥 Commits

Reviewing files that changed from the base of the PR and between ed76f58 and fa36d8d.

📒 Files selected for processing (6)
  • README.md
  • presto-connector/.eclipse-formatter.xml
  • presto-connector/pom.xml
  • taskfiles/lint.yaml
  • taskfiles/presto-connector/lint.yaml
  • taskfiles/presto-connector/main.yaml

@jackluo923
jackluo923 force-pushed the feat/presto-connector-linting branch from d9baf86 to 848e61e Compare July 31, 2026 00:37
@jackluo923 jackluo923 changed the title feat(presto-connector): Add Spotless formatting checks for the Java plugin. feat(presto-connector): Add Spotless formatting for the Java plugin. Jul 31, 2026
@jackluo923
jackluo923 force-pushed the feat/presto-connector-linting branch 2 times, most recently from 278e731 to 0993d3c Compare July 31, 2026 15:06
@jackluo923
jackluo923 requested a review from kirkrodrigues July 31, 2026 18:32
@jackluo923
jackluo923 force-pushed the feat/presto-connector-linting branch from 0993d3c to 3149f5b Compare July 31, 2026 23:21

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@presto-connector/.eclipse-formatter.xml`:
- Line 132: Update the Eclipse formatter settings so both
org.eclipse.jdt.core.formatter.indentation.size and
org.eclipse.jdt.core.formatter.tabulation.size use value 2, ensuring the
presto-connector formatting style uses two-space indentation.

In `@README.md`:
- Around line 37-42: Update the README lint command documentation to clarify
that the aggregate lint:check currently runs only YAML checks; explicitly
instruct developers to run lint:check-java separately, and state that Java
checking is not enforced by the aggregate command in this commit.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ecb75aa8-9163-4c7b-ad9c-d184368254e8

📥 Commits

Reviewing files that changed from the base of the PR and between 278e731 and 3149f5b.

📒 Files selected for processing (6)
  • README.md
  • presto-connector/.eclipse-formatter.xml
  • presto-connector/pom.xml
  • taskfiles/lint.yaml
  • taskfiles/presto-connector/lint.yaml
  • taskfiles/presto-connector/main.yaml

<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
import xml.etree.ElementTree as ET

path = "presto-connector/.eclipse-formatter.xml"
settings = {
    node.attrib["id"]: node.attrib["value"]
    for node in ET.parse(path).findall(".//setting")
}

assert settings["org.eclipse.jdt.core.formatter.indentation.size"] == "2"
assert settings["org.eclipse.jdt.core.formatter.tabulation.size"] == "2"
PY

Repository: y-scope/clp-plugin-presto-connector

Length of output: 261


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
import xml.etree.ElementTree as ET
from pathlib import Path

path = Path("presto-connector/.eclipse-formatter.xml")
assert path.exists()

tree = ET.parse(path)
root = tree.getroot()
ns = {"j": "http://www.eclipse.org/jdt/core/formatter"}

settings = {node.attrib["id"]: node.attrib["value"] for node in root.findall(".//setting")}
print("indentation.size:", settings.get("org.eclipse.jdt.core.formatter.indentation.size"))
print("tabulation.size:", settings.get("org.eclipse.jdt.core.formatter.tabulation.size"))
print("tabulation.char:", settings.get("org.eclipse.jdt.core.formatter.tabulation.char"))

for node in root.findall(".//setting"):
    if node.attrib["id"] in {
        "org.eclipse.jdt.core.formatter.indentation.size",
        "org.eclipse.jdt.core.formatter.tabulation.size",
        "org.eclipse.jdt.core.formatter.tabulation.char",
    }:
        print(f"{node.attrib['id']}={node.attrib['value']}")
PY

Repository: y-scope/clp-plugin-presto-connector

Length of output: 387


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
import xml.etree.ElementTree as ET

path = "presto-connector/.eclipse-formatter.xml"
settings = {
    node.attrib["id"]: node.attrib["value"]
    for node in ET.parse(path).findall(".//setting")
}

assert settings["org.eclipse.jdt.core.formatter.indentation.size"] == "2"
assert settings["org.eclipse.jdt.core.formatter.tabulation.size"] == "2"
PY

Repository: y-scope/clp-plugin-presto-connector

Length of output: 261


Set the Eclipse formatter to two-space indentation.

presto-connector/.eclipse-formatter.xml uses space-based indentation, but both org.eclipse.jdt.core.formatter.indentation.size and org.eclipse.jdt.core.formatter.tabulation.size are set to 4. Set both values to 2 for the required two-space style.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@presto-connector/.eclipse-formatter.xml` at line 132, Update the Eclipse
formatter settings so both org.eclipse.jdt.core.formatter.indentation.size and
org.eclipse.jdt.core.formatter.tabulation.size use value 2, ensuring the
presto-connector formatting style uses two-space indentation.

Comment thread README.md
Comment thread presto-connector/pom.xml
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
<java>
<cleanthat/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a comment on why we need "cleanthat" as it is unclear what its purpose is. This will be useful for a future dev so they don't mistakenly decide we need to keep or remove it.

If they are not covered by another formatter we should also add the generic "trim white space" and "end with newline" steps.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment explaining CleanThat in caad2dc. It's the one step in the java block that rewrites code rather than reformatting it — it applies CleanThat's default SafeAndConsensual mutators, e.g. values.size() == 0 becomes values.isEmpty() — so the bare <cleanthat/> element doesn't convey what dropping it would cost.

On trim-whitespace and end-with-newline: they're already covered, so I haven't added them. I tested a file with trailing whitespace on code lines, in javadoc, in a block comment and in a line comment, plus no final newline, with <cleanthat/> removed so the <eclipse> step was isolated — it stripped every trailing space and added the newline. Both steps would be no-ops here.

One thing worth deciding separately: those steps live inside <java>, so they'd only ever cover .java files. If the goal is repo-wide whitespace hygiene (pom.xml, markdown, taskfiles), that needs a separate <formats> block — happy to add it if you want that.

@jackluo923
jackluo923 force-pushed the feat/presto-connector-linting branch from 3149f5b to 91d9f83 Compare August 2, 2026 04:27

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
presto-connector/.eclipse-formatter.xml (1)

132-132: ⚠️ Potential issue | 🟠 Major

Set both indentation sizes to 2.

org.eclipse.jdt.core.formatter.indentation.size and org.eclipse.jdt.core.formatter.tabulation.size are both set to 4. This does not implement the required two-space style. Set both values to 2.

Proposed formatter fix
-    <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+    <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="2"/>
...
-    <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+    <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="2"/>

Also applies to: 386-386

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@presto-connector/.eclipse-formatter.xml` at line 132, Update the Eclipse
formatter settings for org.eclipse.jdt.core.formatter.indentation.size and
org.eclipse.jdt.core.formatter.tabulation.size to use value 2 instead of 4.
README.md (1)

37-42: ⚠️ Potential issue | 🟡 Minor

Clarify that Java checking is separate in this commit.

task lint:check still runs only the YAML check. Developers must run task lint:check-java separately until Java checking is added to the aggregate check. Update the text above this table to state this limitation.

Proposed documentation update
-The commands above run all linting checks, but for performance you may want to run a subset using
-one of the tasks in the table below.
+`task lint:check` runs YAML checks only in this commit. Run `task lint:check-java` separately.
+For performance, you may want to run a subset using one of the tasks in the table below.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 37 - 42, Update the documentation immediately above
the task table to state that task lint:check currently runs only the YAML check
and Java formatting must be checked separately with task lint:check-java until
Java checking is added to the aggregate command.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@presto-connector/.eclipse-formatter.xml`:
- Line 132: Update the Eclipse formatter settings for
org.eclipse.jdt.core.formatter.indentation.size and
org.eclipse.jdt.core.formatter.tabulation.size to use value 2 instead of 4.

In `@README.md`:
- Around line 37-42: Update the documentation immediately above the task table
to state that task lint:check currently runs only the YAML check and Java
formatting must be checked separately with task lint:check-java until Java
checking is added to the aggregate command.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 18db2e70-cfdf-4c3c-bc60-c9467f018e17

📥 Commits

Reviewing files that changed from the base of the PR and between 3149f5b and 91d9f83.

📒 Files selected for processing (6)
  • README.md
  • presto-connector/.eclipse-formatter.xml
  • presto-connector/pom.xml
  • taskfiles/lint.yaml
  • taskfiles/presto-connector/lint.yaml
  • taskfiles/presto-connector/main.yaml

Ports the Spotless half of #7 onto current main: the Eclipse formatter
profile is taken from #7 (LF-normalized; same plugin version), while
the pom and taskfile wiring is redone against main's restructured build
(mvnw, taskfiles/presto-connector/).

This commit ships the complete mechanism but runs none of it: both
lint:fix-java (spotless:apply, included in lint:fix) and
lint:check-java (spotless:check) are defined and available to invoke
by hand, yet nothing calls the check automatically -- no CI workflow,
no Maven phase binding, and no inclusion in the aggregate lint:check.
The sources are still unformatted here, so lint:check-java fails if
invoked; that is expected and harmless. The boundary is deliberate:
lint:check defines what the repo enforces, so check-java joins it only
in the follow-up, atomically with the mechanical reformat -- ensuring
no commit exists where the check is enforced but the sources are
unformatted, and every commit stays green under its own rules.
CleanThat is the only step in the `java` block that rewrites code rather than reformatting it, which isn't apparent from the bare `<cleanthat/>` element.
@jackluo923
jackluo923 force-pushed the feat/presto-connector-linting branch from 5245e0f to 2ec16cf Compare August 8, 2026 20:30
The private fork runs CI on self-hosted hardware, which the hardcoded `ubuntu-24.04` and `ubuntu-24.04-arm` labels gave it no way to select. Every job now reads its label set from a repository variable, matching the convention already used in clp-plugin-presto-velox.

Jobs that compile Velox or build images take the heavy variables; the rest take the light ones. `integration-tests` counts as heavy because it builds the connector before it starts a cluster, which is the bulk of its runtime. `pr-title-checks` moves off `ubuntu-latest` so no job is left unswitchable.

Each expression falls back to the label the job used before, so the public repository and pull requests from forks behave exactly as they did when the variables are unset.

`build-packages.sh` refused to run as root so that `sudo` would not leave the staging directories and artifacts owned by root. That also rejected the self-hosted runners, whose agent runs as root legitimately and is therefore the intended owner. The check now fires only when `SUDO_USER` is set, which is the case its message describes.
@jackluo923
jackluo923 changed the base branch from main to ci/configurable-runners August 11, 2026 03:35
The private fork runs CI on self-hosted hardware, which the hardcoded `ubuntu-24.04` and `ubuntu-24.04-arm` labels gave it no way to select. Every job now reads its label set from a repository variable, matching the convention already used in clp-plugin-presto-velox.

Jobs that compile Velox or build images take the heavy variables; the rest take the light ones. `integration-tests` counts as heavy because it builds the connector before it starts a cluster, which is the bulk of its runtime. `pr-title-checks` moves off `ubuntu-latest` so no job is left unswitchable.

Each expression falls back to the label the job used before, so the public repository and pull requests from forks behave exactly as they did when the variables are unset.

Running `integration-tests` on a self-hosted runner exposed two assumptions in `build-packages.sh` that only held on GitHub-hosted runners. It refused to run as root so that `sudo` would not leave the staging directories and artifacts owned by root, which also rejected an agent that runs as root legitimately and is therefore the intended owner; the check now fires only when `SUDO_USER` is set, which is the case its message describes. It also staged container output under `/tmp`, which a containerized runner's Docker daemon cannot bind-mount because the path exists only in the job's own mount namespace; staging now sits under the source tree, which is bind-mounted into the container either way.

The tests themselves now run in a container on the cluster's network rather than against a published port, because a published port is reachable only from a process that shares a network namespace with the Docker daemon, which a containerized runner does not. The cluster's lifecycle moves from the `client` fixture to `integration-tests:up` and `:down`, so the harness no longer runs `docker compose` and pytest keeps working unchanged from the host, against the port that is still published for that purpose. CI gives each run its own compose project and an arbitrary host port, because a machine can run more than one job at a time, and stops the cluster in its own step now that a runner outlives the job.
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.

2 participants