Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] Plugin exclusion search retains matches because negative predicates use OR

Chiusa Adatta ai principianti
#7,690 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@VelpulaGangavardhan ci sta già lavorando.

Dal 19/10/2026.

  • #7691 di @konlue — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, sql
Ambito
backend, databases

Direzione di ricerca

Il predicato errato si trova in shenyu-admin/src/main/resources/mappers/plugin-sqlmap.xml intorno alle righe 255-260 e in namespace-plugin-rel-sqlmap.xml intorno alle righe 179-184; inizia dagli statement searchByCondition e da come PluginServiceImpl.searchByCondition() passa il valore di excluded. Sostituisci l'OR tra i predicati negativi name e role con AND, oppure nega la corrispondenza positiva combinata, in entrambi i mapper. È completato quando escludere 'divide' rimuove la riga (divide, Proxy) dai dati H2 di seed, (request, HttpProcess) viene mantenuta e i campi nullable continuano a comportarsi come prima.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

admin sql type: bug
Current behavior

Plugin search combines exclusions across name and role with OR:

name NOT LIKE :excluded OR role NOT LIKE :excluded

For the seeded plugin name='divide', role='Proxy', excluding divide still returns the plugin because role NOT LIKE '%divide%' is true. Excluding a role likewise retains its plugins whenever their names do not contain that role. A row is removed only if both columns contain the excluded term.

Locations

PluginServiceImpl.searchByCondition() initializes the keyword!excluded syntax before calling the mapper. NamespacePluginQueryCondition inherits the same exclusion field, and its paged search uses the namespace mapper.

Expected behavior / impact

P3 / Low. Exclusion search should remove a plugin when either searchable field contains the excluded term, i.e. negate the positive predicate (name LIKE term OR role LIKE term). This affects administrative search results and pagination, rather than gateway traffic.

Reproduction and evidence
  1. Use plugins (divide, Proxy) and (request, HttpProcess); these name/role combinations exist in the H2 seed data.
  2. Run a plugin search with excluded='divide' (or the ordinary plugin search keyword !divide).
  3. Expected: request only. Current predicate: both divide and request.

A local SQL predicate probe extracted each exclusion clause directly from its current MyBatis XML and executed it against these two rows in an in-memory SQLite database. Both returned the excluded plugin. The probe verifies standard SQL boolean semantics; a full running Admin/MyBatis request was not exercised.

Suggested fix

Use AND between the negative predicates in both mappers, or an equivalent explicit negation of the positive predicate. Preserve intended handling of nullable fields and existing include/exclude keyword semantics.

Related existing work

Searched the 3,074-issue baseline, 85 open PR titles, and live plugin/excluded searches. #6614 is a namespace-plugin enabled result-map typo; #6717 concerns the separate nameExistedExclude query and a missing column. Neither addresses boolean exclusion logic in these searchByCondition statements. The two affected mappers are grouped here because they share the same root cause.

Environment

Apache ShenYu 2.7.2-SNAPSHOT, master@66d7d954ca37d651a5ad916f988a8081157a7ab4. Unit-test and CI issue categories excluded.

Lingua principale
Java
Stelle
8.9k
Fork
3.1k
Merge medio
2g 2h
PR unite (30g)
414

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/shenyu

Tutte le issue di apache/shenyu

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.