2 Aug 2024 |
Akashdeep Dhar | Trying to run commit by myself is bad as then I would also have to take care of the rollback when abnormal states are faced.
try:
print("Before")
session.flush()
data = UserExternal.from_orm(made_user).dict()
session.commit()
print("After")
except IntegrityError as expt:
logger.logger_object.warning("Uniquness constraint failed - Please try again")
logger.logger_object.warning(str(expt))
raise HTTPException(HTTP_409_CONFLICT, "Uniquness constraint failed - Please try again") from expt # noqa : E501
return {"action": "post", "user": data}
| 05:07:47 |
Akashdeep Dhar | Aurélien B: Moving the entire code to Asyncio database management (psycopg2 -> asyncpg, async database flushes etc.) helped ;P | 05:34:25 |
Akashdeep Dhar | ![image.png](https://matrix.org/_matrix/media/r0/thumbnail/fedora.im/c881e3902fe7c7aef69375bad0bac68cf9fce6f11819312982635577344?height=360&method=scale&width=360) Download image.png | 10:03:11 |
Akashdeep Dhar | Getting there | 10:03:12 |
Akashdeep Dhar | Aurélien B, Mehmet Baran Geylani: I have implemented a rudimentary HTTP basic authentication for the endpoints. You can find the information about the same here https://github.com/fedora-infra/webhook-to-fedora-messaging/pull/57#issuecomment-2265130255. | 11:48:27 |
Akashdeep Dhar | Aurélien B, Mehmet Baran Geylani: Please follow the steps there to setup a development database at your ends and test the code pushed so far. The last part (i.e. the messages endpoint) is left but it should be easy to port the same. Please feel free to make pushes against my branch or I will finish it off on Monday. | 11:50:21 |
| @gwmngilfen:ansible.im changed their display name from Gwmngilfen to Gwmngilfen (back Aug 14th). | 15:25:39 |
4 Aug 2024 |
@ghostcasper:matrix.org | Seems like we have a problem, I built the message endpoint and made some tests but it seems like FastAPI somehow converts the headers to lower-case. For example X-Github-Event > x-github-event. This is ok with the W2FM application. I made the required changes but it breaks the message schema and fails when creating objects. Should I update the message schema? Aurélien B Akashdeep Dhar | 10:39:22 |
5 Aug 2024 |
Akashdeep Dhar | In reply to @ghostcasper:matrix.org Seems like we have a problem, I built the message endpoint and made some tests but it seems like FastAPI somehow converts the headers to lower-case. For example X-Github-Event > x-github-event. This is ok with the W2FM application. I made the required changes but it breaks the message schema and fails when creating objects. Should I update the message schema? Aurélien B Akashdeep Dhar Yeah - HTTP headers are NOT case sensitive https://stackoverflow.com/questions/5258977/are-http-headers-case-sensitive | 04:08:53 |
Aurélien B | Yeah we can convert them to lowercase | 06:12:00 |
Akashdeep Dhar | Aurélien B: I have marked https://github.com/fedora-infra/webhook-to-fedora-messaging/pull/57 ready for review. | 06:43:40 |
Akashdeep Dhar | I will clean things up later - Mehmet Baran Geylani are you taking care of the webhook-to-fedora-messaging-messages changes? | 06:44:29 |
Aurélien B | Thanks! Not sure what you mean by "clean things up" though. Should I review it now or wait? | 06:45:28 |
Akashdeep Dhar | In reply to @abompard:fedora.im Thanks! Not sure what you mean by "clean things up" though. Should I review it now or wait? Please review it! I have some stuff left from the Flask times that are not even referenced (like validate_requests etc) that I will remove later | 06:46:06 |
Akashdeep Dhar | They do not interact with the updated codebase (and I think I am being a bit lazy here ;P) | 06:46:27 |
@ghostcasper:matrix.org | In reply to @t0xic0der:fedora.im I will clean things up later - Mehmet Baran Geylani are you taking care of the webhook-to-fedora-messaging-messages changes? Yes I can | 06:46:55 |
Akashdeep Dhar | In reply to @ghostcasper:matrix.org Yes I can Please do. TIA. | 06:47:08 |
@ghostcasper:matrix.org | In reply to @t0xic0der:fedora.im Please review it! I have some stuff left from the Flask times that are not even referenced (like validate_requests etc) that I will remove later Yes request variable in verify signature seems to be one of them | 06:48:05 |
Akashdeep Dhar | In reply to @ghostcasper:matrix.org Yes request variable in verify signature seems to be one of them Made some changes The request variable is no longer global here (Hated it when it was NGL) Now I have to pass it in | 06:48:37 |
Akashdeep Dhar | As a parameter | 06:48:41 |
@ghostcasper:matrix.org | Yes I had built some code for it but didn't push. Looking forward for your changes. Will change the message schema | 06:50:08 |
Akashdeep Dhar | In reply to @ghostcasper:matrix.org Yes I had built some code for it but didn't push. Looking forward for your changes. Will change the message schema Yep - Please feel free to make pushes against my PR. | 06:50:33 |
Aurélien B | In reply to @t0xic0der:fedora.im Please review it! I have some stuff left from the Flask times that are not even referenced (like validate_requests etc) that I will remove later Hmm OK. But you need to understand that reviewing this kind of PR is going to take me at least an hour, maybe more depending on the content, so I'd rather not start reviewing something you're not 100% happy with and that you may update while I'm reviewing, or it will just waste my time. | 07:15:51 |
Akashdeep Dhar | In reply to @abompard:fedora.im Hmm OK. But you need to understand that reviewing this kind of PR is going to take me at least an hour, maybe more depending on the content, so I'd rather not start reviewing something you're not 100% happy with and that you may update while I'm reviewing, or it will just waste my time. I will change things after you are done with reviewing. I will continue on with ARC investigation in the meanwhile. | 07:39:01 |
Akashdeep Dhar | Take your time, Aurélien B | 07:39:09 |
@ghostcasper:matrix.org | https://github.com/fedora-infra/webhook-to-fedora-messaging-messages/pull/18
Aurélien B Akashdeep Dhar
| 09:25:36 |
@ghostcasper:matrix.org | Check please | 09:25:37 |
@ghostcasper:matrix.org | Redacted or Malformed Event | 09:30:30 |
Aurélien B | Hey Zlopez , could you add me as a co-maintainer of https://pypi.org/project/fedora-planet-messages/ please? My PyPI username is abompard . | 14:06:59 |
Zlopez | Aurélien B: Done | 14:09:58 |