From 33169289acd36fac20c2fb86f9efa2124472a375 Mon Sep 17 00:00:00 2001
From: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
Date: Mon, 28 Nov 2022 13:25:28 -0800
Subject: [PATCH] fix: apply suggestions from code review

Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
---
 python/config_settings/transition.bzl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/python/config_settings/transition.bzl b/python/config_settings/transition.bzl
index a884bd235f..bb7ea72037 100644
--- a/python/config_settings/transition.bzl
+++ b/python/config_settings/transition.bzl
@@ -43,6 +43,7 @@ def _transition_py_impl(ctx):
     env = {}
     for k, v in ctx.attr.env.items():
         env[k] = ctx.expand_location(v)
+
     providers = [
         DefaultInfo(
             executable = executable,
@@ -51,7 +52,11 @@ def _transition_py_impl(ctx):
         ),
         target[PyInfo],
         target[PyRuntimeInfo],
-        target[InstrumentedFilesInfo],
+        # Ensure that the binary we're wrapping is included in code coverage.
+        coverage_common.instrumented_files_info(
+            ctx,
+            dependency_attributes = ["target"],
+        ),
         target[OutputGroupInfo],
         # TODO(f0rmiga): testing.TestEnvironment is deprecated in favour of RunEnvironmentInfo but
         # RunEnvironmentInfo is not exposed in Bazel < 5.3.