Git Product home page Git Product logo

Comments (11)

jph00 avatar jph00 commented on August 24, 2024 1

@jhlegarreta @roy-ht I've just cut a release which resolves the add_labels problem in my testing. Please reopen if you still have the same issue with the latest version.

(The issue was due to a change in the OpenAPI spec to use OpenAPI functionality that previously wasn't used, so wasn't handled by ghapi.)

from ghapi.

roy-ht avatar roy-ht commented on August 24, 2024

Same problem.

Looks like PR below removed "labels" parameter.
https://github.com/fastai/ghapi/pull/56/files#diff-c30c9ce3b3beef2fe22e63697886f9df7a89a846f0db015d7e36dab697aa58c5L599

from ghapi.

lemonshir avatar lemonshir commented on August 24, 2024

Hi team, we met the same problem when using the API repos.create_or_update_file_contents. The version we are using is ghapi==0.1.17. Could you help take a look? Thanks!

from ghapi.

lemonshir avatar lemonshir commented on August 24, 2024

Hi team, we met the same issue when calling another API. Could you help take a look? Thanks!

api.orgs.create_invitation('gm-test-org', '14024832')
---------------------------------------------------------------------------
HTTP422UnprocessableEntityError           Traceback (most recent call last)
<ipython-input-3-c1bd346371d5> in <module>
----> 1 api.orgs.create_invitation('gm-test-org', '14024832')

~/pyvenvs/osm/lib/python3.6/site-packages/ghapi/core.py in __call__(self, headers, *args, **kwargs)
     60         route_p,query_p,data_p = [{p:kwargs[p] for p in o if p in kwargs}
     61                                  for o in (self.route_ps,self.params,d)]
---> 62         return self.client(self.path, self.verb, headers=headers, route=route_p, query=query_p, data=data_p)
     63 
     64     def __str__(self): return f'{self.tag}.{self.name}{signature(self)}\n{self.doc_url}'

~/pyvenvs/osm/lib/python3.6/site-packages/ghapi/core.py in __call__(self, path, verb, headers, route, query, data)
    104         if path[:7] not in ('http://','https:/'): path = GH_HOST+path
    105         res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=self.debug, return_headers=True,
--> 106                                      route=route or None, query=query or None, data=data or None)
    107         if 'X-RateLimit-Remaining' in self.recv_hdrs:
    108             newlim = self.recv_hdrs['X-RateLimit-Remaining']

~/pyvenvs/osm/lib/python3.6/site-packages/fastcore/net.py in urlsend(url, verb, headers, route, query, data, json_data, return_json, return_headers, debug)
    177         return urlread(req, decode=False, return_json=False, return_headers=return_headers)
    178 
--> 179     return urlread(req, return_json=return_json, return_headers=return_headers)
    180 
    181 # Cell

~/pyvenvs/osm/lib/python3.6/site-packages/fastcore/net.py in urlread(url, data, headers, decode, return_json, return_headers, **kwargs)
    110         with urlopen(url, data=data, headers=headers, **kwargs) as u: res,hdrs = u.read(),u.headers
    111     except HTTPError as e:
--> 112         if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp) from None
    113         else: raise
    114 

HTTP422UnprocessableEntityError: HTTP Error 422: Unprocessable Entity

from ghapi.

lemonshir avatar lemonshir commented on August 24, 2024

@jph00 @hamelsmu could you help take a look when you get a chance? Thanks!

from ghapi.

hamelsmu avatar hamelsmu commented on August 24, 2024

I'll take a look within next week or so

from ghapi.

hamelsmu avatar hamelsmu commented on August 24, 2024

This is something I tried to debug, but it isn't a quick fix (or at least something I wasn't able to fix). I shared everything I could with @jph00, perhaps he might be able to help with this one. I suspect many of the open issues in this repo could be correlated.

from ghapi.

lemonshir avatar lemonshir commented on August 24, 2024

Thanks for your investigation, Hamel! I hope @jph00 could help on this issue.

from ghapi.

jph00 avatar jph00 commented on August 24, 2024

Hi team, we met the same problem when using the API repos.create_or_update_file_contents. The version we are using is ghapi==0.1.17. Could you help take a look? Thanks!

I've looked at this one and it's working fine in our tests. You can see a working example in the definition in the lib of update_contents(). Please take a look at this example and see if you can use it to help you get your working. If you can't, please create a new issue for this including your code and stack trace.

from ghapi.

jph00 avatar jph00 commented on August 24, 2024

Hi team, we met the same issue when calling another API. Could you help take a look?

I just tried calling that endpoint and it worked for me. Maybe you're using the wrong id? Note that you can use an email address instead, if you use the 'email' param.

from ghapi.

jhlegarreta avatar jhlegarreta commented on August 24, 2024

@jph00 thanks for the effort and sorry for the delay in updating.

I've tested the 0.1.18 release as the minimum version fixing the issue and it did work successfully, and hence the patch set fixed the issue:
https://github.com/jhlegarreta/labelertest/pull/22/checks?check_run_id=3166906022#step:5:495

Thanks 💯 !!

from ghapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.