You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/09/06 08:12:20 UTC

[PR] Apply default shadow algorithm when swapping YAML shadow rule [shardingsphere]

thswlsqls opened a new pull request, #39749:
URL: https://github.com/apache/shardingsphere/pull/39749

   Fixes #39748.
   
   Changes proposed in this pull request:
     - Assign `defaultShadowAlgorithmName` before the two `setTableDefault*` calls in `YamlShadowRuleConfigurationSwapper.swapToObject()`, so a shadow table that omits `shadowAlgorithmNames` inherits the default algorithm.
     - The method contradicted itself: `setTableDefaultShadowDataSource(...)` worked because `result.setDataSources(...)` ran first, while the very next line passed `result.getDefaultShadowAlgorithmName()`, assigned only afterwards and therefore always `null`. The helper's `null != defaultShadowAlgorithmName` guard turned that call into a no-op.
     - Such a table kept an empty algorithm list, so startup failed with `MissingRequiredAlgorithmException` from `ShadowRuleConfigurationChecker`.
     - `swapToYamlConfiguration()` in the same class already assigns the default name before calling both helpers.
     - The statement order changed in #33511; this restores it.
     - Added `YamlShadowRuleConfigurationSwapperTest` covering the inherited default, no default, and a table declaring its own algorithm names. The existing `ShadowRuleConfigurationYamlIT` fixture declares algorithms on every table, so it never exercised this path.
   
   AI assistance: Claude Code was used to draft the change and its unit tests in `features/shadow/core`. I reviewed, verified, and take responsibility for every line submitted.
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`. Ran instead, on this branch rebased onto master: repository-wide `./mvnw spotless:check -Pcheck -T1C`, `./mvnw checkstyle:check -Pcheck -T1C` and `./mvnw apache-rat:check -Pcheck -T1C`, plus `./mvnw install -pl features/shadow/core -am -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e` (107 tests, 0 failures). The full-repository `clean install` was not run locally.
   - [ ] I have made corresponding changes to the documentation. No documentation change is needed: this restores the documented `defaultShadowAlgorithmName` behaviour without changing the YAML schema.
   - [x] I have added corresponding unit tests for my changes.
   - [x] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
   - [x] I have disclosed the tool and affected files or scope for any material AI assistance, as required by the [AI-assisted contribution policy].
   
   [AI-assisted contribution policy]: https://github.com/apache/shardingsphere/blob/master/AI_POLICY.md
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


Re: [PR] Apply default shadow algorithm when swapping YAML shadow rule [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu merged PR #39749:
URL: https://github.com/apache/shardingsphere/pull/39749


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


Re: [PR] Apply default shadow algorithm when swapping YAML shadow rule [shardingsphere]

Posted by "thswlsqls (via GitHub)" <gi...@apache.org>.
thswlsqls commented on PR #39749:
URL: https://github.com/apache/shardingsphere/pull/39749#issuecomment-5629471650

   @terrymanu Thanks. Rebased onto master — the failing `MySQLSQLNodeConverterEngineIT` cases were the MySQL `!` precedence issue already fixed on master by #39744 and #39760, not anything this PR touches, so there is no code change here and CI is green on the new head.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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


Re: [PR] Apply default shadow algorithm when swapping YAML shadow rule [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on PR #39749:
URL: https://github.com/apache/shardingsphere/pull/39749#issuecomment-5586550675

   Please fix CI first


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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