Skip to content

Commit

Permalink
[Bug] Adjust Kibana Path for File System Rules (#2397)
Browse files Browse the repository at this point in the history
* adjusted kibana rules path

* addressed flake errors for long string

* added missing / to directory path

(cherry picked from commit 953e8d9)
  • Loading branch information
terrancedejesus authored and github-actions[bot] committed Jan 3, 2023
1 parent 70b4fb0 commit 9b2dc53
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions detection_rules/devtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,11 @@ def kibana_diff(rule_id, repo, branch, threads):
return diff


def add_git_args(f):
def add_kibana_git_args(f):
@click.argument("local-repo", default=get_path("..", "kibana"))
@click.option("--kibana-directory", "-d", help="Directory to overwrite in Kibana",
default="x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules")
default="x-pack/plugins/security_solution/server/lib/detection_engine/"
"prebuilt_rules/content/prepackaged_rules")
@click.option("--base-branch", "-b", help="Base branch in Kibana", default="main")
@click.option("--branch-name", "-n", help="New branch for the rules commit")
@click.option("--ssh/--http", is_flag=True, help="Method to use for cloning")
Expand All @@ -370,7 +371,7 @@ def decorated(*args, **kwargs):


@dev_group.command("kibana-commit")
@add_git_args
@add_kibana_git_args
@click.option("--push", "-p", is_flag=True, help="Push the commit to the remote")
@click.pass_context
def kibana_commit(ctx, local_repo: str, github_repo: str, ssh: bool, kibana_directory: str, base_branch: str,
Expand Down Expand Up @@ -441,7 +442,7 @@ def kibana_commit(ctx, local_repo: str, github_repo: str, ssh: bool, kibana_dire
@click.option("--fork-owner", "-f", help="Owner of forked branch (ex: elastic)")
# Pending an official GitHub API
# @click.option("--automerge", is_flag=True, help="Enable auto-merge on the PR")
@add_git_args
@add_kibana_git_args
@click.pass_context
def kibana_pr(ctx: click.Context, label: Tuple[str, ...], assign: Tuple[str, ...], draft: bool, fork_owner: str,
token: str, **kwargs):
Expand Down

0 comments on commit 9b2dc53

Please sign in to comment.