weiqingy opened a new issue, #1008:
URL: https://github.com/apache/flink-agents/issues/1008

   ### Search before asking
   
   - [X] I searched in the 
[issues](https://github.com/apache/flink-agents/issues) and found nothing 
similar.
   
   ### Description
   
   `tools/ut.sh -f` accepts any string. Nothing checks it against the versions 
the script can actually select, so a typo and a genuinely supported version are 
treated the same way, and one supported value selects a Maven profile that does 
not exist.
   
   This is a sibling of #1006, which covers the help text and the default. That 
issue is about what the script claims; this one is about what it accepts. 
#1006's fix deliberately leaves validation out of scope.
   
   ## Any value is accepted
   
   `tools/ut.sh:91` appends the argument with no check:
   
   ```bash
   flink_versions+=("$2")
   ```
   
   The value then reaches two places that assume it names something real. 
`tools/ut.sh:144`:
   
   ```bash
   dist_modules="${dist_modules},dist/flink-${version}"
   ```
   
   and `tools/ut.sh:158`:
   
   ```bash
   mvn ... -pl 'e2e-test/flink-agents-end-to-end-tests-integration' 
-Pflink-${version} ...
   ```
   
   So `tools/ut.sh -j -e -f 9.9` asks Maven to build `dist/flink-9.9`, a module 
that does not exist, and to activate `-Pflink-9.9`. The help text at 
`tools/ut.sh:46` lists the five supported versions, so the script already knows 
what the valid set is; it just does not use it.
   
   ## `-f 2.3` selects a profile that does not exist
   
   There is no `flink-2.3` profile anywhere in the repository. 
`e2e-test/flink-agents-end-to-end-tests-integration/pom.xml` defines only four, 
at `:157`, `:167`, `:177` and `:187`:
   
   ```
   flink-1.20, flink-2.0, flink-2.1, flink-2.2
   ```
   
   2.3 is instead that pom's unprofiled default, `:38-39`:
   
   ```xml
   <flink.version>${flink.2.3.version}</flink.version>
   
<flink.agents.dist.artifactId>flink-agents-dist-flink-2.3</flink.agents.dist.artifactId>
   ```
   
   So `-f 2.3` passes `-Pflink-2.3`, and Maven responds:
   
   ```
   [WARNING] The requested profile "flink-2.3" could not be activated because 
it does not exist.
   ```
   
   and continues. The build that follows is correct, because the pom's defaults 
already are the 2.3 values. The outcome is right; the mechanism is a silently 
ignored flag. `.github/workflows/ci.yml:246` passes `-f 2.3` on every run of 
the Java integration matrix, so this warning is in CI logs today.
   
   ## Adding the missing profile is not a mechanical copy
   
   Worth flagging before anyone assumes the fix is to paste a fifth profile. 
Each of the four existing profiles pins the log4j2 version alongside the Flink 
version, for example at `:189-191`:
   
   ```xml
   <flink.version>${flink.2.2.version}</flink.version>
   
<flink.agents.dist.artifactId>flink-agents-dist-flink-2.2</flink.agents.dist.artifactId>
   <flink.log4j2.version>2.24.3</flink.log4j2.version>
   ```
   
   The 2.3 default does not, so it inherits `2.25.3` from 
`e2e-test/pom.xml:34`. A copied profile would silently move the 2.3 job from 
log4j2 2.25.3 to 2.24.3, which is a change nobody asked for.
   
   ## Why this matters
   
   A mistyped `-f 2.4` looks like it worked. Maven warns about the unknown 
profile and carries on, the run goes green, and the reader believes they tested 
a version they did not test. The same shape hides the `-f 2.3` case, where the 
warning is real but harmless, which makes it easy to learn to ignore.
   
   ## Options
   
   The choice is the maintainers' to make.
   
   - Validate `-f` against the supported list the help text already carries, 
and fail fast on anything else.
   - Add the missing `flink-2.3` profile, taking care with 
`flink.log4j2.version` rather than copying a sibling wholesale.
   - Do both: validation catches typos, and the profile makes `-Pflink-<v>` 
mean something for every value validation admits.
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!
   


-- 
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