slachiewicz commented on code in PR #882:
URL: https://github.com/apache/incubator-xtable/pull/882#discussion_r3753441277


##########
.mvn/maven-build-cache-config.xml:
##########
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+-->
+<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.3.0";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.3.0 
https://maven.apache.org/xsd/build-cache-config-1.3.0.xsd";>
+    <configuration>
+        <enabled>true</enabled>
+        <remote enabled="false"/>
+        <local>
+            <!--
+              One generation per module. The default of 3 accumulates 
generations,
+              which matters because CI persists this directory between runs; a
+              single generation keeps the saved entry at one build's size.
+            -->
+            <maxBuildsCached>1</maxBuildsCached>
+        </local>
+    </configuration>
+    <executionControl>
+        <reconcile>
+            <plugins>
+                <!--
+                  Command line flags are not part of a module's checksum, so 
without
+                  this a build that skipped tests and one that ran them are
+                  indistinguishable to the cache. Listing a property makes any
+                  difference between the cached build and the current run a 
cache
+                  miss, in both directions.
+
+                  Deliberately no skipValue attribute: skipValue is a 
relaxation, not
+                  a guard. It tells the cache to tolerate a mismatch when the 
current
+                  run is the one skipping, which is exactly the exemption we 
do not
+                  want on a release build.
+                -->
+                <plugin artifactId="maven-surefire-plugin" goal="test">

Review Comment:
   Yes — and it turned out to matter more than the question implied. Two things 
came out of checking, both pushed in `3414da6`.
   
   **Failsafe itself.** It is bound in the parent POM to `integration-test` and 
`verify` with `<skip>${skipITs}</skip>`, and CI runs `install`, so integration 
tests do run on every build and a restored module skips them exactly as it 
skips unit tests. Added, one entry per goal — reconciles are matched per goal, 
and the two goals do not expose the same parameters (`testFailureIgnore` is on 
`verify` only; naming a parameter a goal does not have earns a warning on every 
build, which I checked against `help:describe` for failsafe 3.3.0 rather than 
guessing).
   
   **The one that actually bites.** Writing the failsafe entries made me test 
the surefire block properly instead of assuming it, and it does not cover 
`-Dmaven.test.skip=true`. The parent POM pins `<skip>${skipUTs}</skip>`, and 
explicit plugin configuration wins over the user property, so surefire's `skip` 
parameter reads identically whether the flag is there or not — and the module 
checksum comes out byte-identical. What the flag actually suppresses is *test 
compilation*.
   
   On `xtable-api`, Temurin 11, before the fix:
   
   ```
   $ ./mvnw clean install -pl xtable-api -Dmaven.test.skip=true   # 0 tests 
run, entry saved
   $ ./mvnw clean install -pl xtable-api
   [INFO] Found cached build, restoring org.apache.xtable:xtable-api from cache 
by checksum 70d4788128782ec7
   ```
   
   A plain `install` restoring a build whose tests never ran, reporting 
success. After adding a `maven-compiler-plugin:testCompile` reconcile on `skip`:
   
   ```
   [INFO] Plugin parameter mismatch found. Parameter: skip, expected: true, 
actual: false
   [INFO] Mojo cached parameters mismatch with actual, forcing full project 
build. Mojo: compiler:testCompile
   [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 - in 
org.apache.xtable.spi.extractor.TestExtractFromSource
   ...
   ```
   
   Plain-to-plain still restores, so the guard costs nothing in CI. This is a 
local-developer hazard rather than a CI one today — CI writes the cache only 
from the plain `install` on `main`, and the release job disables the cache 
outright — but it is precisely the failure mode the reconcile block exists to 
prevent, and it was open.
   
   `buildinfo.xml` now records all nine failsafe parameters as `tracked="true"` 
with no `Cannot find a Mojo parameter` warnings.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to