Skip to content

use iri models in submit_job#4

Merged
amithmslac merged 1 commit into
mainfrom
job-submit-model
May 5, 2026
Merged

use iri models in submit_job#4
amithmslac merged 1 commit into
mainfrom
job-submit-model

Conversation

@swelborn
Copy link
Copy Markdown
Collaborator

@swelborn swelborn commented May 5, 2026

we avoid getattr everywhere. jobspec is non-optional, so we don’t have to check if it is there or not.

this is easier to read, and uses the same signature as the template in https://github.com/slaclab/iri-facility-api-python/blob/main/app/demo_adapter.py

going forward, would be best to aim to match this in other parts of the code

avoids getattr everywhere. jobspec is non-optional for adapter.submit_job(), so we don’t have to check if it is there or not.
@amithmslac amithmslac merged commit cfc0c87 into main May 5, 2026
1 check passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f96387545e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +298 to +302
return compute_models.Job(
id=str(resp.job_id),
# TODO: check if 200 always mean it is queued
status=compute_models.JobStatus(state=JobState.QUEUED),
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep submit_job return shape backward-compatible

Returning a compute_models.Job object here changes submit_job from a mapping-like result to a model instance, which breaks existing direct callers that still index into the result (for example app/s3df/slurm/test_slurmrestd.py uses result["id"] and result["status"]["state"]). In environments that invoke the adapter directly (outside FastAPI response serialization), this will raise at runtime and stop job-submission workflows.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@amithmslac this will break some tests, i guess

@swelborn swelborn deleted the job-submit-model branch May 5, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants