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

get_creator() does not return request creator #286

Closed
andreasstieger opened this issue Apr 12, 2017 · 6 comments
Closed

get_creator() does not return request creator #286

andreasstieger opened this issue Apr 12, 2017 · 6 comments

Comments

@andreasstieger
Copy link
Member

osc/core.py has the following:

    def get_creator(self):
        """return the creator of the request"""
        if len(self.statehistory):
            return self.statehistory[0].who
        return self.state.who

However this does not return the creator of the request, but the last one to change the request state. That is usually a reviewer.

Case in point: osc api '/request/487429'. The request creator is leaper , but get_creator() returns staging-bot once it performed some reviews.

<request id="487429" creator="leaper">
  <action type="submit">
   <!-- shortened -->
    <source project="openSUSE:Leap:42.2:Update" package="slrn.6594" rev="a761933975685be4f21679582fabf0de"/>
    <target project="openSUSE:Leap:42.3" package="slrn"/>
  </action>
  <state name="new" who="staging-bot" when="2017-04-11T17:44:58">
    <comment>ready to accept</comment>
  </state>
  <review state="accepted" when="2017-04-11T17:05:24" who="leaper" by_user="leaper">
   <!-- shortened -->
  </review>
   <!-- shortened -->
  <description>Automatic request from openSUSE:Leap:42.2:Update by UpdateCrawler</description>
</request>
marcus-h added a commit that referenced this issue Apr 12, 2017
There is no need to compute the request creator, because it is
stored in the request xml. Moreover, the old computation yields
a wrong result (see issue #286).
@marcus-h
Copy link
Member

marcus-h commented Apr 12, 2017 via email

@marcus-h
Copy link
Member

marcus-h commented Apr 12, 2017 via email

@andreasstieger
Copy link
Member Author

The removal of the get_creator() function breaks some factory bots... @lnussel @DimStar77

@lnussel
Copy link
Member

lnussel commented Apr 12, 2017

so, do we need to fix the code or can we have the function back for compatibility? CC @jberry-suse

marcus-h added a commit that referenced this issue Apr 12, 2017
Request.get_creator is used by some factory bots (see comment
in issue #286).

Note: Request.get_creator is deprecated and the "creator" attribute
should be used instead.
@marcus-h
Copy link
Member

marcus-h commented Apr 12, 2017 via email

@lnussel
Copy link
Member

lnussel commented Apr 12, 2017

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants