From 9283ea3f38a56638c9cd3c470e42ba3c39b779d7 Mon Sep 17 00:00:00 2001 From: xansec Date: Wed, 11 Mar 2026 09:48:14 -0400 Subject: [PATCH 1/3] include owner in show command --- MODULE.bazel | 2 +- MODULE.bazel.lock | 12 ++++++------ mayhem/mayhem.bzl | 13 +++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index bbb81a7..83bcef5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "rules_mayhem", - version = "0.8.8", + version = "0.8.9", ) bazel_dep(name = "bazel_skylib", version = "1.9.0") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index e1f282c..3e8ded4 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -34,8 +34,9 @@ "https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9", "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", "https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6", - "https://bcr.bazel.build/modules/bazel_features/1.33.0/source.json": "13617db3930328c2cd2807a0f13d52ca870ac05f96db9668655113265147b2a6", "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/MODULE.bazel": "275a59b5406ff18c01739860aa70ad7ccb3cfb474579411decca11c93b951080", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/source.json": "fcd4396b2df85f64f2b3bb436ad870793ecf39180f1d796f913cc9276d355309", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", @@ -52,8 +53,8 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7", "https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0", - "https://bcr.bazel.build/modules/buildozer/8.2.1/MODULE.bazel": "61e9433c574c2bd9519cad7fa66b9c1d2b8e8d5f3ae5d6528a2c2d26e68d874d", - "https://bcr.bazel.build/modules/buildozer/8.2.1/source.json": "7c33f6a26ee0216f85544b4bca5e9044579e0219b6898dd653f5fb449cf2e484", + "https://bcr.bazel.build/modules/buildozer/8.5.1/MODULE.bazel": "a35d9561b3fc5b18797c330793e99e3b834a473d5fbd3d7d7634aafc9bdb6f8f", + "https://bcr.bazel.build/modules/buildozer/8.5.1/source.json": "e3386e6ff4529f2442800dee47ad28d3e6487f36a1f75ae39ae56c70f0cd2fbd", "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", @@ -113,7 +114,6 @@ "https://bcr.bazel.build/modules/rules_cc/0.1.5/MODULE.bazel": "88dfc9361e8b5ae1008ac38f7cdfd45ad738e4fa676a3ad67d19204f045a1fd8", "https://bcr.bazel.build/modules/rules_cc/0.2.0/MODULE.bazel": "b5c17f90458caae90d2ccd114c81970062946f49f355610ed89bebf954f5783c", "https://bcr.bazel.build/modules/rules_cc/0.2.13/MODULE.bazel": "eecdd666eda6be16a8d9dc15e44b5c75133405e820f620a234acc4b1fdc5aa37", - "https://bcr.bazel.build/modules/rules_cc/0.2.14/MODULE.bazel": "353c99ed148887ee89c54a17d4100ae7e7e436593d104b668476019023b58df8", "https://bcr.bazel.build/modules/rules_cc/0.2.17/MODULE.bazel": "1849602c86cb60da8613d2de887f9566a6d354a6df6d7009f9d04a14402f9a84", "https://bcr.bazel.build/modules/rules_cc/0.2.17/source.json": "3832f45d145354049137c0090df04629d9c2b5493dc5c2bf46f1834040133a07", "https://bcr.bazel.build/modules/rules_cc/0.2.8/MODULE.bazel": "f1df20f0bf22c28192a794f29b501ee2018fa37a3862a1a2132ae2940a23a642", @@ -192,11 +192,11 @@ "//mayhem:extensions.bzl%rules_mayhem_extension": { "general": { "bzlTransitiveDigest": "SUFcWZq0Nc0sjSX728mHdDz01rb3+thUWiQBxjMbYsA=", - "usagesDigest": "Oe8goIySCz0esqxbJE2IWDiez9LcX7Lz3532P77zhgE=", + "usagesDigest": "2v2QfRin2119zxl1DHW5vu4idtCElyD2Z/oHJP0o8jU=", "recordedInputs": [ "REPO_MAPPING:,bazel_tools bazel_tools", "REPO_MAPPING:,rules_mayhem ", - "ENV:MAYHEM_URL \\0" + "ENV:MAYHEM_URL https://app.mayhem.security" ], "generatedRepoSpecs": { "mayhem_cli_linux": { diff --git a/mayhem/mayhem.bzl b/mayhem/mayhem.bzl index 9b67306..61e917d 100644 --- a/mayhem/mayhem.bzl +++ b/mayhem/mayhem.bzl @@ -281,6 +281,7 @@ def resolve_runfile_mayhem_cli_path(mayhem_cli_short_path): mayhem_cli = resolve_runfile_mayhem_cli_path("{mayhem_cli}") run_args = {run_args} wait_args = {wait_args} +show_args = ["show" if arg == "wait" else arg for arg in wait_args] if "{package_basename}": if runfiles_enabled: @@ -288,10 +289,10 @@ if "{package_basename}": else: package_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "{package_basename}") - package_index = run_args.index("run") - run_args.insert(package_index + 1, package_dir) - run_args.insert(package_index + 2, "-f") - run_args.insert(package_index + 3, os.path.join(package_dir, "Mayhemfile")) + run_index = run_args.index("run") + run_args.insert(run_index + 1, package_dir) + run_args.insert(run_index + 2, "-f") + run_args.insert(run_index + 3, os.path.join(package_dir, "Mayhemfile")) # Mayhem run run_result = subprocess.run([mayhem_cli] + run_args, capture_output=True, text=True) @@ -314,7 +315,7 @@ if wait_args: sys.exit(wait_result.returncode) # Mayhem show - show_result = subprocess.run([mayhem_cli, "show", run_id], capture_output=True, text=True) + show_result = subprocess.run([mayhem_cli] + show_args + [run_id], capture_output=True, text=True) print(show_result.stdout) if show_result.returncode != 0: print(show_result.stderr, file=sys.stderr) @@ -515,4 +516,4 @@ mayhem_download = rule( allow_single_file = True, ), }, -) \ No newline at end of file +) From 6ba45cb083e1cff45cdca4fea07b0debcf27a5da Mon Sep 17 00:00:00 2001 From: xansec Date: Wed, 11 Mar 2026 09:49:24 -0400 Subject: [PATCH 2/3] revert refactor --- mayhem/mayhem.bzl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mayhem/mayhem.bzl b/mayhem/mayhem.bzl index 61e917d..4cba039 100644 --- a/mayhem/mayhem.bzl +++ b/mayhem/mayhem.bzl @@ -289,10 +289,10 @@ if "{package_basename}": else: package_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "{package_basename}") - run_index = run_args.index("run") - run_args.insert(run_index + 1, package_dir) - run_args.insert(run_index + 2, "-f") - run_args.insert(run_index + 3, os.path.join(package_dir, "Mayhemfile")) + package_index = run_args.index("run") + run_args.insert(package_index + 1, package_dir) + run_args.insert(package_index + 2, "-f") + run_args.insert(package_index + 3, os.path.join(package_dir, "Mayhemfile")) # Mayhem run run_result = subprocess.run([mayhem_cli] + run_args, capture_output=True, text=True) From f56df5af135ca7877d8b17d006f11fbfd3617d16 Mon Sep 17 00:00:00 2001 From: xansec Date: Wed, 11 Mar 2026 20:10:10 -0400 Subject: [PATCH 3/3] no reports for show --- mayhem/mayhem.bzl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mayhem/mayhem.bzl b/mayhem/mayhem.bzl index 4cba039..9cc90ee 100644 --- a/mayhem/mayhem.bzl +++ b/mayhem/mayhem.bzl @@ -231,13 +231,17 @@ def _mayhem_run_impl(ctx): # For mayhem wait wait_args = [] + show_args = [] if ctx.attr.wait: if not ctx.attr.duration: fail("The 'wait' attribute requires the 'duration' attribute to be set (otherwise, we will wait forever)") wait_args.append("wait") + show_args.append("show") if ctx.attr.owner: wait_args.append("--owner") wait_args.append(ctx.attr.owner) + show_args.append("--owner") + show_args.append(ctx.attr.owner) if ctx.attr.junit: wait_args.append("--junit") wait_args.append(ctx.attr.junit) @@ -281,7 +285,7 @@ def resolve_runfile_mayhem_cli_path(mayhem_cli_short_path): mayhem_cli = resolve_runfile_mayhem_cli_path("{mayhem_cli}") run_args = {run_args} wait_args = {wait_args} -show_args = ["show" if arg == "wait" else arg for arg in wait_args] +show_args = {show_args} if "{package_basename}": if runfiles_enabled: @@ -327,6 +331,7 @@ if wait_args: package_basename=package_basename, run_args=run_args, wait_args=wait_args, + show_args=show_args, ) if is_windows: