Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osc rq list "--exclude-target-project" not honored by API #5571

Closed
lethliel opened this issue Aug 7, 2018 · 6 comments
Closed

osc rq list "--exclude-target-project" not honored by API #5571

lethliel opened this issue Aug 7, 2018 · 6 comments
Assignees
Labels
Bug Frontend Things related to the OBS RoR app

Comments

@lethliel
Copy link
Member

lethliel commented Aug 7, 2018

Issue Description

osc rq list GNOME:Next gnome-calendar --exclude-target-project=GNOME:Next
lists a submit request which target-project is GNOME:Next

So API seems to not understand the xpath correctly.

Expected Result

No submit request should be shown

How to Reproduce

Issue the command
osc rq list GNOME:Next gnome-calendar --exclude-target-project=GNOME:Next

You will se sr #491700 which has the target project GNOME:Next

Further Information

  • xpath sent to the api and result:
osc api https://api.opensuse.org/search/request?match=%28state%2F%40name%3D%27declined%27+or+state%2F%40name%3D%27new%27+or+state%2
F%40name%3D%27review%27%29+and+%28action%2Ftarget%2F%40project%3D%27GNOME%3ANext%
27+or+submit%2Ftarget%2F%40project%3D%27GNOME%3ANext%27+or+action%2Fsource%2F%40projec
t%3D%27GNOME%3ANext%27+or+submit%2Fsource%2F%40project%3D%27GNOME%3ANext%27%29+
and+%28action%2Ftarget%2F%40package%3D%27rygel%27+or+submit%2Ftarget%2F%40package%3D%2
7gnome-calendar%27+or+action%2Fsource%2F%40package%3D%27gnome-
calendar%27+or+submit%2Fsource%2F%40package%3D%27gnome-
calendar%27%29+and+%28not%28action%2Ftarget%2F%40project%3D%27GNOME%3ANext%27+or+sub
mit%2Ftarget%2F%40project%3D%27GNOME%3ANext%27%29%29
<collection matches="1">
  <request id="491700" creator="...">
    <action type="submit">
      <source project="home:firebird619:branches:GNOME:Next" package="gnome-calendar" rev="4"/>
      <target project="GNOME:Next" package="gnome-calendar"/>
      <options>
        <sourceupdate>cleanup</sourceupdate>
      </options>
    </action>
    <state name="declined" who="dimstar" when="2017-04-28T10:49:30">
      <comment>please rebase - I updated GNOME:Factory to 3.24.1</comment>
    </state>
    <review state="accepted" when="2017-04-27T19:54:24" who="gnome-review-bot" by_user="gnome-review-bot">
      <comment>Check script succeeded</comment>
      <history who="gnome-review-bot" when="2017-04-27T19:54:45">
        <description>Review got accepted</description>
        <comment>Check script succeeded</comment>
      </history>
    </review>
    <description>Update to version 3.25.1</description>
  </request>

Human readable xpath:

match=(state/@name='declined' or state/@name='new' or state/@name='review') and 
(action/target/@project='GNOME:Next' or submit/target/@project='GNOME:Next' or 
action/source/@project='GNOME:Next' or submit/source/@project='GNOME:Next') and 
(action/target/@package='gnome-calendar' or submit/target/@package='gnome-calendar' or 
action/source/@package='gnome-calendar' or submit/source/@package='gnome-calendar') and 
(not(action/target/@project='GNOME:Next' or submit/target/@project='GNOME:Next'))
@coolo
Copy link
Member

coolo commented Aug 7, 2018

BTW: any chance osc could stop querying submit/* ? Requests don't use this since 2009

@lethliel
Copy link
Member Author

lethliel commented Aug 7, 2018

@coolo what is the correct path?

@coolo
Copy link
Member

coolo commented Aug 7, 2018

action/* is the only thing that will find something - submit/* is just ignored, but makes the xpath harder to read

@coolo
Copy link
Member

coolo commented Aug 7, 2018

So this is the simplified xpath:

(state/@name='declined' or state/@name='new' or state/@name='review') and 
(action/target/@project='GNOME:Next' or action/source/@project='GNOME:Next') and 
(action/target/@package='gnome-calendar' or action/source/@package='gnome-calendar') and 
not(action/target/@project='GNOME:Next')

and still fails

@coolo
Copy link
Member

coolo commented Aug 7, 2018

Sorry @name :)

@ChrisBr
Copy link
Member

ChrisBr commented Sep 4, 2018

@lethliel this should work:

(state/@name='declined' or state/@name='new' or state/@name='review') and 
(action/target/@project='GNOME:Next' or action/source/@project='GNOME:Next') and 
(action/target/@package='gnome-calendar' or action/source/@package='gnome-calendar') and 
(action/target/@project!='GNOME:Next')

The problem with the not is that it will generate a function which is currently not supported in the XPathSearch. I will look into it but not sure if this is currently worth to implement as we already have a workaround.

Edit: functions should also work, I will look into it! But as said, != should already work.

ChrisBr added a commit to ChrisBr/open-build-service that referenced this issue Sep 4, 2018
The produced query condition produced
did not negate the query and queried for a true
condition.

Fix openSUSE#5571
ChrisBr added a commit to ChrisBr/open-build-service that referenced this issue Sep 4, 2018
The produced query condition produced
did not negate the query and queried for a true
condition.

Fix openSUSE#5571
jberry-suse added a commit to jberry-suse/openSUSE-release-tools that referenced this issue Sep 9, 2018
Now that the bug related to openSUSE/open-build-service#5571 has been fixed
the inverted behavior of exclude_target_projects no longer works. As such
the argument should be removed and only way to get the desired behavior
is to override include_request_from_project which includes request sourced
from specific project. For the purposes of metrics only interested in
requests targeting a specific project.
jberry-suse added a commit to jberry-suse/openSUSE-release-tools that referenced this issue Nov 1, 2018
…arch.

Now that the bug related to openSUSE/open-build-service#5571 has been fixed
the inverted behavior of exclude_target_projects no longer works. As such
the argument should be removed and only way to get the desired behavior
is to override include_request_from_project which includes request sourced
from specific project. For the purposes of `devel-projects requests` only
interested in requests targeting a specific project.

See also commit 0b342a5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frontend Things related to the OBS RoR app
Projects
None yet
Development

No branches or pull requests

4 participants