Skip to content

Commit 390ff02

Browse files
pjanottichengchuanpeng
authored andcommitted
[chore][scoped-test] Don't do a literal expansion for changed files (open-telemetry#37298)
Doing in place expansion leads to hitting bash line size limits, this is a cheap improvement that makes less likely to hit cases like open-telemetry#37287. Tests on my fork https://github.com/pjanotti/opentelemetry-service-contrib/actions/runs/12836050460/job/35796880868
1 parent 7892734 commit 390ff02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile.Common

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ CHANGED_GOLANG_SOURCES?=$(shell git diff main --name-only | grep -E '.*\.go$$' |
268268
.PHONY: for-affected-components
269269
for-affected-components:
270270
@echo "Checking for affected components..."
271-
@if [ -z '$(CHANGED_GOLANG_SOURCES)' ]; then \
271+
@if [ -z '$${CHANGED_GOLANG_SOURCES}' ]; then \
272272
echo "No go source changes detected in shippable code."; \
273273
else \
274274
cd $(SRC_ROOT); \
275-
DEPENDENT_PKGS=$$(echo $(CHANGED_GOLANG_SOURCES) | xargs sed -n 's|^package .* // import "\(.*\)"$$|\1|p' | uniq); \
275+
DEPENDENT_PKGS=$$(echo $${CHANGED_GOLANG_SOURCES} | xargs sed -n 's|^package .* // import "\(.*\)"$$|\1|p' | uniq); \
276276
if [ -z '$${DEPENDENT_PKGS}' ]; then \
277277
echo "No other package depends on the one being changed."; \
278278
else \
@@ -289,11 +289,11 @@ CHANGED_GOLANG_TESTS?=$(shell git diff main --name-only | grep -E '.*_test\.go$$
289289
.PHONY: run-changed-tests
290290
run-changed-tests:
291291
@echo "Checking for affected tests..."
292-
@if [ -z '$(CHANGED_GOLANG_TESTS)' ]; then \
292+
@if [ -z '$${CHANGED_GOLANG_TESTS}' ]; then \
293293
echo "No go test changes detected."; \
294294
else \
295295
cd $(SRC_ROOT); \
296-
AFFECTED_TEST_DIRS=$$(echo $(CHANGED_GOLANG_TESTS) | tr ' ' '\n' | xargs dirname | uniq); \
296+
AFFECTED_TEST_DIRS=$$(echo $${CHANGED_GOLANG_TESTS} | tr ' ' '\n' | xargs dirname | uniq); \
297297
if [ -z '$${AFFECTED_TEST_DIRS}' ]; then \
298298
echo "Failed to find the affected test directories."; \
299299
else \

0 commit comments

Comments
 (0)