Spike Curtis
bddb808b25
chore: arrange imports in a standard way ( #21452 )
...
Fixes all our Go file imports to match the preferred spec that we've _mostly_ been using. For example:
```
import (
"context"
"time"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/xerrors"
"gopkg.in/natefinch/lumberjack.v2"
"cdr.dev/slog/v3"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/serpent"
)
```
3 groups: standard library, 3rd partly libs, Coder libs.
This PR makes the change across the codebase. The PR in the stack above modifies our formatting to maintain this state of affairs, and is a separate PR so it's possible to review that one in detail.
2026-01-08 15:24:11 +04:00
Spike Curtis
49b34a716a
fix: fix slog to always use array of Fields ( #21426 )
...
Upgrades to slog v3 which includes a small, but backward incompatible API change to the acceptible call arguments when logging. This change allows us to verify via compile time type checking that arguments are correct and won't cause a panic, as was possible in slog v1, which this replaces (v2 was tagged but never used in coder/coder).
It also updates dependencies that also use slog and were updated.
I've left the `aibridge` dependency as a commit SHA, under the assumption that the team there (cc @pawbana @dannykopping ) will tag and update the dependency soon and on their own schedule.
Other dependencies, I pushed new tags.
2026-01-08 10:29:41 +04:00
dependabot[bot]
519812776e
chore: bump github.com/stretchr/testify from 1.10.0 to 1.11.1 ( #19599 )
...
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify )
from 1.10.0 to 1.11.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/stretchr/testify/releases ">github.com/stretchr/testify's
releases</a>.</em></p>
<blockquote>
<h2>v1.11.1</h2>
<p>This release fixes <a
href="https://redirect.github.com/stretchr/testify/issues/1785 ">#1785</a>
introduced in v1.11.0 where expected argument values implementing the
stringer interface (<code>String() string</code>) with a method which
mutates their value, when passed to mock.Mock.On
(<code>m.On("Method", <expected>).Return()</code>) or
actual argument values passed to mock.Mock.Called may no longer match
one another where they previously did match. The behaviour prior to
v1.11.0 where the stringer is always called is restored. Future testify
releases may not call the stringer method at all in this case.</p>
<h2>What's Changed</h2>
<ul>
<li>Backport <a
href="https://redirect.github.com/stretchr/testify/issues/1786 ">#1786</a>
to release/1.11: mock: revert to pre-v1.11.0 argument matching behavior
for mutating stringers by <a
href="https://github.com/brackendawson "><code>@brackendawson</code></a>
in <a
href="https://redirect.github.com/stretchr/testify/pull/1788 ">stretchr/testify#1788</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/stretchr/testify/compare/v1.11.0...v1.11.1 ">https://github.com/stretchr/testify/compare/v1.11.0...v1.11.1 </a></p>
<h2>v1.11.0</h2>
<h2>What's Changed</h2>
<h3>Functional Changes</h3>
<p>v1.11.0 Includes a number of performance improvements.</p>
<ul>
<li>Call stack perf change for CallerInfo by <a
href="https://github.com/mikeauclair "><code>@mikeauclair</code></a> in
<a
href="https://redirect.github.com/stretchr/testify/pull/1614 ">stretchr/testify#1614</a></li>
<li>Lazily render mock diff output on successful match by <a
href="https://github.com/mikeauclair "><code>@mikeauclair</code></a> in
<a
href="https://redirect.github.com/stretchr/testify/pull/1615 ">stretchr/testify#1615</a></li>
<li>assert: check early in Eventually, EventuallyWithT, and Never by <a
href="https://github.com/cszczepaniak "><code>@cszczepaniak</code></a>
in <a
href="https://redirect.github.com/stretchr/testify/pull/1427 ">stretchr/testify#1427</a></li>
<li>assert: add IsNotType by <a
href="https://github.com/bartventer "><code>@bartventer</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1730 ">stretchr/testify#1730</a></li>
<li>assert.JSONEq: shortcut if same strings by <a
href="https://github.com/dolmen "><code>@dolmen</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1754 ">stretchr/testify#1754</a></li>
<li>assert.YAMLEq: shortcut if same strings by <a
href="https://github.com/dolmen "><code>@dolmen</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1755 ">stretchr/testify#1755</a></li>
<li>assert: faster and simpler isEmpty using reflect.Value.IsZero by <a
href="https://github.com/dolmen "><code>@dolmen</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1761 ">stretchr/testify#1761</a></li>
<li>suite: faster methods filtering (internal refactor) by <a
href="https://github.com/dolmen "><code>@dolmen</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1758 ">stretchr/testify#1758</a></li>
</ul>
<h3>Fixes</h3>
<ul>
<li>assert.ErrorAs: log target type by <a
href="https://github.com/craig65535 "><code>@craig65535</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1345 ">stretchr/testify#1345</a></li>
<li>Fix failure message formatting for Positive and Negative asserts in
<a
href="https://redirect.github.com/stretchr/testify/pull/1062 ">stretchr/testify#1062</a></li>
<li>Improve ErrorIs message when error is nil but an error was expected
by <a href="https://github.com/tsioftas "><code>@tsioftas</code></a> in
<a
href="https://redirect.github.com/stretchr/testify/pull/1681 ">stretchr/testify#1681</a></li>
<li>fix Subset/NotSubset when calling with mixed input types by <a
href="https://github.com/siliconbrain "><code>@siliconbrain</code></a>
in <a
href="https://redirect.github.com/stretchr/testify/pull/1729 ">stretchr/testify#1729</a></li>
<li>Improve ErrorAs failure message when error is nil by <a
href="https://github.com/ccoVeille "><code>@ccoVeille</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1734 ">stretchr/testify#1734</a></li>
<li>mock.AssertNumberOfCalls: improve error msg by <a
href="https://github.com/3scalation "><code>@3scalation</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1743 ">stretchr/testify#1743</a></li>
</ul>
<h3>Documentation, Build & CI</h3>
<ul>
<li>docs: Fix typo in README by <a
href="https://github.com/alexandear "><code>@alexandear</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1688 ">stretchr/testify#1688</a></li>
<li>Replace deprecated io/ioutil with io and os by <a
href="https://github.com/alexandear "><code>@alexandear</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1684 ">stretchr/testify#1684</a></li>
<li>Document consequences of calling t.FailNow() by <a
href="https://github.com/greg0ire "><code>@greg0ire</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1710 ">stretchr/testify#1710</a></li>
<li>chore: update docs for Unset <a
href="https://redirect.github.com/stretchr/testify/issues/1621 ">#1621</a>
by <a href="https://github.com/techfg "><code>@techfg</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1709 ">stretchr/testify#1709</a></li>
<li>README: apply gofmt to examples by <a
href="https://github.com/alexandear "><code>@alexandear</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1687 ">stretchr/testify#1687</a></li>
<li>refactor: use %q and %T to simplify fmt.Sprintf by <a
href="https://github.com/alexandear "><code>@alexandear</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1674 ">stretchr/testify#1674</a></li>
<li>Propose Christophe Colombier (ccoVeille) as approver by <a
href="https://github.com/brackendawson "><code>@brackendawson</code></a>
in <a
href="https://redirect.github.com/stretchr/testify/pull/1716 ">stretchr/testify#1716</a></li>
<li>Update documentation for the Error function in assert or require
package by <a
href="https://github.com/architagr "><code>@architagr</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1675 ">stretchr/testify#1675</a></li>
<li>assert: remove deprecated build constraints by <a
href="https://github.com/alexandear "><code>@alexandear</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1671 ">stretchr/testify#1671</a></li>
<li>assert: apply gofumpt to internal test suite by <a
href="https://github.com/ccoVeille "><code>@ccoVeille</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1739 ">stretchr/testify#1739</a></li>
<li>CI: fix shebang in .ci.*.sh scripts by <a
href="https://github.com/dolmen "><code>@dolmen</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1746 ">stretchr/testify#1746</a></li>
<li>assert,require: enable parallel testing on (almost) all top tests by
<a href="https://github.com/dolmen "><code>@dolmen</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1747 ">stretchr/testify#1747</a></li>
<li>suite.Passed: add one more status test report by <a
href="https://github.com/Ararsa-Derese "><code>@Ararsa-Derese</code></a>
in <a
href="https://redirect.github.com/stretchr/testify/pull/1706 ">stretchr/testify#1706</a></li>
<li>Add Helper() method in internal mocks and assert.CollectT by <a
href="https://github.com/dolmen "><code>@dolmen</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1423 ">stretchr/testify#1423</a></li>
<li>assert.Same/NotSame: improve usage of Sprintf by <a
href="https://github.com/ccoVeille "><code>@ccoVeille</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1742 ">stretchr/testify#1742</a></li>
<li>mock: enable parallel testing on internal testsuite by <a
href="https://github.com/dolmen "><code>@dolmen</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1756 ">stretchr/testify#1756</a></li>
<li>suite: cleanup use of 'testing' internals at runtime by <a
href="https://github.com/dolmen "><code>@dolmen</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1751 ">stretchr/testify#1751</a></li>
<li>assert: check test failure message for Empty and NotEmpty by <a
href="https://github.com/ccoVeille "><code>@ccoVeille</code></a> in <a
href="https://redirect.github.com/stretchr/testify/pull/1745 ">stretchr/testify#1745</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/stretchr/testify/commit/2a57335dc9cd6833daa820bc94d9b40c26a7917d "><code>2a57335</code></a>
Merge pull request <a
href="https://redirect.github.com/stretchr/testify/issues/1788 ">#1788</a>
from brackendawson/1785-backport-1.11</li>
<li><a
href="https://github.com/stretchr/testify/commit/af8c91234f184009f57ef29027b39ca89cb00100 "><code>af8c912</code></a>
Backport <a
href="https://redirect.github.com/stretchr/testify/issues/1786 ">#1786</a>
to release/1.11</li>
<li><a
href="https://github.com/stretchr/testify/commit/b7801fbf5cd58d201296d5d0e132d1849966dbd4 "><code>b7801fb</code></a>
Merge pull request <a
href="https://redirect.github.com/stretchr/testify/issues/1778 ">#1778</a>
from stretchr/dependabot/github_actions/actions/chec...</li>
<li><a
href="https://github.com/stretchr/testify/commit/69831f3b08c40d56a09d0be93e9d5ae034f1590b "><code>69831f3</code></a>
build(deps): bump actions/checkout from 4 to 5</li>
<li><a
href="https://github.com/stretchr/testify/commit/a53be35c3b0cfcd5189cffcfd75df60ea581104c "><code>a53be35</code></a>
Improve captureTestingT helper</li>
<li><a
href="https://github.com/stretchr/testify/commit/aafb604176db7e1f2c9810bc90d644291d057687 "><code>aafb604</code></a>
mock: improve formatting of error message</li>
<li><a
href="https://github.com/stretchr/testify/commit/7218e0390acd2aea3edb18574110ec2753c0aeef "><code>7218e03</code></a>
improve error msg</li>
<li><a
href="https://github.com/stretchr/testify/commit/929a2126c2702df436312656a0304580b526c6e9 "><code>929a212</code></a>
Merge pull request <a
href="https://redirect.github.com/stretchr/testify/issues/1758 ">#1758</a>
from stretchr/dolmen/suite-faster-method-filtering</li>
<li><a
href="https://github.com/stretchr/testify/commit/bc7459ec38128532ff32f23cfab4ea0b725210f2 "><code>bc7459e</code></a>
suite: faster filtering of methods (-testify.m)</li>
<li><a
href="https://github.com/stretchr/testify/commit/7d37b5c962954410bcd7a71ff3a77c79514056d1 "><code>7d37b5c</code></a>
suite: refactor methodFilter</li>
<li>Additional commits viewable in <a
href="https://github.com/stretchr/testify/compare/v1.10.0...v1.11.1 ">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores )
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
---------
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ethan Dickson <ethan@coder.com >
2025-09-02 03:12:37 +00:00
ケイラ
fae30a00fd
chore: remove unnecessary redeclarations in for loops ( #18440 )
2025-06-20 13:16:55 -06:00
Jon Ayers
17ddee05e5
chore: update golang to 1.24.1 ( #17035 )
...
- Update go.mod to use Go 1.24.1
- Update GitHub Actions setup-go action to use Go 1.24.1
- Fix linting issues with golangci-lint by:
- Updating to golangci-lint v1.57.1 (more compatible with Go 1.24.1)
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
---------
Co-authored-by: Claude <claude@anthropic.com >
2025-03-26 01:56:39 -05:00
Danny Kopping
da54c8a51f
fix: fix data race in TestLabelsAggregation tests ( #12578 )
2024-03-13 13:47:22 +02:00
Danny Kopping
7a7105ad66
feat: make agent stats' cardinality configurable ( #12535 )
2024-03-13 12:03:36 +02:00
Cian Johnston
8f40ee3465
Revert "feat: make agent stats' cardinality configurable ( #12468 )" ( #12533 )
...
This reverts commit 21d1873d97 .
2024-03-11 14:33:36 +00:00
Danny Kopping
21d1873d97
feat: make agent stats' cardinality configurable ( #12468 )
...
Closes #12221
2024-03-11 16:04:08 +02:00
Marcin Tojek
aacb4a2b4c
feat: use map instead of slice in metrics aggregator ( #11815 )
2024-01-29 09:12:41 +01:00
Spike Curtis
fdd60d316e
fix: fix MetricsAggregator check for metric sameness ( #11508 )
...
Fixes #11451
A refactor of the Agent API passes metrics as protobufs, which include pointers to label name/value pairs. The aggregator tested for sameness by doing a shallow compare of label values, which for different stats reports would compare unequal because the pointers would be different.
This fix does a deep compare.
While testing I also noted that we neglect to compare template names. This is unlikely to have caused any issue in practice, since the combination of username/workspace is unique, but in the context of comparing metric labels we should do the comparison.
If a user creates a workspace, deletes it, then recreates from a different template, we could in principle have reported incorrect stats for the old template.
2024-01-09 15:21:30 +04:00
Dean Sheather
e46431078c
feat: add AgentAPI using DRPC ( #10811 )
...
Co-authored-by: Spike Curtis <spike@coder.com >
2023-12-18 22:53:28 +10:00
Steven Masley
b7bdb17460
feat: add metrics to workspace agent scripts ( #11132 )
...
* push startup script metrics to agent
2023-12-13 11:45:43 -06:00
Kyle Carberry
22e781eced
chore: add /v2 to import module path ( #9072 )
...
* chore: add /v2 to import module path
go mod requires semantic versioning with versions greater than 1.x
This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```
Migrate generated files to import /v2
* Fix gen
2023-08-18 18:55:43 +00:00
Cian Johnston
751c0505bf
chore: add benchmark for prometheusmetrics.MetricsAggregator ( #8066 )
...
* add benchmark for prom metrics aggregator
* fixup! add benchmark for prom metrics aggregator
* make fmt
2023-06-16 14:04:28 +01:00
Marcin Tojek
14efdadd3c
feat: Collect agent SSH metrics ( #7584 )
2023-05-25 12:52:36 +02:00
Marcin Tojek
bb0a38b161
feat: Implement aggregator for agent metrics ( #7259 )
2023-04-27 12:34:00 +02:00