Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: gradlefied spotless (do not merge) #50940

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

aaronsteers
Copy link
Collaborator

@aaronsteers aaronsteers commented Jan 5, 2025

What

Bring spotless config and fixes into Gradle.

How

  1. Replace the maven pom config with configuration in build.gradle.
  2. Replace maven with gradle when invoking spotless in pre-commit.
  3. Apply any formatting diffs (in a separate PR) and ensure the repo is fully formatted.

Enables ./gradlew spotlessApply as well as the more targeted invocation:

  • ./gradlew :airbyte-integrations:connectors:destination-mssql-v2:spotlessApply

Resolves: "Could not get unknown property 'first' for project of type org.gradle.api.Project."
Copy link

vercel bot commented Jan 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 5, 2025 8:24am

@@ -68,6 +68,7 @@ class AirbyteBulkConnectorExtension {
// Use a temporary configuration to find the Micronaut version
// in the transitive dependencies of the Bulk CDK base.
def tempConfiguration = project.configurations.detachedConfiguration()
// NOTE: I think this is failing: ("Could not get unknown property 'first' for project of type org.gradle.api.Project.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was not able to debug this and I'll probably need assistance to do so. Commenting out cdk = '...' worked but I think there's something else going on.

My best analysis is that in places like like 73, we are asking for .first as if this is a collection or list object, where it is actually already a singular Project object. That might be wrong, and I'm not at all clear why no one else would be running into this besides myself. Could be a version conflict or or issue on my local workspace, although I tried all the obvious things like aligning JDK and Gradle version... 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

We could simply choose to not apply formatting on gradle-groovy files. I believe there's an effort underway led by @jdpgrailsdev to move to gradle-kotlin.

@@ -68,6 +68,7 @@ class AirbyteBulkConnectorExtension {
// Use a temporary configuration to find the Micronaut version
// in the transitive dependencies of the Bulk CDK base.
def tempConfiguration = project.configurations.detachedConfiguration()
// NOTE: I think this is failing: ("Could not get unknown property 'first' for project of type org.gradle.api.Project.")
Copy link
Contributor

Choose a reason for hiding this comment

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

We could simply choose to not apply formatting on gradle-groovy files. I believe there's an effort underway led by @jdpgrailsdev to move to gradle-kotlin.

// targetExclude '**/generated/**/*'
// }
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

How do you get this to be fast? I've tried this and found it to be painfully slow and gave up. Which is why, in the past, the spotless plugin was applied only at the root project and targeted all **/*.java files, but that wasn't a panacea either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants