Skip to content

feat: add blueapi_task_id to metadata - #1628

Merged
ZohebShaikh merged 1 commit into
DiamondLightSource:mainfrom
ZohebShaikh:add-metadata
Aug 17, 2026
Merged

feat: add blueapi_task_id to metadata#1628
ZohebShaikh merged 1 commit into
DiamondLightSource:mainfrom
ZohebShaikh:add-metadata

Conversation

@ZohebShaikh

Copy link
Copy Markdown
Contributor

closes #1554

@ZohebShaikh
ZohebShaikh requested a review from a team as a code owner August 17, 2026 07:17
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.96%. Comparing base (308f55f) to head (1bc670c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1628   +/-   ##
=======================================
  Coverage   95.96%   95.96%           
=======================================
  Files          45       45           
  Lines        3317     3318    +1     
=======================================
+ Hits         3183     3184    +1     
  Misses        134      134           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/blueapi/worker/task_worker.py Outdated
"""
task.prepare_params(self._ctx) # Will raise if parameters are invalid
task_id: str = str(uuid.uuid4())
if self._ctx.tiled_conf is not None:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There 2 questions that came to my mind

  1. I don't know if it is going to be useful to have blueapi_task_id regardless if you are using tiled.
  2. The code can be just
task.metadata["blueapi_task_id"] = task_id #type: ignore

I have done the dance only to not put the type ignore

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.

I think we should keep the metadata the same regardless of whether tiled is being used.

I wouldn't be against making the field dict. There's no real benefit to keeping it Mapping when it's only our code using it and we're always using dicts.

Was the prepare_params intentionally moved below the task id handling? Might be better to keep failing fast if the parameters are wrong.

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.

I'm in agreement that one extra bit of meta won't be an issue and it keeps all the data align in a way.

@ZohebShaikh
ZohebShaikh added this pull request to the merge queue Aug 17, 2026
Merged via the queue into DiamondLightSource:main with commit 5602d48 Aug 17, 2026
20 checks passed
@ZohebShaikh
ZohebShaikh deleted the add-metadata branch August 17, 2026 11:50
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.

Add task_id into run metadata

3 participants