Skip to content

Commit 4ff2254

Browse files
authored
chore: remove ai tasks from experiment (#18511)
Closes coder/internal#661
1 parent 45ab265 commit 4ff2254

File tree

9 files changed

+8
-27
lines changed

9 files changed

+8
-27
lines changed

coderd/apidoc/docs.go

Lines changed: 2 additions & 5 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: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/coderd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,6 @@ func New(options *Options) *API {
15441544
// Add CSP headers to all static assets and pages. CSP headers only affect
15451545
// browsers, so these don't make sense on api routes.
15461546
cspMW := httpmw.CSPHeaders(
1547-
api.Experiments,
15481547
options.Telemetry.Enabled(), func() []*proxyhealth.ProxyHost {
15491548
if api.DeploymentValues.Dangerous.AllowAllCors {
15501549
// In this mode, allow all external requests.

coderd/httpmw/csp.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"strings"
77

88
"github.com/coder/coder/v2/coderd/proxyhealth"
9-
"github.com/coder/coder/v2/codersdk"
109
)
1110

1211
// cspDirectives is a map of all csp fetch directives to their values.
@@ -59,7 +58,7 @@ const (
5958
// Example: https://github.com/coder/coder/issues/15118
6059
//
6160
//nolint:revive
62-
func CSPHeaders(experiments codersdk.Experiments, telemetry bool, proxyHosts func() []*proxyhealth.ProxyHost, staticAdditions map[CSPFetchDirective][]string) func(next http.Handler) http.Handler {
61+
func CSPHeaders(telemetry bool, proxyHosts func() []*proxyhealth.ProxyHost, staticAdditions map[CSPFetchDirective][]string) func(next http.Handler) http.Handler {
6362
return func(next http.Handler) http.Handler {
6463
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
6564
// Content-Security-Policy disables loading certain content types and can prevent XSS injections.
@@ -124,9 +123,7 @@ func CSPHeaders(experiments codersdk.Experiments, telemetry bool, proxyHosts fun
124123
if len(extraConnect) > 0 {
125124
for _, extraHost := range extraConnect {
126125
// Allow embedding the app host.
127-
if experiments.Enabled(codersdk.ExperimentAITasks) {
128-
cspSrcs.Append(CSPDirectiveFrameSrc, extraHost.AppHost)
129-
}
126+
cspSrcs.Append(CSPDirectiveFrameSrc, extraHost.AppHost)
130127
if extraHost.Host == "*" {
131128
// '*' means all
132129
cspSrcs.Append(CSPDirectiveConnectSrc, "*")

coderd/httpmw/csp_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/coder/coder/v2/coderd/httpmw"
1212
"github.com/coder/coder/v2/coderd/proxyhealth"
13-
"github.com/coder/coder/v2/codersdk"
1413
)
1514

1615
func TestCSP(t *testing.T) {
@@ -50,9 +49,7 @@ func TestCSP(t *testing.T) {
5049
r := httptest.NewRequest(http.MethodGet, "/", nil)
5150
rw := httptest.NewRecorder()
5251

53-
httpmw.CSPHeaders(codersdk.Experiments{
54-
codersdk.ExperimentAITasks,
55-
}, false, func() []*proxyhealth.ProxyHost {
52+
httpmw.CSPHeaders(false, func() []*proxyhealth.ProxyHost {
5653
return proxyHosts
5754
}, map[httpmw.CSPFetchDirective][]string{
5855
httpmw.CSPDirectiveMediaSrc: expectedMedia,

codersdk/deployment.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3369,7 +3369,6 @@ const (
33693369
ExperimentWebPush Experiment = "web-push" // Enables web push notifications through the browser.
33703370
ExperimentWorkspacePrebuilds Experiment = "workspace-prebuilds" // Enables the new workspace prebuilds feature.
33713371
ExperimentAgenticChat Experiment = "agentic-chat" // Enables the new agentic AI chat feature.
3372-
ExperimentAITasks Experiment = "ai-tasks" // Enables the new AI tasks feature.
33733372
)
33743373

33753374
// ExperimentsKnown should include all experiments defined above.

docs/reference/api/schemas.md

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

site/src/api/typesGenerated.ts

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

site/src/modules/dashboard/Navbar/NavbarView.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { API } from "api/api";
2-
import { experiments } from "api/queries/experiments";
32
import type * as TypesGen from "api/typesGenerated";
43
import { Button } from "components/Button/Button";
54
import { ExternalImage } from "components/ExternalImage/ExternalImage";
@@ -10,7 +9,6 @@ import { useWebpushNotifications } from "contexts/useWebpushNotifications";
109
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
1110
import { NotificationsInbox } from "modules/notifications/NotificationsInbox/NotificationsInbox";
1211
import type { FC } from "react";
13-
import { useQuery } from "react-query";
1412
import { NavLink, useLocation } from "react-router-dom";
1513
import { cn } from "utils/cn";
1614
import { DeploymentDropdown } from "./DeploymentDropdown";
@@ -145,7 +143,6 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
145143
const location = useLocation();
146144
const agenticChat = useAgenticChat();
147145
const { metadata } = useEmbeddedMetadata();
148-
const experimentsQuery = useQuery(experiments(metadata.experiments));
149146

150147
return (
151148
<nav className={cn("flex items-center gap-4 h-full", className)}>
@@ -178,7 +175,7 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
178175
Chat
179176
</NavLink>
180177
)}
181-
{experimentsQuery.data?.includes("ai-tasks") && (
178+
{metadata.tasksTabVisible.value && (
182179
<NavLink
183180
className={({ isActive }) => {
184181
return cn(linkStyles.default, isActive ? linkStyles.active : "");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy