-
Notifications
You must be signed in to change notification settings - Fork 11
Bugfix: volume.json files should now be copied #467
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
Conversation
WalkthroughReplaced a private Input write call with the public Changes
Sequence Diagram(s)mermaid mermaid Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hello @jude-moo, I think you are right, thanks for spotting this. About the test failing: the problem seems to be an authentication error on our Gitlab. I tried to run locally and everything works. Could you please do a small modification to the code for me at ``jade/app/fetch.py``` and add a more explicit error logging: def fetch_from_gitlab(
url: str, path: str, branch: str, authorization_token: str = None
) -> PathLike | bool:
"""Download a repository from GitLab and extract
it to a temporary folder. It can also deal with authentication. Supported
authentication is by token.
Parameters
----------
url : str
path to the gitlab website (e.g. https://git.oecd-nea.org/)
path : str
path to the repository (e.g. /sinbad/sinbad.v2/sinbad-version-2-volume-1/FUS-ATN-BLK-STR-PNT-001-FNG-Osaka-Aluminium-Sphere-OKTAVIAN-oktav_al)
branch : str, optional
Branch to download. Default is jade.
authorization_token : str, optional
Authorization token to access the IAEA repository. Default is None.
Returns
-------
extracted_folder: Pathlike | bool
path to the extracted folder. False if the download was not successful.
"""
gl = gitlab.Gitlab(url=url, private_token=authorization_token, ssl_verify=False)
try:
gl.auth()
except gitlab.exceptions.GitlabAuthenticationError as e: <--
logging.error("Gitlab authentication failed")
logging.error(e) <--
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/jade/app/fetch.py (1)
93-96: Uselogging.exceptionfor better exception logging.While the current implementation correctly captures and logs the exception as requested, Python's
logging.exceptionmethod is specifically designed for logging exceptions within exception handlers. It automatically includes the traceback, providing more debugging context.Apply this diff:
except gitlab.exceptions.GitlabAuthenticationError as e: - logging.error("Gitlab authentication failed") - logging.error(e) + logging.exception("Gitlab authentication failed") return FalseBased on static analysis.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/jade/app/fetch.py(1 hunks)
🧰 Additional context used
🪛 Ruff (0.14.4)
src/jade/app/fetch.py
94-94: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
95-95: Use logging.exception instead of logging.error
Replace with exception
(TRY400)
|
@dodu94 The additional error message has been added to the PR. |
|
@jude-moo I fixed it now, please merge the updated developing branch into yours and we should be good to go |
|
@dodu94 developing branch has now been merged in |
|
Please merge the dev branch to ensure the passing of tests, sorry for this |
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Fixing the issue outline in #466. After going through the code I believe that the wrong function was being called. By changing to write() , _ _write() _ is being called anyway, alongside the check for the volumes.json file.
Summary by CodeRabbit
Refactor
Bug Fixes