Skip to content

fix(optimizer): raise RuntimeError when listing events fails - #894

Open
jayyyyqwq wants to merge 1 commit into
kubeflow:mainfrom
jayyyyqwq:fix/optimizer-job-events-runtime-error
Open

jayyyyqwq wants to merge 1 commit into
kubeflow:mainfrom
jayyyyqwq:fix/optimizer-job-events-runtime-error

Conversation

@jayyyyqwq

Copy link
Copy Markdown

What this PR does / why we need it:

OptimizerClient.get_job_events says in its docstring that it raises RuntimeError if getting the events fails. In the Kubernetes backend only the timeout is handled, so any other error from list_namespaced_event (for example a 403 when the user cannot list events) comes out as the raw Kubernetes error.

The other methods in this backend already do it, for example list_jobs has except Exception and raises RuntimeError. I added the same for get_job_events.

I added a test that makes list_namespaced_event fail. On main (ee22b33) the timeout case passes and the other case fails with Exception: events are forbidden. With the change both pass. The existing "timeout" test for events goes through get_job first, so it never reached the events call.

I noticed TrainerClient.get_job_events has the same docstring and the same gap in the Trainer Kubernetes backend. I left it out to keep this small. Should I send that as a separate PR, or add it here?

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):

None.

Checklist:

  • Docs included if any changes are user facing

Signed-off-by: jayyyyqwq <jaychoukiker@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 23:27
@github-project-automation github-project-automation Bot moved this to Ready to Merge in Kubeflow SDK Oct 21, 2026
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign andreyvelich for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

🎉 Welcome to the Kubeflow SDK! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards
  • Our team will review your PR soon! cc @kubeflow/kubeflow-sdk-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Ready to Merge

Development

Successfully merging this pull request may close these issues.

2 participants