Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 32a2f97

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/offlinedocs/react-icons-4.10.1
2 parents de8017e + 196b299 commit 32a2f97

File tree

6 files changed

+81
-11
lines changed

6 files changed

+81
-11
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name: Deploy PR
33
on:
44
issue_comment:
5+
types: [created, edited]
56
workflow_dispatch:
67
inputs:
78
pr_number:
@@ -137,32 +138,33 @@ jobs:
137138
- name: Checkout
138139
uses: actions/checkout@v3
139140

140-
- name: "Set up kubeconfig"
141+
- name: Set up kubeconfig
141142
run: |
142143
set -euxo pipefail
143144
mkdir -p ~/.kube
144145
echo "${{ secrets.DELIVERYBOT_KUBECONFIG }}" > ~/.kube/config
145146
export KUBECONFIG=~/.kube/config
146147
147-
- name: "Create PR namespace"
148+
- name: Create PR namespace
148149
run: |
149150
set -euxo pipefail
150151
# try to delete the namespace, but don't fail if it doesn't exist
151152
kubectl delete namespace "pr${{ env.PR_NUMBER }}" || true
152153
kubectl create namespace "pr${{ env.PR_NUMBER }}"
153154
154-
- name: "Install Helm chart"
155+
- name: Install Helm chart
155156
run: |
156157
helm upgrade --install pr${{ env.PR_NUMBER }} ./helm \
157158
--namespace "pr${{ env.PR_NUMBER }}" \
158159
--set coder.image.repo=${{ env.REPO }} \
159160
--set coder.image.tag=pr${{ env.PR_NUMBER }} \
160161
--set coder.service.type=ClusterIP \
162+
--set coder.serviceAccount.enableDeployments=true \
161163
--set coder.env[0].name=CODER_ACCESS_URL \
162164
--set coder.env[0].value="" \
163165
--force
164166
165-
- name: "Get deployment URL"
167+
- name: Get deployment URL
166168
id: deployment_url
167169
run: |
168170
set -euo pipefail
@@ -172,6 +174,13 @@ jobs:
172174
echo "::add-mask::$CODER_ACCESS_URL"
173175
echo "CODER_ACCESS_URL=$CODER_ACCESS_URL" >> $GITHUB_OUTPUT
174176
177+
- name: Install coder-logstream-kube
178+
run: |
179+
helm repo add coder-logstream-kube https://helm.coder.com/logstream-kube
180+
helm install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
181+
--namespace "pr${{ env.PR_NUMBER }}" \
182+
--set url="${{ steps.deployment_url.outputs.CODER_ACCESS_URL }}"
183+
175184
- name: Send Slack notification
176185
run: |
177186
curl -s -o /dev/null -X POST -H 'Content-type: application/json' \

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,14 @@ else
410410
endif
411411
.PHONY: fmt/shfmt
412412

413-
lint: lint/shellcheck lint/go lint/ts lint/helm
413+
lint: lint/shellcheck lint/go lint/ts lint/helm lint/site-icons
414414
.PHONY: lint
415415

416+
lint/site-icons:
417+
./scripts/check_site_icons.sh
418+
419+
.PHONY: lint/site-icons
420+
416421
lint/ts:
417422
cd site
418423
yarn && yarn lint

coderd/unhanger/detector.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ func (d *Detector) Start() {
140140
if stats.Error != nil && !xerrors.As(stats.Error, &acquireLockError{}) {
141141
d.log.Warn(d.ctx, "error running workspace build hang detector once", slog.Error(stats.Error))
142142
}
143-
if len(stats.TerminatedJobIDs) != 0 {
144-
d.log.Warn(d.ctx, "detected (and terminated) hung provisioner jobs", slog.F("job_ids", stats.TerminatedJobIDs))
145-
}
146143
if d.stats != nil {
147144
select {
148145
case <-d.ctx.Done():
@@ -251,7 +248,10 @@ func unhangJob(ctx context.Context, log slog.Logger, db database.Store, pub pubs
251248
}
252249
}
253250

254-
log.Info(ctx, "detected hung (>5m) provisioner job, forcefully terminating")
251+
log.Warn(
252+
ctx, "detected hung provisioner job, forcefully terminating",
253+
"threshold", HungJobDuration,
254+
)
255255

256256
// First, get the latest logs from the build so we can make sure
257257
// our messages are in the latest stage.

docs/admin/automation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ curl https://coder.example.com/api/v2/workspaces?q=owner:me \
3030

3131
## Documentation
3232

33-
We publish an [API reference](../api/index.md) in our documentation. You can also enable a [Swagger endpoint](../cli/server#--swagger-enable) on your Coder deployment.
33+
We publish an [API reference](../api/index.md) in our documentation. You can also enable a [Swagger endpoint](../cli/server.md#--swagger-enable) on your Coder deployment.
3434

3535
## Use cases
3636

scripts/check_site_icons.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
# shellcheck source=scripts/lib.sh
5+
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
6+
cdroot
7+
8+
cd site/static/icon
9+
10+
# These exceptions are here for backwards compatibility. All new icons should
11+
# be SVG to minimize the size of our repo and our bundle.
12+
exceptions=(
13+
"aws.png"
14+
"azure.png"
15+
"docker.png"
16+
"do.png"
17+
"gcp.png"
18+
"k8s.png"
19+
)
20+
21+
function is_exception() {
22+
local value="$1"
23+
shift
24+
for item; do
25+
[[ "$item" == "$value" ]] && return 0
26+
done
27+
return 1
28+
}
29+
30+
for file in *; do
31+
# Extract filename
32+
filename=$(basename -- "$file")
33+
34+
# Check if the file is in the exception list
35+
if is_exception "$filename" "${exceptions[@]}"; then
36+
continue
37+
fi
38+
39+
# If not an exception, check if it's an svg file
40+
if [[ "$file" != *.svg ]]; then
41+
echo "Found a non-svg file not in exception list: $file"
42+
exit 1
43+
fi
44+
done

scripts/lib.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,19 @@ realpath() {
4141
# We have to define realpath before these otherwise it fails on Mac's bash.
4242
SCRIPT="${BASH_SOURCE[1]:-${BASH_SOURCE[0]}}"
4343
SCRIPT_DIR="$(realpath "$(dirname "$SCRIPT")")"
44-
PROJECT_ROOT="$(cd "$SCRIPT_DIR" && realpath "$(git rev-parse --show-toplevel)")"
44+
45+
function project_root {
46+
# Try to use `git rev-parse --show-toplevel` to find the project root.
47+
# If this directory is not a git repository, this command will fail.
48+
git rev-parse --show-toplevel 2>/dev/null && return
49+
50+
# This finds the Sapling root. This behavior is added so that @ammario
51+
# and others can more easily experiment with Sapling, but we do not have a
52+
# plan to support Sapling across the repo.
53+
sl root 2>/dev/null && return
54+
}
55+
56+
PROJECT_ROOT="$(cd "$SCRIPT_DIR" && realpath "$(project_root)")"
4557

4658
# pushd is a silent alternative to the real pushd shell command.
4759
pushd() {

0 commit comments

Comments
 (0)