•  
     
    story #10710 search on fields with duck typing
Summary
Empty
search on fields with duck typing
Empty

Overview

Allow to search on fields (outside semantics & "Always There Fields") without too much overhead in the query definition or column selection.

Apply "duck typing" principle: if it has the same name and has a compatible type, let's assume it's the same thing.

Compatible types definition:

  • All numerics (initial_effort could be fload or int): float
  • All list with same bind (eg a select box with static values and check box with static values) including open lists
  • String and text fields
  • Date
  • Date time (to be clear: date and date time are not compatible types)

Are excluded of search:

  • rank: doesn't make sense to search on this value that is purely internal
  • computed fields: as computed fields are computed on display we cannot search on them.
  • permission on artifact: cannot be searched on in TQL as of today.

Searches

In the following example we uses the the term exist for a field being in a tracker. The complete definition is:

  • The field is technically present in the tracker
  • The user who runs the query can read the content of the field

Base rules

When a field exists in ALL trackers of the query
And there is at least one of the field that is not compatible
Then there is an error

When a field exists in SOME trackers of the query
and there is least one of the field that is not compatible
Then there is an error

When a field exists in SOME trackers of the query
and all the fields are compatible
Then the query is performed on the trackers that share the field

Base scenario

Given the query category="foo" on tracker T1, T2
And category exists in T1,T2
And have a compatible definition
Then the query applies on both tracker

Given the query category="foo" on tracker T1, T2
And category exists in T1,T2
And doesn't have a compatible definition
Then the query gives an error: field category is present in T1 and T2 but their types cannot be compared (T1.category = text/md, T2.category = text/html)

Given the query category="foo" on tracker T1, T2
And category only exists in T1
Then the query only applies on T1

Exist rule precision: It means that if category exists in T1 and T2 but the current user can only see it in T1, then the query only applies on T1.

Filter as much as possible

Given the query category="foo" on tracker T1, T2, T3
And no tracker has category as field
Then the query lead to an error: no tracker is matching the query

Given the query category="foo" on tracker T1, T2, T3
And only T1 have category field
the query will apply on T1 only

Given the query category="foo" on tracker T1, T2, T3
And T1 & T2 have category field with compatible definitions (see Overview)
the query will apply on those 2 trackers

Two terms

Given the query category = "foo" and priority = "bar" on tracker T1, T2, T3
And category exists in T1, T2 but not in T3
And priority exists in T3 but not in T1,T2
Then the query gives no tracker is matching the query

Given the query category = "foo" and priority = "bar" on tracker T1, T2, T3
And category exists in T1, T2,T3
And priority exists in T3 but not in T1,T2
Then the query applies only on T3

List fields

List values may not exist in all trackers included in the query. In the same spirit as "duck typing" for fields, we apply the same method for list values:

Given the query list_field = "foo" on trackers T1, T2, T3
And list_field exists in T1, T2 and T3
And the list value "foo" exists in T1, T2 but not in T3
Then the query does not raise an error, and applies only on T1 and T2

Given the query list_field = "bar" on trackers T1, T2, T3
And list_field exists in T1, T2 and T3
And the list value "bar" does not exist in any of the three trackers above
Then the query raises an error that the list value "bar" does not exist

This is the case for list fields bound to static values, to users or to user groups.

Impacts on "single-tracker" TQL expert query

Previously, comparing an integer field with a float value (for example int_field > 3.3) was forbidden and raised an error. This constraint will be lifted. Since integer and float fields are treated as a single "numeric" category in cross-tracker search, we will lift this constraint to ease this work. Both float fields and integer fields will now allow comparisons to float values (3.3)

Empty
Empty
Status
Cross tracker search
Done
Development
  • [ ] Does it involves User Interface? 
  • [ ] Are there any mockups?
  • [ ] Are permissions checked?
  • [ ] Does it need Javascript development?
  • [ ] Does it need a forge upgrade bucket?
  • [ ] Does it need to execute things in system events?
  • [ ] Does it impact project creation (templates)?
  • [ ] Is it exploratory?
Empty
Details
#10710
Manuel Vacelet (vaceletm)
2024-10-17 10:19
2017-09-29 15:15
30832

References

Follow-ups

User avatar
Joris MASSON (jmasson)2024-10-17 10:19
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Is related to
    • Added is Covered by:
User avatar
Joris MASSON (jmasson)2024-03-18 14:02

Explain the behaviour of list values when absent from some trackers of the query


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar

Date & date time are not compatible.

A few examples:

Given ArtifactA.close_date(date) := 2024-02-14
When I search close_date = 2024-02-14 16:22
Then I cannot find the artifact, make sense

Given ArtifactA.close_date(date) := 2024-02-14
When I search close_date = 2024-02-14 00:00
Then I can find the artifact => it only works because technically it's stored as a timestamp but there is no way that functionnally it makes more sense than the first.

Given ArtifactA.close_date(date) := 2024-02-14
When I search close_date > 2024-02-14 16:22
Then I cannot find the artifact, that sounds sensible

Given ArtifactA.close_date(date) := 2024-02-14
When I search close_date < 2024-02-14 16:22
Then I cannot find the artifact, that sounds sensible

Given ArtifactA.close_date(date) := 2024-02-14
When I search close_date >= 2024-02-14 16:22 Or search close_date <= 2024-02-14 16:22 Then I cannot find the artifact => there is actually no way to find the artifact when I express the search term with date time.

However Given ArtifactA.close_date(date) := 2024-02-14
Given ArtifactB.close_date(date) := 2024-02-15
When I search close_date > 2024-02-14 16:22 or close_date >= 2024-02-14 16:22 Then I will find ArtifactB => that makes the feature quite unreliable


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar

XTS on artifact ids is not about duck-typed searches. It got a dedicated story #36812


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Is related to
User avatar

Artifact IDs should be searchable too.


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2024-02-08 10:40
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
Joris MASSON (jmasson)2024-01-31 16:15

Artifact links can already be searched with cross-tracker search since epic #32276


  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Status changed from Ready (stalled) to Selected
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Category set to Cross tracker search
User avatar
  • Acceptance criteria
    Something went wrong, the follow up content couldn't be loaded
    Only formatting have been changed, you should switch to markup to see the changes
  • Permissions set to