Skip to content

Commit f289b99

Browse files
authored
Merge pull request containerd#4173 from apostasie/ci-2025-04-bust
[PRIORITY] [CI]: fix bustage
2 parents 32e1f55 + bf7312d commit f289b99

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

.github/workflows/tigron.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,21 @@ jobs:
3535
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3636
with:
3737
fetch-depth: 100
38-
- name: "Set GO env"
38+
- if: ${{ matrix.canary }}
39+
name: "Init (canary): retrieve GO_VERSION"
3940
run: |
40-
if [ "${{ matrix.canary }}" != "" ]; then
41-
. ./hack/provisioning/version/fetch.sh
42-
printf "GO_VERSION=%s\n" "$(go::canary::for::go-setup)" >> "$GITHUB_ENV"
43-
fi
44-
- name: "Install go"
41+
latest_go="$(. ./hack/provisioning/version/fetch.sh; go::canary::for::go-setup)"
42+
printf "GO_VERSION=%s\n" "$latest_go" >> "$GITHUB_ENV"
43+
[ "$latest_go" != "" ] || \
44+
echo "::warning title=No canary go::There is currently no canary go version to test. Steps will not run."
45+
- if: ${{ env.GO_VERSION != '' }}
46+
name: "Install go"
4547
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
4648
with:
4749
go-version: ${{ env.GO_VERSION }}
4850
check-latest: true
49-
- name: "Install tools"
51+
- if: ${{ env.GO_VERSION != '' }}
52+
name: "Install tools"
5053
run: |
5154
cd mod/tigron
5255
echo "::group:: make install-dev-tools"
@@ -55,7 +58,8 @@ jobs:
5558
brew install yamllint shellcheck
5659
fi
5760
echo "::endgroup::"
58-
- name: "lint"
61+
- if: ${{ env.GO_VERSION != '' }}
62+
name: "lint"
5963
env:
6064
NO_COLOR: true
6165
run: |
@@ -69,19 +73,22 @@ jobs:
6973
export LINT_COMMIT_RANGE="$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH})"
7074
make lint
7175
echo "::endgroup::"
72-
- name: "test-unit"
76+
- if: ${{ env.GO_VERSION != '' }}
77+
name: "test-unit"
7378
run: |
7479
echo "::group:: unit test"
7580
cd mod/tigron
7681
make test-unit
7782
echo "::endgroup::"
78-
- name: "test-unit-race"
83+
- if: ${{ env.GO_VERSION != '' }}
84+
name: "test-unit-race"
7985
run: |
8086
echo "::group:: race test"
8187
cd mod/tigron
8288
make test-unit-race
8389
echo "::endgroup::"
84-
- name: "test-unit-bench"
90+
- if: ${{ env.GO_VERSION != '' }}
91+
name: "test-unit-bench"
8592
run: |
8693
echo "::group:: bench"
8794
cd mod/tigron

mod/tigron/internal/formatter/formatter.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,21 @@ func chunk(s string, maxLength, maxLines int) []string {
108108
}
109109

110110
// If really long, preserve the starting first quarter, the trailing three quarters, and inform.
111-
if len(chunks) > maxLines {
112-
abbreviator := fmt.Sprintf("... %d lines are being ignored...", len(chunks)-maxLines)
111+
actualLength := len(chunks)
112+
if actualLength > maxLines {
113+
abbreviator := fmt.Sprintf("... %d lines are being ignored...", actualLength-maxLines)
113114
chunks = append(
114115
append(chunks[0:maxLines/4], abbreviator+strings.Repeat(spacer, maxLength-len(abbreviator))),
115-
chunks[len(chunks)-maxLines*3/4:]...,
116+
chunks[actualLength-maxLines*3/4:]...,
116117
)
117118
chunks = append(
118119
[]string{
119-
fmt.Sprintf("Actual content is %d lines long and has been abbreviated to %d\n", len(chunks), maxLines),
120+
fmt.Sprintf("Actual content is %d lines long and has been abbreviated to %d\n", actualLength, maxLines),
120121
strings.Repeat(spacer, maxLength),
121122
},
122123
chunks...,
123124
)
124-
} else if len(chunks) == 0 {
125+
} else if actualLength == 0 {
125126
chunks = []string{strings.Repeat(spacer, maxLength)}
126127
}
127128

0 commit comments

Comments
 (0)