From 656411c2bc6a30feb536e9890018f496fde6ddd4 Mon Sep 17 00:00:00 2001 From: Pierre Laporte Date: Mon, 22 Sep 2025 11:59:38 +0200 Subject: [PATCH] Add missing RAT task in polaris-synchronizer --- polaris-synchronizer/README.md | 19 +++++++ .../auth/AuthenticationSessionWrapper.java | 18 ++++++ polaris-synchronizer/build.gradle.kts | 57 +++++++++++++++++++ .../polaris/tools/sync/polaris/CLIUtil.java | 18 ++++++ .../sync/polaris/ETagManagerFactory.java | 18 ++++++ .../sync/polaris/ETagManagerFactoryTest.java | 18 ++++++ polaris-synchronizer/settings.gradle.kts | 19 +++++++ 7 files changed, 167 insertions(+) diff --git a/polaris-synchronizer/README.md b/polaris-synchronizer/README.md index 6ac82df..52f473e 100644 --- a/polaris-synchronizer/README.md +++ b/polaris-synchronizer/README.md @@ -1,3 +1,22 @@ + + # Objective To provide users of [Apache Polaris (Incubating)](https://github.com/apache/polaris) a tool to be able to easily and efficiently diff --git a/polaris-synchronizer/api/src/main/java/org/apache/polaris/tools/sync/polaris/auth/AuthenticationSessionWrapper.java b/polaris-synchronizer/api/src/main/java/org/apache/polaris/tools/sync/polaris/auth/AuthenticationSessionWrapper.java index 5ce0304..da9350c 100644 --- a/polaris-synchronizer/api/src/main/java/org/apache/polaris/tools/sync/polaris/auth/AuthenticationSessionWrapper.java +++ b/polaris-synchronizer/api/src/main/java/org/apache/polaris/tools/sync/polaris/auth/AuthenticationSessionWrapper.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.polaris.tools.sync.polaris.auth; import org.apache.iceberg.rest.HTTPClient; diff --git a/polaris-synchronizer/build.gradle.kts b/polaris-synchronizer/build.gradle.kts index a0f2bee..d3f517d 100644 --- a/polaris-synchronizer/build.gradle.kts +++ b/polaris-synchronizer/build.gradle.kts @@ -1,5 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.nosphere.apache.rat.RatTask + plugins { id("java") + id("org.nosphere.apache.rat") version "0.8.1" } group = "org.apache.polaris.tools" @@ -21,4 +43,39 @@ tasks.named("jar").configure { tasks.test { useJUnitPlatform() +} + +tasks.named("rat").configure { + // Gradle + excludes.add("**/build/**") + excludes.add("gradle/wrapper/gradle-wrapper*") + excludes.add(".gradle") + + excludes.add("LICENSE") + excludes.add("DISCLAIMER") + excludes.add("NOTICE") + + // Git & GitHub + excludes.add(".git") + excludes.add(".github/pull_request_template.md") + + // Misc build artifacts + excludes.add("**/.keep") + excludes.add("logs/**") + excludes.add("**/*.lock") + + // Binary files + excludes.add("**/*.jar") + excludes.add("**/*.zip") + excludes.add("**/*.tar.gz") + excludes.add("**/*.tgz") + excludes.add("**/*.class") + + // IntelliJ + excludes.add(".idea") + excludes.add("**/*.iml") + excludes.add("**/*.iws") + + // Rat can't scan binary images + excludes.add("**/*.png") } \ No newline at end of file diff --git a/polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/CLIUtil.java b/polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/CLIUtil.java index 1232fe6..e246b2c 100644 --- a/polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/CLIUtil.java +++ b/polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/CLIUtil.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.polaris.tools.sync.polaris; /** diff --git a/polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/ETagManagerFactory.java b/polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/ETagManagerFactory.java index 9f1dc66..fe3d599 100644 --- a/polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/ETagManagerFactory.java +++ b/polaris-synchronizer/cli/src/main/java/org/apache/polaris/tools/sync/polaris/ETagManagerFactory.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.polaris.tools.sync.polaris; import org.apache.polaris.tools.sync.polaris.catalog.ETagManager; diff --git a/polaris-synchronizer/cli/src/test/java/org/apache/polaris/tools/sync/polaris/ETagManagerFactoryTest.java b/polaris-synchronizer/cli/src/test/java/org/apache/polaris/tools/sync/polaris/ETagManagerFactoryTest.java index 741d813..9e9c605 100644 --- a/polaris-synchronizer/cli/src/test/java/org/apache/polaris/tools/sync/polaris/ETagManagerFactoryTest.java +++ b/polaris-synchronizer/cli/src/test/java/org/apache/polaris/tools/sync/polaris/ETagManagerFactoryTest.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.polaris.tools.sync.polaris; import org.apache.polaris.tools.sync.polaris.catalog.NoOpETagManager; diff --git a/polaris-synchronizer/settings.gradle.kts b/polaris-synchronizer/settings.gradle.kts index 2521c97..1aebb91 100644 --- a/polaris-synchronizer/settings.gradle.kts +++ b/polaris-synchronizer/settings.gradle.kts @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + rootProject.name = "polaris-synchronizer" fun polarisSynchronizerProject(name: String) {