Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazily load the default workspace as needed #1188

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jrray
Copy link
Collaborator

@jrray jrray commented Mar 8, 2025

Not all spk [env] command lines contain a request that requires the use of a workspace, but previously the workspace was loaded unconditionally, meaning that any/all *.spk.yaml files in the working directory would be read in and possibly warned about if they do not contain the "api" entry.

Avoid this unnecessary file IO overhead when workspaces are not needed.

Also reuse the already loaded workspace instead of creating another new one per file in parse_idents.

Finally, if loading a workspace and warning about possibly more than one file if missing the "api" entry, include the filename of the offending file in the warning message.

@jrray jrray self-assigned this Mar 8, 2025
@jrray jrray requested a review from rydrman March 8, 2025 03:36
Not all spk [env] command lines contain a request that requires the use
of a workspace, but previously the workspace was loaded unconditionally,
meaning that any/all *.spk.yaml files in the working directory would be
read in and possibly warned about if they do not contain the "api"
entry.

Avoid this unnecessary file IO overhead when workspaces are not needed.

Also reuse the already loaded workspace instead of creating another new
one per file in `parse_idents`.

Finally, if loading a workspace and warning about possibly more than one
file if missing the "api" entry, include the filename of the offending
file in the warning message.

Signed-off-by: J Robert Ray <[email protected]>
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.

1 participant