Skip to content

feat: add current_step and can_start to RunSerializer - #2359

Open
Rucha0901 wants to merge 1 commit into
aboutcode-org:mainfrom
Rucha0901:add-run-current-step-can-start
Open

Rucha0901 wants to merge 1 commit into
aboutcode-org:mainfrom
Rucha0901:add-run-current-step-can-start

Conversation

@Rucha0901

Copy link
Copy Markdown
Contributor

Issues

Changes

  • Added current_step and can_start to RunSerializer.Meta.fields in scanpipe/api/serializers.py.
  • Marked current_step and can_start as read_only_fields.
  • Updated test_scanpipe_api_run_detail in scanpipe/tests/test_api.py to assert that current_step and can_start are returned for both unstarted and started runs.

Checklist

  • I have read the contributing guidelines
  • I have linked an existing issue above
  • I have added unit tests covering the new code
  • I have reviewed and understood every line of this PR

@Midoriya-w

Copy link
Copy Markdown

Looks good! Just one thing I was thinking about could we also add a test for the case where a run has a previous incomplete run?

Since can_start also depends on whether earlier runs have completed, it might be worth checking that the API returns false for a new run in that situation. And once the previous run is completed, it should return true.

That would cover the sequential execution scenario as well.

@Rucha0901 Rucha0901 changed the title Add current_step and can_start to RunSerializer feat: add current_step and can_start to RunSerializer Nov 24, 2026


Signed-off-by: Rucha0901 <imt_2025071@iiitm.ac.in>
@Rucha0901
Rucha0901 force-pushed the add-run-current-step-can-start branch from f12aa1b to 35f5d9c Compare November 24, 2026 04:52
@Rucha0901

Copy link
Copy Markdown
Contributor Author

Looks good! Just one thing I was thinking about could we also add a test for the case where a run has a previous incomplete run?

Since can_start also depends on whether earlier runs have completed, it might be worth checking that the API returns false for a new run in that situation. And once the previous run is completed, it should return true.

That would cover the sequential execution scenario as well.

Added a unit test covering the sequential execution scenario where a new run's can_start returns false while an earlier run is incomplete, and transitions to true once completed. Pushed the update to the branch.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RunSerializer is missing current_step and can_start fields in the REST API

2 participants