Skip to content

Commit b373cc2

Browse files
committed
Merge branch 'main' into 9754-severity
2 parents 984d3e1 + d58239b commit b373cc2

File tree

10 files changed

+58
-15
lines changed

10 files changed

+58
-15
lines changed

coderd/healthcheck/derphealth/derp.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"sync/atomic"
1212
"time"
1313

14+
"golang.org/x/exp/slices"
1415
"golang.org/x/xerrors"
1516
"tailscale.com/derp"
1617
"tailscale.com/derp/derphttp"
@@ -23,6 +24,7 @@ import (
2324

2425
"github.com/coder/coder/v2/coderd/healthcheck/health"
2526
"github.com/coder/coder/v2/coderd/util/ptr"
27+
"github.com/coder/coder/v2/coderd/util/slice"
2628
)
2729

2830
const (
@@ -188,6 +190,11 @@ func (r *RegionReport) Run(ctx context.Context) {
188190
}
189191
wg.Wait()
190192

193+
r.mu.Lock()
194+
defer r.mu.Unlock()
195+
196+
sortNodeReports(r.NodeReports)
197+
191198
// Coder allows for 1 unhealthy node in the region, unless there is only 1 node.
192199
if len(r.Region.Nodes) == 1 {
193200
r.Healthy = healthyNodes == len(r.Region.Nodes)
@@ -498,3 +505,9 @@ func convertError(err error) *string {
498505

499506
return nil
500507
}
508+
509+
func sortNodeReports(reports []*NodeReport) {
510+
slices.SortFunc(reports, func(a, b *NodeReport) int {
511+
return slice.Ascending(a.Node.Name, b.Node.Name)
512+
})
513+
}

coderd/healthcheck/derphealth/derp_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ func TestDERP(t *testing.T) {
8383

8484
t.Run("HealthyWithNodeDegraded", func(t *testing.T) {
8585
t.Parallel()
86-
t.Skip("https://github.com/coder/coder/issues/10824")
8786

8887
healthyDerpSrv := derp.NewServer(key.NewNode(), func(format string, args ...any) { t.Logf(format, args...) })
8988
defer healthyDerpSrv.Close()

codersdk/deployment.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func (n FeatureName) AlwaysEnable() bool {
9595
FeatureExternalProvisionerDaemons: true,
9696
FeatureAppearance: true,
9797
FeatureWorkspaceBatchActions: true,
98+
FeatureHighAvailability: true,
9899
}[n]
99100
}
100101

enterprise/coderd/coderd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ func (api *API) updateEntitlements(ctx context.Context) error {
472472
codersdk.FeatureAuditLog: api.AuditLogging,
473473
codersdk.FeatureBrowserOnly: api.BrowserOnly,
474474
codersdk.FeatureSCIM: len(api.SCIMAPIKey) != 0,
475-
codersdk.FeatureHighAvailability: api.DERPServerRelayAddress != "",
476475
codersdk.FeatureMultipleExternalAuth: len(api.ExternalAuthConfigs) > 1,
477476
codersdk.FeatureTemplateRBAC: api.RBAC,
478477
codersdk.FeatureExternalTokenEncryption: len(api.ExternalTokenEncryption) > 0,

offlinedocs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"next": "14.0.1",
2828
"react": "18.2.0",
2929
"react-dom": "18.2.0",
30-
"react-icons": "4.11.0",
30+
"react-icons": "4.12.0",
3131
"react-markdown": "8.0.3",
3232
"rehype-raw": "6.1.1",
3333
"remark-gfm": "3.0.1"

offlinedocs/pnpm-lock.yaml

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

site/src/components/SyntaxHighlighter/SyntaxHighlighter.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const SyntaxHighlighter: FC<{
3434

3535
return (
3636
<div
37+
data-chromatic="ignore"
3738
css={(theme) => ({
3839
padding: "8px 0",
3940
background: theme.palette.background.paper,
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Tabs, TabLink } from "./Tabs";
2+
import type { Meta, StoryObj } from "@storybook/react";
3+
4+
const meta: Meta<typeof Tabs> = {
5+
title: "components/Tabs",
6+
component: Tabs,
7+
};
8+
9+
export default meta;
10+
type Story = StoryObj<typeof Tabs>;
11+
12+
export const Default: Story = {
13+
args: {
14+
children: (
15+
<>
16+
<TabLink to="">Tab 1</TabLink>
17+
<TabLink to="tab-3">Tab 2</TabLink>
18+
<TabLink to="tab-4">Tab 3</TabLink>
19+
</>
20+
),
21+
},
22+
};

site/src/components/Tabs/Tabs.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ interface TabLinkProps extends NavLinkProps {
2929
className?: string;
3030
}
3131

32-
export const TabLink: FC<TabLinkProps> = ({
33-
className,
34-
children,
35-
...linkProps
36-
}) => {
32+
export const TabLink: FC<TabLinkProps> = ({ className, ...linkProps }) => {
3733
const tabLink = useClassName(classNames.tabLink, []);
3834
const activeTabLink = useClassName(classNames.activeTabLink, []);
3935

site/src/pages/TemplatePage/TemplateInsightsPage/TemplateInsightsPage.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ import {
2525
useId,
2626
} from "react";
2727
import chroma from "chroma-js";
28-
import { subDays, addWeeks, format } from "date-fns";
28+
import {
29+
subDays,
30+
addWeeks,
31+
format,
32+
startOfDay,
33+
startOfHour,
34+
addHours,
35+
} from "date-fns";
2936
import { useSearchParams } from "react-router-dom";
3037
import "react-date-range/dist/styles.css";
3138
import "react-date-range/dist/theme/default.css";
@@ -146,9 +153,14 @@ const getDateRange = (
146153
}
147154

148155
if (interval === "day") {
156+
// Only instantiate new Date once so that we don't get the wrong interval if
157+
// start is 23:59:59.999 and the clock shifts to 00:00:00 before the second
158+
// instantiation.
159+
const today = new Date();
149160
return {
150-
startDate: subDays(new Date(), 6),
151-
endDate: new Date(),
161+
startDate: startOfDay(subDays(today, 6)),
162+
// Add one hour to endDate to include real-time data for today.
163+
endDate: addHours(startOfHour(today), 1),
152164
};
153165
}
154166

0 commit comments

Comments
 (0)