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

Auto assignments with target filter queries like "type.id=not=XYZ" doesn't match targets without target type (with EclipseLink only)

Aperta
#2,758 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java
Ambito
backend, databases

Direzione di ricerca

Start with JpaTargetManagement.findByTargetFilterQueryAndNonDSAndCompatibleAndUpdatable and the TargetManagementSearchTest#shouldFindTargetsWithoutTypeByTypeIdNot test mentioned in the issue; the issue also points to PR #2759, which adds a test for this behavior. Run that test with EclipseLink and compare the result with Hibernate; done means targets without a type are included for the type.id=not=XYZ filter.

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

Descrizione

bug

Issue:

  • I have 4 devices: 2 of type NOT_XYZ and 2 without type.
  • I create target filter with "type.id=not=XYZ" and assign a distribution set (compatible with all devices)
  • Expected: all 4 devices should be involved
  • Result: only these of type NOT_XYZ are involved. Targets without type are not.

After some debug:

  • this behavior is observed with EclipseLink JPA provider only. With Hibernate it seems as expected - so, it seems the bug comes from there
  • JpaTargetManagement.findByTargetFilterQueryAndNonDSAndCompatibleAndUpdatable creates the following SQL queries:
# EclipseLink
SELECT DISTINCT * FROM sp_target t1 
  LEFT OUTER JOIN sp_target_type t0 ON (t0.id = t1.target_type) 
  LEFT OUTER JOIN (sp_target_type_ds_type t4 JOIN sp_distribution_set_type t2 ON (t2.id = t4.distribution_set_type)) ON (t4.target_type = t0.id), 
  sp_target_type t3 
  WHERE (((((t3.id IS NULL) OR (t1.target_type <> ?)) AND ((t1.target_type IS NULL) OR (t2.id = ?))) AND (t1.tenant = ?)) AND ((t3.id = t1.target_type) AND (t3.tenant = ?))) LIMIT ?, ?
# Hibernate
select distinct * from sp_target jt1_0 
  left join sp_target_type tt1_0 on tt1_0.id=jt1_0.target_type and tt1_0.tenant = ? 
  left join sp_target_type tt2_0 on tt2_0.id=jt1_0.target_type and tt2_0.tenant = ? 
  left join sp_target_type_ds_type dst1_0 on tt2_0.id=dst1_0.target_type
  where jt1_0.tenant = ? and (tt1_0.id is null or tt1_0.id<>?) and (jt1_0.target_type is null or dst1_0.distribution_set_type=?) limit ?,?
  • from the EclipseLink query it seems that the problem is that (t3.tenant = ?) check requires that there is a target type available
  • so, it seems that it is related to EclipseLink and its tenancy support

PS: added a PR with a tests that shows that behavior - https://github.com/eclipse-hawkbit/hawkbit/pull/2759 -> TargetManagementSearchTest#shouldFindTargetsWithoutTypeByTypeIdNot

Lingua principale
Java
Stelle
601
Fork
228
Merge medio
15h 58m
PR unite (30g)
62

Preparare l'ambiente

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 eclipse-hawkbit/hawkbit

Tutte le issue di eclipse-hawkbit/hawkbit

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.