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

Skip to content

Commit 4b6992c

Browse files
committed
Merge branch 'main' into exportstats
2 parents 9f00ac5 + 29ced72 commit 4b6992c

File tree

4 files changed

+32
-12
lines changed

4 files changed

+32
-12
lines changed

.github/workflows/security.yaml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ permissions:
66
security-events: write
77

88
on:
9-
push:
10-
branches: ["main"]
11-
12-
pull_request:
13-
branches: ["main"]
14-
159
workflow_dispatch:
1610

1711
schedule:
18-
# Run every week at 10:24 on Thursday.
19-
- cron: "24 10 * * 4"
12+
# Run every 6 hours Monday-Friday!
13+
- cron: "0 0,6,12,18 * * 1-5"
2014

2115
# Cancel in-progress runs for pull requests when developers push
2216
# additional changes
@@ -59,6 +53,17 @@ jobs:
5953
- name: Perform CodeQL Analysis
6054
uses: github/codeql-action/analyze@v2
6155

56+
- name: Send Slack notification on failure
57+
if: ${{ failure() }}
58+
run: |
59+
msg="❌ CodeQL Failed\n\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
60+
curl \
61+
-qfsSL \
62+
-X POST \
63+
-H "Content-Type: application/json" \
64+
--data "{\"content\": \"$msg\"}" \
65+
"${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}"
66+
6267
trivy:
6368
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-8-cores' || 'ubuntu-latest' }}
6469
steps:
@@ -135,3 +140,14 @@ jobs:
135140
name: trivy
136141
path: trivy-results.sarif
137142
retention-days: 7
143+
144+
- name: Send Slack notification on failure
145+
if: ${{ failure() }}
146+
run: |
147+
msg="❌ CodeQL Failed\n\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
148+
curl \
149+
-qfsSL \
150+
-X POST \
151+
-H "Content-Type: application/json" \
152+
--data "{\"content\": \"$msg\"}" \
153+
"${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}"

agent/agent.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ func New(options Options) io.Closer {
123123
tempDir: options.TempDir,
124124
lifecycleUpdate: make(chan struct{}, 1),
125125
lifecycleReported: make(chan codersdk.WorkspaceAgentLifecycle, 1),
126-
connStatsChan: make(chan *agentsdk.Stats, 1),
126+
// TODO: This is a temporary hack to make tests not flake.
127+
// @kylecarbs has a better solution in here: https://github.com/coder/coder/pull/6469
128+
connStatsChan: make(chan *agentsdk.Stats, 8),
127129
}
128130
a.init(ctx)
129131
return a

coderd/activitybump.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func activityBumpWorkspace(ctx context.Context, log slog.Logger, db database.Sto
8282
return nil
8383
}, nil)
8484
if err != nil {
85-
if !xerrors.Is(err, context.Canceled) {
85+
if !xerrors.Is(err, context.Canceled) && !database.IsQueryCanceledError(err) {
8686
// Bump will fail if the context is canceled, but this is ok.
8787
log.Error(ctx, "bump failed", slog.Error(err),
8888
slog.F("workspace_id", workspaceID),

tailnet/conn.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,13 @@ func (c *Conn) selfNode() *Node {
657657
}
658658
var preferredDERP int
659659
var derpLatency map[string]float64
660-
var derpForcedWebsocket map[int]string
660+
derpForcedWebsocket := make(map[int]string, 0)
661661
if c.lastNetInfo != nil {
662662
preferredDERP = c.lastNetInfo.PreferredDERP
663663
derpLatency = c.lastNetInfo.DERPLatency
664-
derpForcedWebsocket = c.lastDERPForcedWebsockets
664+
for k, v := range c.lastDERPForcedWebsockets {
665+
derpForcedWebsocket[k] = v
666+
}
665667
}
666668

667669
node := &Node{

0 commit comments

Comments
 (0)