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

Refactor Environment Variable Resolution Logic #473

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

zenangst
Copy link
Owner

This PR introduces changes that allow the system to identify when it should resolve environment variables for workflows.

The purpose of this is to ensure that only the necessary workflows trigger the resolution process, which could involve additional system queries and potentially impact performance.

The logic now checks commands within a workflow to determine if any utilize variables that would require resolving user environment variables before execution.

This selective approach optimizes the execution path by avoiding unnecessary resolution for workflows that do not depend on such variables.

…esolution

This commit introduces changes that allow the system to identify when it should resolve environment variables related to the document and selections within workflows.
The purpose of this is to ensure that only the necessary workflows trigger the resolution process, which could involve additional system queries and potentially impact performance.
The logic now checks commands within a workflow to determine if any utilize variables that would require resolving these document-related details before execution.
This selective approach optimizes the execution path by avoiding unnecessary resolution for workflows that do not depend on such variables.

Additionally, corresponding testing code has been updated to verify the correct behavior of this new implementation.

This targeted resolution strategy is a proactive measure to enhance the system's efficiency and responsiveness.
To align with clearer terminology and better reflect the action being performed within the codebase, the method previously named `shouldResolveDocumentAndSelections()` has been refactored to `resolveUserEnvironment()`. This change underscores the function's responsibility to resolve more than just document and selection variables, encompassing the broader set of user environment details. The modification affects key areas in the application, including controllers, models, and runners, ensuring consistency throughout the code.

This adjustment aims to make the code more intuitive and improve maintainability by using more descriptive names that accurately represent the underlying processes. It forms part of our continual effort to enhance code clarity and quality.
Copy link

@zenangst zenangst merged commit 433d93b into main Dec 12, 2023
2 checks passed
@zenangst zenangst deleted the improve/performance-when-running-commands branch December 12, 2023 20:51
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