Skip to content

Add tools property and entrypoint for workflows#6884

Merged
agoscinski merged 1 commit into
aiidateam:mainfrom
bastonero:feat/workchain-tools
Apr 20, 2026
Merged

Add tools property and entrypoint for workflows#6884
agoscinski merged 1 commit into
aiidateam:mainfrom
bastonero:feat/workchain-tools

Conversation

@bastonero
Copy link
Copy Markdown
Contributor

Fixes #6865

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.90%. Comparing base (36aaf8c) to head (0e10c7c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6884      +/-   ##
==========================================
+ Coverage   79.86%   79.90%   +0.04%     
==========================================
  Files         566      568       +2     
  Lines       43958    43984      +26     
==========================================
+ Hits        35103    35139      +36     
+ Misses       8855     8845      -10     

☔ View full report in Codecov by Sentry.
📢 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.

@agoscinski agoscinski force-pushed the feat/workchain-tools branch 3 times, most recently from 4980623 to cb9d61e Compare June 3, 2025 21:25
@agoscinski agoscinski force-pushed the feat/workchain-tools branch from 259c2dd to cb9d61e Compare June 4, 2025 19:16
@agoscinski
Copy link
Copy Markdown
Collaborator

@bastonero sorry I did not give you heads up. I wanted to merge it and was about to finalize it but then there was an error in the REST API which I was not able to fix in the time

@bastonero
Copy link
Copy Markdown
Contributor Author

@agoscinski no worries, and thanks a lot! is there still this issue? do we need to add/do something else/more?

@agoscinski
Copy link
Copy Markdown
Collaborator

@eimrek can you have a look? It is a test error in the REST API

@mbercx
Copy link
Copy Markdown
Member

mbercx commented Nov 27, 2025

I'm very interested in having this feature. Adding tools to my work chains would be sexy AF. Any chance we can get this merged soon? @eimrek can you look into the blocking issue during the coding week?

@eimrek
Copy link
Copy Markdown
Member

eimrek commented Nov 27, 2025

I'm very interested in having this feature. Adding tools to my work chains would be sexy AF. Any chance we can get this merged soon? @eimrek can you look into the blocking issue during the coding week?

thanks for the note, sure, I can try to get this done during the coding week.

@eimrek
Copy link
Copy Markdown
Member

eimrek commented Dec 4, 2025

Hi @bastonero @mbercx @agoscinski. looks like just merging main here fixed the restapi issue. Regarding the actual changes, they look fine, but I didn't test them.

@bastonero
Copy link
Copy Markdown
Contributor Author

Hey @agoscinski @eimrek @mbercx, do you think we could merge this one anytime soon? It would be really useful to have.

@agoscinski agoscinski force-pushed the feat/workchain-tools branch from f1857e0 to 8fd6c84 Compare April 19, 2026 18:48
agoscinski added a commit to bastonero/aiida-core that referenced this pull request Apr 19, 2026
Add a `tools` property to `WorkChainNode` and load workflow helpers
from `aiida.tools.workflows` entry points.

Register the new workflow tools entry point group, add the base
`WorkflowTools` implementation, and cover the workflow and calculation
fallback paths with tests.

Co-authored-by: Alexander Goscinski <alex.go@posteo.de>
Co-authored-by: Kristjan Eimre <eimrek@users.noreply.github.com>
agoscinski added a commit to bastonero/aiida-core that referenced this pull request Apr 19, 2026
Replace ad-hoc mock setup with pytest fixtures for workflow and
calculation tools tests.

Cover the workflow tools entry point integration and the workflow and
calculation fallback paths with clearer fixture-based tests.

Co-authored-by: Alexander Goscinski <alex.go@posteo.de>
Co-authored-by: Kristjan Eimre <eimrek@users.noreply.github.com>
@agoscinski agoscinski force-pushed the feat/workchain-tools branch from 8fd6c84 to 3223955 Compare April 19, 2026 19:00
Copy link
Copy Markdown
Collaborator

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

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

Sorry I won't have time to look at this anytime soon so leaving review to others.

@mbercx
Copy link
Copy Markdown
Member

mbercx commented Apr 20, 2026

I'm keen to have this feature, so happy to review later this week (I think Thu I will have time). Will also field-test it on a workflow I wanted it for. Just have to remember which one that was. 😅

In any case: @bastonero I don't think I see any changes to the documentation. Should we add this somewhere, or update the docs that mention this for CalcJobs?

agoscinski added a commit to bastonero/aiida-core that referenced this pull request Apr 20, 2026
Add a `tools` property to `WorkChainNode` and load workflow helpers
from `aiida.tools.workflows` entry points.

Register the new workflow tools entry point group, add the base
`WorkflowTools` implementation, and cover the workflow and calculation
fallback paths with tests.

Co-authored-by: Alexander Goscinski <alex.go@posteo.de>
Co-authored-by: Kristjan Eimre <eimrek@users.noreply.github.com>
@agoscinski agoscinski force-pushed the feat/workchain-tools branch from 3223955 to 8c70f94 Compare April 20, 2026 05:58
Add a `tools` property to `WorkChainNode` and load workflow helpers
from `aiida.tools.workflows` entry points.

Register the new workflow tools entry point group, add the base
`WorkflowTools` implementation, and cover the workflow and calculation
fallback paths with tests.

Co-authored-by: Alexander Goscinski <alex.go@posteo.de>
Co-authored-by: Kristjan Eimre <eimrek@users.noreply.github.com>
@agoscinski agoscinski force-pushed the feat/workchain-tools branch from 8c70f94 to 0e10c7c Compare April 20, 2026 06:40
@agoscinski agoscinski enabled auto-merge (rebase) April 20, 2026 06:47
@agoscinski
Copy link
Copy Markdown
Collaborator

agoscinski commented Apr 20, 2026

The flaky test failed tests/cmdline/commands/test_group.py that does wrong pattern matching because it depends on the time it takes.

tests/cmdline/commands/test_group.py:368: in test_show_limit
    assert not (str(nodes[0].pk) in result.output and str(nodes[1].pk) in result.output)
E   AssertionError: assert not ('1' in '-----------------  ----------------\nGroup label        test_group_limit\nGroup type_string  core\nGroup description ...n-----------------  ----------------\n# Nodes:\n  PK  Type    Created\n----  ------  ---------\n   1  Data    2s ago\n' and '2' in '-----------------  ----------------\nGroup label        test_group_limit\nGroup type_string  core\nGroup description ...n-----------------  ----------------\n# Nodes:\n  PK  Type    Created\n----  ------  ---------\n   1  Data    2s ago\n')
E    +  where '1' = str(1)
E    +    where 1 = <Data: uuid: 04be5ac9-6213-452f-869f-9a035df08693 (pk: 1)>.pk
E    +  and   '-----------------  ----------------\nGroup label        test_group_limit\nGroup type_string  core\nGroup description ...n-----------------  ----------------\n# Nodes:\n  PK  Type    Created\n----  ------  ---------\n   1  Data    2s ago\n' = CliResult(stderr_bytes=b'', stdout_bytes=b'-----------------  ----------------\nGroup label        test_group_limit\nG...   Created\n----  ------  ---------\n   1  Data    2s ago\n', exc_info=(None, None, None), exception=None, exit_code=0).output
E    +  and   '2' = str(2)
E    +    where 2 = <Data: uuid: 787eee60-4885-45ad-a386-b4330f085c19 (pk: 2)>.pk
E    +  and   '-----------------  ----------------\nGroup label        test_group_limit\nGroup type_string  core\nGroup description ...n-----------------  ----------------\n# Nodes:\n  PK  Type    Created\n----  ------  ---------\n   1  Data    2s ago\n' = CliResult(stderr_bytes=b'', stdout_bytes=b'-----------------  ----------------\nGroup label        test_group_limit\nG...   Created\n----  ------  ---------\n   1  Data    2s ago\n', exc_info=(None, None, None), exception=None, exit_code=0).output

Currently it is fixed it PR #7325 in commit fe23aed but I need to make another PR for it. I will ignore therefore ignore the error of CI ci-code / test minimum reqs (3.10, sqlite)


The other problem is tests/engine/test_launch.py::test_await_processesin need to check it in tests (3.11) CI. The error is however flaky and most likely not related to the changes in this PR. I noted it down the error and will try fix it.

@agoscinski agoscinski disabled auto-merge April 20, 2026 08:29
@agoscinski agoscinski merged commit 57378d6 into aiidateam:main Apr 20, 2026
44 of 46 checks passed
@bastonero
Copy link
Copy Markdown
Contributor Author

Thanks a lot everyone!

@mbercx
Copy link
Copy Markdown
Member

mbercx commented Apr 20, 2026

So... no documentation? 😅 @agoscinski @bastonero

@bastonero
Copy link
Copy Markdown
Contributor Author

yeah we should add it. shall we open an issue just as a reminder? i can probably work on this a bit tomorrow.

@mbercx
Copy link
Copy Markdown
Member

mbercx commented Apr 20, 2026

Good idea, done!

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 Tools plugin to WorkChains

6 participants