8000 Merge branch 'main' into mes/beta-badges · coder/coder@c2d7cda · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit c2d7cda

Browse files
committed
Merge branch 'main' into mes/beta-badges
2 parents 693946f + 9006b21 commit c2d7cda

File tree

17 files changed

+291
-96
lines changed

17 files changed

+291
-96
lines changed

.github/workflows/contrib.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
- opened
1414
- reopened
1515
- edited
16+
# For jobs that don't run on draft PRs.
17+
- ready_for_review
1618

1719
# Only run one instance per PR to ensure in-order execution.
1820
concurrency: pr-${{ github.ref }}
@@ -52,7 +54,7 @@ jobs:
5254
release-labels:
5355
runs-on: ubuntu-latest
5456
# Skip tagging for draft PRs.
55-
if: ${{ github.event_name == 'pull_request_target' && success() && !github.event.pull_request.draft }}
57+
if: ${{ github.event_name == 'pull_request_target' && !github.event.pull_request.draft }}
5658
steps:
5759
- name: release-labels
5860
uses: actions/github-script@v7

agent/agent.go

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,16 +1676,12 @@ func (a *agent) manageProcessPriority(ctx context.Context, debouncer *logDebounc
16761676
}
16771677

16781678
score, niceErr := proc.Niceness(a.syscaller)
1679-
if niceErr != nil && !xerrors.Is(niceErr, os.ErrPermission) {
1680-
if !isNoSuchProcessErr(niceErr) {
1681-
debouncer.Warn(ctx, "unable to get proc niceness",
1682-
slog.F("cmd", proc.Cmd()),
1683-
slog.F("pid", proc.PID),
1684-
slog.Error(niceErr),
1685-
)
1686-
}
1687-
1688-
continue
1679+
if !isBenignProcessErr(niceErr) {
1680+
debouncer.Warn(ctx, "unable to get proc niceness",
1681+
slog.F("cmd", proc.Cmd()),
1682+
slog.F("pid", proc.PID),
1683+
slog.Error(niceErr),
1684+
)
16891685
}
16901686

16911687
// We only want processes that don't have a nice value set
@@ -1699,31 +1695,27 @@ func (a *agent) manageProcessPriority(ctx context.Context, debouncer *logDebounc
16991695

17001696
if niceErr == nil {
17011697
err := proc.SetNiceness(a.syscaller, niceness)
1702-
if err != nil && !xerrors.Is(err, os.ErrPermission) {
1703-
if !isNoSuchProcessErr(err) {
1704-
debouncer.Warn(ctx, "unable to set proc niceness",
1705-
slog.F("cmd", proc.Cmd()),
1706-
slog.F("pid", proc.PID),
1707-
slog.F("niceness", niceness),
1708-
slog.Error(err),
1709-
)
1710-
}
1698+
if !isBenignProcessErr(err) {
1699+
debouncer.Warn(ctx, "unable to set proc niceness",
1700+
slog.F("cmd", p 9E88 roc.Cmd()),
1701+
slog.F("pid", proc.PID),
1702+
slog.F("niceness", niceness),
1703+
slog.Error(err),
1704+
)
17111705
}
17121706
}
17131707

17141708
// If the oom score is valid and it's not already set and isn't a custom value set by another process then it's ok to update it.
17151709
if oomScore != unsetOOMScore && oomScore != proc.OOMScoreAdj && !isCustomOOMScore(agentScore, proc) {
17161710
oomScoreStr := strconv.Itoa(oomScore)
17171711
err := afero.WriteFile(a.filesystem, fmt.Sprintf("/proc/%d/oom_score_adj", proc.PID), []byte(oomScoreStr), 0o644)
1718-
if err != nil && !xerrors.Is(err, os.ErrPermission) {
1719-
if !isNoSuchProcessErr(err) {
1720-
debouncer.Warn(ctx, "unable to set oom_score_adj",
1721-
slog.F("cmd", proc.Cmd()),
1722-
slog.F("pid", proc.PID),
1723-
slog.F("score", oomScoreStr),
1724-
slog.Error(err),
1725-
)
1726-
}
1712+
if !isBenignProcessErr(err) {
1713+
debouncer.Warn(ctx, "unable to set oom_score_adj",
1714+
slog.F("cmd", proc.Cmd()),
1715+
slog.F("pid", proc.PID),
1716+
slog.F("score", oomScoreStr),
1717+
slog.Error(err),
1718+
)
17271719
}
17281720
}
17291721
modProcs = append(modProcs, proc)
@@ -2154,6 +2146,13 @@ func (l *logDebouncer) log(ctx context.Context, level slog.Level, msg string, fi
21542146
l.messages[msg] = time.Now()
21552147
}
21562148

2149+
func isBenignProcessErr(err error) bool {
2150+
return err != nil &&
2151+
(xerrors.Is(err, os.ErrNotExist) ||
2152+
xerrors.Is(err, os.ErrPermission) ||
2153+
isNoSuchProcessErr(err))
2154+
}
2155+
21572156
func isNoSuchProcessErr(err error) bool {
21582157
return err != nil && strings.Contains(err.Error(), "no such process")
21592158
}

agent/agentproc/proc_unix.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,15 @@ func List(fs afero.Fs, syscaller Syscaller) ([]*Process, error) {
4545

4646
cmdline, err := afero.ReadFile(fs, filepath.Join(defaultProcDir, entry, "cmdline"))
4747
if err != nil {
48-
var errNo syscall.Errno
49-
if xerrors.As(err, &errNo) && errNo == syscall.EPERM {
48+
if isBenignError(err) {
5049
continue
5150
}
5251
return nil, xerrors.Errorf("read cmdline: %w", err)
5352
}
5453

5554
oomScore, err := afero.ReadFile(fs, filepath.Join(defaultProcDir, entry, "oom_score_adj"))
5655
if err != nil {
57-
if xerrors.Is(err, os.ErrPermission) {
56+
if isBenignError(err) {
5857
continue
5958
}
6059

@@ -124,3 +123,12 @@ func (p *Process) Cmd() string {
124123
func (p *Process) cmdLine() []string {
125124
return strings.Split(p.CmdLine, "\x00")
126125
}
126+
127+
func isBenignError(err error) bool {
128+
var errno syscall.Errno
129+
if !xerrors.As(err, &errno) {
130+
return false
131+
}
132+
133+
return errno == syscall.ESRCH || errno == syscall.EPERM || xerrors.Is(err, os.ErrNotExist)
134+
}

coderd/apidoc/docs.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/contributing/feature-stages.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ coder server --experiments=feature1,feature2
3232
<!-- Code generated by scripts/release/docs_update_experiments.sh. DO NOT EDIT. -->
3333
<!-- BEGIN: available-experimental-features -->
3434

35-
Currently no experimental features are available in the latest mainline or
36-
stable release.
35+
| Feature | Description | Available in |
36+
| --------------- | ------------------------------------------------------------------- | ---------------- |
37+
| `notifications` | Sends notifications via SMTP and webhooks following certain events. | mainline, stable |
3738

3839
<!-- END: available-experimental-features -->

docs/reference/api/enterprise.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/api/schemas.md

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/templates/change-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The
1414
can be used to push new template versions, either manually, or in CI/CD
1515
pipelines. To run the provider in a CI/CD pipeline, and to prevent drift, you'll
1616
need to store the Terraform state
17-
[remotely](https://developer.hashicorp.com/terraform/language/settings/backends/configuration).
17+
[remotely](https://developer.hashicorp.com/terraform/language/backend).
1818

1919
```hcl
2020
terraform {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ require (
178178
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa
179179
golang.org/x/mod v0.21.0
180180
golang.org/x/net v0.29.0
181-
golang.org/x/oauth2 v0.22.0
181+
golang.org/x/oauth2 v0.23.0
182182
golang.org/x/sync v0.8.0
183183
golang.org/x/sys v0.25.0
184184
golang.org/x/term v0.24.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,8 +1098,8 @@ golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
10981098
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
10991099
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
11001100
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
1101-
golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
1102-
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
1101+
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
1102+
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
11031103
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
11041104
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
11051105
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

scripts/lib.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ dependencies() {
108108
for dep in "$@"; do
109109
if ! dependency_check "$dep"; then
110110
log "ERROR: The '$dep' dependency is required, but is not available."
111+
if isdarwin; then
112+
case "$dep" in
113+
gsed | gawk)
114+
log "- brew install $dep"
115+
;;
116+
esac
117+
fi
111118
fail=1
112119
fi
113120
done

scripts/release/docs_update_experiments.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ set -euo pipefail
1212
source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh"
1313
cdroot
1414

15+
if isdarwin; then
16+
dependencies gsed gawk
17+
sed() { gsed "$@"; }
18+
awk() { gawk "$@"; }
19+
fi
20+
1521
# From install.sh
1622
echo_latest_stable_version() {
1723
# https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860

site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"@vitejs/plugin-react": "4.3.1",
143143
"chromatic": "11.3.0",
144144
"eventsourcemock": "2.0.0",
145-
"express": "4.19.2",
145+
"express": "4.20.0",
146146
"jest": "29.7.0",
147147
"jest-canvas-mock": "2.5.2",
148148
"jest-environment-jsdom": "29.5.0",

0 commit comments

Comments
 (0)
0