yangjj-iso opened a new pull request, #7551:
URL: https://github.com/apache/shenyu/pull/7551
Plugin-handle import currently compares only the field name, so an existing
selector handle suppresses a rule handle with the same field name. Match
handles by `(field, type)` within the remapped target plugin, consistent with
the database uniqueness constraint.
Track successful inserts in the same set so exact duplicates in one import
batch, including source plugins mapped to the same target, are skipped. Count
only successful inserts and preserve creation-event publication.
Fixes #7456.
## Validation
- Added seven import regression tests covering different types, exact
duplicates, mixed batches, new plugins, plugin ID remapping, missing mappings,
and zero-row inserts.
- With the original implementation, the new suite reports five assertion
failures and zero errors; the issue's same-field/different-type case imports
zero handles instead of one.
- With the fix, all 45 selected service, controller, event-publisher,
config-import, and H2 mapper tests pass.
- Checkstyle reports zero violations. RAT and `git diff --check` pass.
```bash
./mvnw -B -ntp -pl shenyu-admin -am \
-Dtest=PluginHandleServiceImplTest,PluginHandleServiceTest,PluginHandleMapperTest,PluginHandleControllerTest,PluginHandleEventPublisherTest,ConfigsServiceTest,ConfigsExportImportControllerTest
\
-Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false \
-Djacoco.skip=true -Dmaven.javadoc.skip=true test
./mvnw -B -ntp -pl shenyu-admin -am apache-rat:check
```
Make sure that:
- [x] You have read the [contribution
guidelines](https://shenyu.apache.org/community/contributor-guide).
- [x] You submit test cases (unit or integration tests) that back your
changes.
- [ ] Your local test passed `./mvnw clean install
-Dmaven.javadoc.skip=true`. Scoped validation is recorded above; the full
repository build was not run.
--
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]