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

Aamohd/file based config #662

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Aamohd/file based config #662

wants to merge 5 commits into from

Conversation

aamohd
Copy link
Contributor

@aamohd aamohd commented Nov 25, 2024

No description provided.

@aamohd aamohd force-pushed the aamohd/file-based-config branch 3 times, most recently from 3c7b075 to 866ea2b Compare December 9, 2024 18:49
@j-lanson j-lanson added type: enhancement New feature or request type: ui UI-related changes that should get heightened review. product: hc Relates to the core "hc" binary labels Dec 9, 2024
long = "exec",
global = true,
help_heading = "Path Flags",
long_help = "Path to the exec file."
Copy link
Collaborator

Choose a reason for hiding this comment

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

--> "Path to the execution config file"

@@ -296,6 +315,9 @@ impl CliConfig {
policy: std::env::current_dir()
.ok()
.map(|dir| pathbuf![&dir, "Hipcheck.kdl"]),
exec: env::current_dir()
.ok()
.map(|dir| pathbuf![&dir, "config/Config.kdl"]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove config/

Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename to exec.rs

))
};

let plugin_data = exec_config.unwrap().plugin_data;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of unwrapping, change the function to return an ExitCode and use Shell::print_error() like cmd_setup() and cmd_check()

@@ -160,6 +160,9 @@ pub struct PluginContext {

/// The child process in which the plugin is running.
pub proc: Child,

/// The size of the gRPC buffer
pub grpc_buffer: usize,
Copy link
Collaborator

Choose a reason for hiding this comment

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

rename to grpc_query_buffer_size

@j-lanson
Copy link
Collaborator

j-lanson commented Dec 9, 2024

As I mentioned in one of the requested changes, we shouldn't take./config/Exec.kdl as the backup location for the exec file, it should just be Exec.kdl. But in git version control we are storing the file at ./config/Exec.kdl, which means people would need to pass --exec every time they want to run Hipcheck.

I think the solution is that everyone developing on Hipcheck copies ./config/Exec.kdl to ./Exec.kdl at the project root so it gets picked up as the default location, and this will be everyone's personal Exec.kdl file that doesn't get tracked in git. We can also add a rule to the .gitignore to ensure no root-level Exec.kdl file gets commited.

@alilleybrinker thoughts? or should the "config" folder be un-deprecated as a concept and use the resolution of the config dir to determine the expected location of the Exec.kdl file?

@j-lanson
Copy link
Collaborator

j-lanson commented Dec 9, 2024

@aamohd, you'll also have to rebase off of main and address the cli.rs conflict

@aamohd aamohd force-pushed the aamohd/file-based-config branch 3 times, most recently from 7d0179a to 41690cf Compare December 17, 2024 19:47
Signed-off-by: Aisha M <[email protected]>

feat: allow file-based executor

Signed-off-by: Aisha M <[email protected]>

ExecConfig and PluginConfig added

fix: fix broken test

Signed-off-by: Andrew Lilley Brinker <[email protected]>

Config parsing enabled

Code cleanup

Exec Config added to CLI

Signed-off-by: Aisha M <[email protected]>

feat: allow file-based executor config

Signed-off-by: Aisha M <[email protected]>

Code cleanup

Signed-off-by: Aisha M <[email protected]>

feat: allow file-based executor

Signed-off-by: Aisha M <[email protected]>

feat: allow file-based executor

Signed-off-by: Aisha M <[email protected]>
@aamohd aamohd force-pushed the aamohd/file-based-config branch from 41690cf to 7b3f032 Compare December 17, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: hc Relates to the core "hc" binary type: enhancement New feature or request type: ui UI-related changes that should get heightened review.
Projects
Status: In Progress
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants