Skip to content

Commit d5197e9

Browse files
committed
Merge branch 'main' into vscodeext
2 parents ab45e44 + 88d3496 commit d5197e9

File tree

257 files changed

+7731
-3317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+7731
-3317
lines changed

.github/semantic.yaml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/coder.yaml

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ jobs:
274274
export PATH=${PATH}:$(go env GOPATH)/bin
275275
make --output-sync -j -B fmt
276276
277+
- name: Check for unstaged files
278+
run: ./scripts/check_unstaged.sh
279+
277280
test-go:
278281
name: "test/go"
279282
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-8-cores'|| matrix.os }}
@@ -335,8 +338,37 @@ jobs:
335338
else
336339
echo ::set-output name=cover::false
337340
fi
338-
set -x
339-
gotestsum --junitfile="gotests.xml" --packages="./..." --debug -- -parallel=8 -timeout=3m -short -failfast $COVERAGE_FLAGS
341+
set +e
342+
gotestsum --junitfile="gotests.xml" --jsonfile="gotestsum.json" --packages="./..." --debug -- -parallel=8 -timeout=5m -short -failfast $COVERAGE_FLAGS
343+
ret=$?
344+
if ((ret)); then
345+
# Eternalize test timeout logs because "re-run failed" erases
346+
# artifacts and gotestsum doesn't always capture it:
347+
# https://github.com/gotestyourself/gotestsum/issues/292
348+
# Multiple test packages could've failed, each one may or may
349+
# not run into the edge case. PS. Don't summon ShellCheck here.
350+
for testWithStack in $(grep 'panic: test timed out' gotestsum.json | grep -E -o '("Test":[^,}]*)'); do
351+
if [ -n "$testWithStack" ] && grep -q "${testWithStack}.*PASS" gotestsum.json; then
352+
echo "Conditions met for gotestsum stack trace missing bug, outputting panic trace:"
353+
grep -A 999999 "${testWithStack}.*panic: test timed out" gotestsum.json
354+
fi
355+
done
356+
fi
357+
exit $ret
358+
359+
- uses: actions/upload-artifact@v3
360+
if: success() || failure()
361+
with:
362+
name: gotestsum-debug-${{ matrix.os }}.json
363+
path: ./gotestsum.json
364+
retention-days: 7
365+
366+
- uses: actions/upload-artifact@v3
367+
if: success() || failure()
368+
with:
369+
name: gotests-${{ matrix.os }}.xml
370+
path: ./gotests.xml
371+
retention-days: 30
340372

341373
- uses: codecov/codecov-action@v3
342374
# This action has a tendency to error out unexpectedly, it has
@@ -397,7 +429,38 @@ jobs:
397429
terraform_wrapper: false
398430

399431
- name: Test with PostgreSQL Database
400-
run: make test-postgres
432+
run: |
433+
set +e
434+
make test-postgres
435+
ret=$?
436+
if ((ret)); then
437+
# Eternalize test timeout logs because "re-run failed" erases
438+
# artifacts and gotestsum doesn't always capture it:
439+
# https://github.com/gotestyourself/gotestsum/issues/292
440+
# Multiple test packages could've failed, each one may or may
441+
# not run into the edge case. PS. Don't summon ShellCheck here.
442+
for testWithStack in $(grep 'panic: test timed out' gotestsum.json | grep -E -o '("Test":[^,}]*)'); do
443+
if [ -n "$testWithStack" ] && grep -q "${testWithStack}.*PASS" gotestsum.json; then
444+
echo "Conditions met for gotestsum stack trace missing bug, outputting panic trace:"
445+
grep -A 999999 "${testWithStack}.*panic: test timed out" gotestsum.json
446+
fi
447+
done
448+
fi
449+
exit $ret
450+
451+
- uses: actions/upload-artifact@v3
452+
if: success() || failure()
453+
with:
454+
name: gotestsum-debug-postgres.json
455+
path: ./gotestsum.json
456+
retention-days: 7
457+
458+
- uses: actions/upload-artifact@v3
459+
if: success() || failure()
460+
with:
461+
name: gotests-postgres.xml
462+
path: ./gotests.xml
463+
retention-days: 30
401464

402465
- uses: codecov/codecov-action@v3
403466
# This action has a tendency to error out unexpectedly, it has

.github/workflows/packages.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ jobs:
3535
3636
echo "Installer URL: $installer_url"
3737
38-
# version should be extracted from the installer
39-
wingetcreate update Coder.Coder `
38+
.\wingetcreate.exe update Coder.Coder `
4039
--submit `
4140
--version "${{ steps.version.outputs.version }}" `
4241
--urls "$installer_url" `

.github/workflows/pr.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Lint PR
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- reopened
8+
- edited
9+
- synchronize
10+
11+
jobs:
12+
main:
13+
name: Validate PR title
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: amannn/action-semantic-pull-request@v5
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
with:
20+
requireScope: false

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157

158158
- name: Publish release
159159
run: |
160-
./scripts/publish_release.sh \
160+
./scripts/release/publish.sh \
161161
${{ (github.event.inputs.dry_run || github.event.inputs.snapshot) && '--dry-run' }} \
162162
./build/*_installer.exe \
163163
./build/*.zip \

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ vendor
1515
yarn-error.log
1616
gotests.coverage
1717
gotests.xml
18+
gotestsum.json
1819
.idea
1920
.gitpod.yml
2021
.DS_Store

Makefile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,30 @@ build-fat build-full build: $(CODER_FAT_BINARIES)
101101
release: $(CODER_FAT_BINARIES) $(CODER_ALL_ARCHIVES) $(CODER_ALL_PACKAGES) $(CODER_ARCH_IMAGES) build/coder_helm_$(VERSION).tgz
102102
.PHONY: release
103103

104-
build/coder-slim_$(VERSION)_checksums.sha1 site/out/bin/coder.sha1: $(CODER_SLIM_BINARIES)
104+
build/coder-slim_$(VERSION)_checksums.sha1: site/out/bin/coder.sha1
105+
cp "$<" "$@"
106+
107+
site/out/bin/coder.sha1: $(CODER_SLIM_BINARIES)
105108
pushd ./site/out/bin
106109
openssl dgst -r -sha1 coder-* | tee coder.sha1
107110
popd
108111

109-
cp "site/out/bin/coder.sha1" "build/coder-slim_$(VERSION)_checksums.sha1"
110-
111112
build/coder-slim_$(VERSION).tar: build/coder-slim_$(VERSION)_checksums.sha1 $(CODER_SLIM_BINARIES)
112113
pushd ./site/out/bin
113114
tar cf "../../../build/$(@F)" coder-*
114115
popd
115116

116-
build/coder-slim_$(VERSION).tar.zst site/out/bin/coder.tar.zst: build/coder-slim_$(VERSION).tar
117+
site/out/bin/coder.tar.zst: build/coder-slim_$(VERSION).tar.zst
118+
cp "$<" "$@"
119+
120+
build/coder-slim_$(VERSION).tar.zst: build/coder-slim_$(VERSION).tar
117121
zstd $(ZSTDFLAGS) \
118122
--force \
119123
--long \
120124
--no-progress \
121125
-o "build/coder-slim_$(VERSION).tar.zst" \
122126
"build/coder-slim_$(VERSION).tar"
123127

124-
cp "build/coder-slim_$(VERSION).tar.zst" "site/out/bin/coder.tar.zst"
125128
# delete the uncompressed binaries from the embedded dir
126129
rm site/out/bin/coder-*
127130

@@ -471,7 +474,10 @@ test: test-clean
471474
test-postgres: test-clean test-postgres-docker
472475
# The postgres test is prone to failure, so we limit parallelism for
473476
# more consistent execution.
474-
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." -- \
477+
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum \
478+
--junitfile="gotests.xml" \
479+
--jsonfile="gotestsum.json" \
480+
--packages="./..." -- \
475481
-covermode=atomic -coverprofile="gotests.coverage" -timeout=20m \
476482
-parallel=4 \
477483
-coverpkg=./... \

0 commit comments

Comments
 (0)