Repository navigation
Conversation
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 85e6ecc. Configure here.
| self.error_type = dct.get("errorType", dct.get("ErrorType")) | ||
| self.metadata = dct.get("metadata", dct.get("Metadata")) |
There was a problem hiding this comment.
Curious why we should keep the dct.get("ErrorType") & dct.get("Metadata") fallbacks.
Both get_job_info and list_job_info build RayJobInfo from the API server response, which is always camelCase (errorType / metadata), so the PascalCase keys never appear in the response.
I think it makes more sense to default to None
| self.error_type = dct.get("errorType", dct.get("ErrorType")) | |
| self.metadata = dct.get("metadata", dct.get("Metadata")) | |
| self.error_type = dct.get("errorType", None) | |
| self.metadata = dct.get("metadata", None) |
There was a problem hiding this comment.
Thanks for the feedback. I removed both PascalCase fallbacks. The API gateway marshals these proto messages with UseProtoNames: false, so error_type is exposed as errorType; metadata stays lowercase.
| from python_apiserver_client.params import RayJobInfo | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("error_key,metadata_key", [("errorType", "metadata"), ("ErrorType", "Metadata")]) |
There was a problem hiding this comment.
The ("ErrorType", "Metadata") test case can be dropped too.
There was a problem hiding this comment.
Agreed; I removed the ("ErrorType", "Metadata") parameter case. The test now covers the API server field names and the absent optional fields.
| assert info.metadata is None | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("list_jobs", [False, True]) |
There was a problem hiding this comment.
A small optional suggestion: could we add explicit IDs so the pytest output shows the method instead of showing [False] / [True]? I tried this locally and all four tests still pass.
| @pytest.mark.parametrize("list_jobs", [False, True]) | |
| @pytest.mark.parametrize( | |
| "list_jobs", [False, True], ids=["get_job_info", "list_job_info"] | |
| ) |
There was a problem hiding this comment.
Added get_job_info and list_job_info IDs. All four job-info tests pass.
justinyeh1995
left a comment
There was a problem hiding this comment.
Thanks for the contribution. "Read the API's field names while retaining compatibility with the previously accepted capitalized keys." in the pr description no longer holds. Can you update it to "Read the API's camelCase field names."?
|
@justinyeh1995 Updated the description to "Read the API's camelCase field names." and corrected the test count to four. |
|
The History Server E2E job on |
Have you tried rebasing to the latest commit on remote master? |
Signed-off-by: git-jxj <65210887+git-jxj@users.noreply.github.com>
d1ab78d to
1ee686b
Compare
|
@justinyeh1995 Rebased onto the latest master ( This includes #5342, which disables the History Server E2E step with All four job-info regression tests and the applicable file checks pass after the rebase. The unrelated |
There was a problem hiding this comment.
Thanks. LGTM. cc @machichima to take a look if you have the time.
|
Could a maintainer approve the workflows awaiting authorization for head |
|
Done |
machichima
left a comment
There was a problem hiding this comment.
Could you please paste the manual test result (before / after this change) in the PR description against the real API server?
Also, please run the unit test locally and paste the result here, since we do not have CI for it yet.
Thank you!
There was a problem hiding this comment.
Instead of creating a new test file, could we add assertions under test_submission in clients/python-apiserver-client/test/api_params_test.py?
kuberay/clients/python-apiserver-client/test/api_params_test.py
Lines 398 to 427 in 475c0a0
There was a problem hiding this comment.
Moved the assertions into api_params_test.py::test_submission and removed the separate test file.
|
@machichima I tested this against a real API server with a Ray 2.55.0 cluster. For the same failed job, both The local unit test results are: The same |
Signed-off-by: xinjun.jiang <xinjun.jiang@daocloud.io>
Signed-off-by: xinjun.jiang <xinjun.jiang@daocloud.io>
Signed-off-by: xinjun.jiang <xinjun.jiang@daocloud.io>
Signed-off-by: xinjun.jiang <xinjun.jiang@daocloud.io>
c661b87 to
6244b60
Compare
Why are these changes needed?
get_job_infoandlist_job_infolose the job's error type and user metadata becauseRayJobInforeadsErrorTypeandMetadata, while the API server returnserrorTypeandmetadata.Read the API field names and cover populated and absent optional fields in the existing
test_submission. This branch is synchronized with current master.Related issue number
Discovered while checking the Python client against the job submission API's JSON contract.
Labels
doc-updates-requiredlabel.breaking-changelabel.AI assistance
Yes. AI assisted with implementation and testing.
Checks
The same
test_submissionregression fails against master (1 failed) and passes with this change (1 passed). The parameter suite reports:3ec5cbb8)The remaining
test_templatesfailure also occurs on unchanged master (3ec5cbb8): template serialization and decoding disagree on the extended-resources field. The before/after runs report the same failed assertion.Manual test instructions
Built the API server and operator from this branch and used a real Ray 2.55.0 head. Submitted a job that exits with code 17 and user metadata, waited for
FAILED, then read that same job through bothget_job_infoandlist_job_info.Both public methods returned:
error_typemetadata3ec5cbb8)NoneNoneJOB_ENTRYPOINT_COMMAND_ERROR{"case": "field-retention", "owner": "pr5333"}