You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dennis-Mircea (via GitHub)" <gi...@apache.org> on 2026/06/01 08:16:43 UTC

[PR] [FLINK-39808] Tighten FlinkVersion.isSupported() to reject @Deprecated versions and restore the deprecate-and-raise-floor pattern [flink-kubernetes-operator]

Dennis-Mircea opened a new pull request, #1124:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1124

   ## What is the purpose of the change
   
   `FlinkVersion` had carried a contradiction since FLINK-37236 and FLINK-38147 added `@Deprecated` annotations to `v1_15` through `v1_18` without updating the runtime check. Documentation, javadoc, and the deprecation annotations all signaled those versions were unsupported, but `isSupported()` kept returning `true` because the floor was still `v1_15`. Users got no `UnsupportedFlinkVersion` events, no validation rejection, just a silent acceptance of versions every other signal in the codebase declared dead. FLINK-33089 had previously set the correct pattern (deprecate, raise the runtime floor, update docs in lockstep), but that pattern drifted.
   
   This PR restores that pattern, and goes one step further: instead of bumping a literal floor in `isSupported()`, the supported set is now derived from the `@Deprecated` annotations themselves. The annotation becomes the single source of truth. Future deprecations only need to add `@Deprecated` to the enum constant. There is no second site (the floor literal) to remember to update, which was the drift mechanism the previous pattern depended on a human catching.
   
   ## Brief change log
   
   - `FlinkVersion.isSupported()` now consults a private static `EnumSet` populated once at class init by reflecting over each enum constant's `@Deprecated` annotation. The `v1_15` (and now-unused `v1_19`) floor literal is gone.
   - Javadoc comments added for `v1_17` and `v1_18` ("Deprecated since 1.13 operator release") to match the pattern used for `v1_15` and `v1_16`.
   - `FlinkVersionTest` extended with a full behavior table (rejects `null` and `v1_13..v1_18`, accepts `v1_19..v2_4`) and a new structural-invariant test `supportedSetMatchesDeprecatedAnnotation` that iterates `values()` and cross-checks `isSupported(v) == !@Deprecated.isPresent(v)`. Any future contributor who marks a version `@Deprecated` without thinking about the floor will get a failing test, not a silent runtime regression.
   - Test fixtures and assertions retargeted off deprecated versions: builder defaults in `BaseTestUtils` and `TestUtils` moved to `v1_20`, parameterized version sets shifted to `{v1_19, v1_20}`, `DefaultValidatorTest` now asserts that `v1_15` and `v1_18` are rejected and `v1_19` is accepted, and the `UnsupportedFlinkVersion` boundary in `FlinkDeploymentControllerTest` and `FlinkSessionJobControllerTest` moved from `v1_15` to `v1_19`.
   - Docs:
     - English `docs/content/docs/custom-resource/overview.md` updated to list only currently-supported versions (`v1_19`, `v1_20`, `v2_0`, `v2_1`, `v2_2`).
     - English `docs/content/docs/custom-resource/reference.md` Notes column updated for `v1_17` and `v1_18`.
     - Chinese `docs/content.zh/docs/custom-resource/overview.md` and `reference.md` brought to parity with the English versions (the Chinese reference table was already drifted on `v1_15` and `v1_16`; this PR closes that drift too).
   - Drive-by: `ValidatorUtils.java` logger fix (`LoggerFactory.getLogger(FlinkUtils.class)` was wrong, should have been `ValidatorUtils.class`). Unrelated to the main change but trivially in scope of the same file touched by the test discovery. Happy to split into a separate `[hotfix]` if reviewers prefer.
   
   ## Verifying this change
   
   This change is covered by existing tests plus the new `FlinkVersionTest` cases.
   
   ## Does this pull request potentially affect one of the following parts
   
   - Dependencies (does it add or upgrade a dependency): no
   - The public API, i.e., is any changes to the `CustomResourceDescriptors`: no. The `FlinkVersion` enum constants are unchanged. `@Deprecated` was already present on `v1_15..v1_18` before this PR. The behavioral change is in `isSupported()`, which is not part of the CRD surface.
   - Core observer or reconciler logic that is regularly executed: yes, with a user-visible behavior change. Deployments and session jobs with `flinkVersion` in `v1_15..v1_18` will now produce an `UnsupportedFlinkVersion` warning event from `ValidatorUtils.validateSupportedVersion()` and be rejected by `DefaultValidator.validateFlinkVersion()`, where previously they were silently accepted despite the `@Deprecated` annotation.
   
   ## Documentation
   
   - Does this pull request introduce a new feature? No.
   - Is documentation updated? Yes. The English and Chinese versions of `overview.md` and `reference.md` under `docs/content*/docs/custom-resource/` are updated to match the new runtime behavior. The Chinese reference table is also brought to parity with the English one on rows it had drifted from earlier (`v1_15`, `v1_16`).
   


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-39808] Tighten FlinkVersion.isSupported() to reject @Deprecated versions and restore the deprecate-and-raise-floor pattern [flink-kubernetes-operator]

Posted by "Dennis-Mircea (via GitHub)" <gi...@apache.org>.
Dennis-Mircea commented on PR #1124:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1124#issuecomment-4605533567

   > I commented on the JIRA, I don't think we should merge this
   
   I implemented the suggestions made as part of JIRA comment. The PR is ready for review!


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-39808] Tighten FlinkVersion.isSupported() to reject @Deprecated versions and restore the deprecate-and-raise-floor pattern [flink-kubernetes-operator]

Posted by "gyfora (via GitHub)" <gi...@apache.org>.
gyfora merged PR #1124:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1124


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-39808] Tighten FlinkVersion.isSupported() to reject @Deprecated versions and restore the deprecate-and-raise-floor pattern [flink-kubernetes-operator]

Posted by "Dennis-Mircea (via GitHub)" <gi...@apache.org>.
Dennis-Mircea commented on PR #1124:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1124#issuecomment-4614121644

   @gyfora the CI workflow failure is unrelated to these changes:
   ```
   Error: ERROR]   
   Error: ERROR]   The project org.apache.flink:flink-kubernetes-operator-parent:1.16-SNAPSHOT (/app/pom.xml) has 1 error
   Error: ERROR]     Non-resolvable parent POM for org.apache.flink:flink-kubernetes-operator-parent:1.16-SNAPSHOT: Could not transfer artifact org.apache:apache:pom:23 from/to central (https://repo.maven.apache.org/maven2): authorization failed for https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom, status: 403 Forbidden and 'parent.relativePath' points at wrong local POM @ line 22, column 13 -> [Help 2]
   Error: ERROR] 
   Error: ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
   Error: ERROR] Re-run Maven using the -X switch to enable full debug logging.
   Error: ERROR] 
   Error: ERROR] For more information about the errors and possible solutions, please read the following articles:
   Error: ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
   Error: ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
   ```


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org