#940 Added shared validation for packaged skills - #954
Open
jana-selva wants to merge 8 commits into
Open
jana-selva wants to merge 8 commits into
jana-selva wants to merge 8 commits into
Conversation
jana-selva
requested a deployment
to
manual-approval
September 11, 2026 07:02 — with
GitHub Actions
Waiting
jana-selva
requested a deployment
to
manual-approval
September 11, 2026 07:02 — with
GitHub Actions
Waiting
jana-selva
requested a deployment
to
manual-approval
September 15, 2026 07:54 — with
GitHub Actions
Waiting
jana-selva
requested a deployment
to
manual-approval
September 15, 2026 07:54 — with
GitHub Actions
Waiting
jana-selva
requested a deployment
to
manual-approval
September 15, 2026 07:58 — with
GitHub Actions
Waiting
jana-selva
requested a deployment
to
manual-approval
September 15, 2026 07:58 — with
GitHub Actions
Waiting
ckunki
requested changes
Sep 18, 2026
|
ckunki
approved these changes
Sep 18, 2026
ArBridgeman
reviewed
Sep 21, 2026
| @nox.session(name="skills:check", python=False) | ||
| def check_skills(session: Session) -> None: | ||
| """Validate the common structure and content rules for packaged skills.""" | ||
| failures = { |
Collaborator
There was a problem hiding this comment.
Could we reduce 1 for-loop with something like:
failures = {}
for skill_name in get_packaged_skill_names():
errors = validate_skill(skill_name)
if errors:
failures[skill_name] = errors
if failures:
details = "\n".join(
_format_skill_errors(skill_name, errors)
for skill_name, errors in failures.items()
)
ArBridgeman
reviewed
Sep 21, 2026
| @nox.session(name="skills:check", python=False) | ||
| def check_skills(session: Session) -> None: | ||
| """Validate the common structure and content rules for packaged skills.""" | ||
| failures = { |
Collaborator
There was a problem hiding this comment.
Would it be worthwhile in this entry point to check if the directory we'll check exists or not?
Currently, if someone runs this, the exception gets raised later. We tend to prefer failing earlier with a clear/controlled exception that indicates what to do.
❯ poetry run -- nox -s skills:check
nox > Running session skills:check
nox > Session skills:check raised exception FileNotFoundError(2, 'No such file or directory')
Traceback (most recent call last):
File "/home/arsc/.cache/pypoetry/virtualenvs/exasol-toolbox-HhsxY0p2-py3.10/lib/python3.10/site-packages/nox/sessions.py", line 1187, in execute
self.func(session)
File "/home/arsc/.cache/pypoetry/virtualenvs/exasol-toolbox-HhsxY0p2-py3.10/lib/python3.10/site-packages/nox/_decorators.py", line 100, in __call__
return self.func(*args, **kwargs)
File "/home/arsc/Code/python-toolbox/exasol/toolbox/nox/_skills.py", line 16, in check_skills
for skill_name in get_packaged_skill_names()
File "/home/arsc/Code/python-toolbox/exasol/toolbox/util/skills.py", line 47, in get_packaged_skill_names
return tuple(sorted(path.name for path in skills_path.iterdir() if path.is_dir()))
File "/home/arsc/Code/python-toolbox/exasol/toolbox/util/skills.py", line 47, in <genexpr>
return tuple(sorted(path.name for path in skills_path.iterdir() if path.is_dir()))
File "/home/arsc/.local/share/pypoetry/python/cpython@3.10.18/lib/python3.10/pathlib.py", line 1017, in iterdir
for name in self._accessor.listdir(self):
FileNotFoundError: [Errno 2] No such file or directory: "MultiplexedPath('/home/arsc/Code/python-toolbox/exasol/toolbox/skills')"
nox > Session skills:check failed.
ArBridgeman
reviewed
Sep 21, 2026
| ) | ||
|
|
||
| with pytest.raises(_SessionQuit, match="Packaged skill validation failed"): | ||
| _skills.check_skills(nox_session) |
Collaborator
There was a problem hiding this comment.
Would you want to inspect the caught exception to see that the different errors were present in it?
I'm asking as the test name sounds like that is the intent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Checklist
Fixes #940
Note: If any of the items in the checklist are not relevant to your PR, just check the box.
For any Pull Request
Is the following correct:
When Changes Were Made
Did you:
When Preparing a Release
Have you: