Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@
"packages/codemod-cli3to4/tests/**"
],
"rules": {
"no-unused-vars": "off",
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrors": "none",
"ignoreRestSiblings": true
}
],
"typescript/return-await": ["error", "always"],
"typescript/no-floating-promises": [
"error",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/script/generate-skill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* docs/public/.well-known/skills/index.json
*/

import { existsSync, mkdirSync, rmSync } from "node:fs";
import { mkdirSync, rmSync } from "node:fs";
import { access, readFile, writeFile } from "node:fs/promises";
import { routes } from "../src/app.js";
import {
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/commands/agent-conversation/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { ORG_TARGET } from "../../lib/completion-target.js";
import {
buildTranscriptResult,
formatTranscriptResult,
type TranscriptResult,
} from "../../lib/formatters/conversation.js";
import { CommandOutput } from "../../lib/formatters/output.js";
import { ValidationError } from "../../lib/errors.js";
Expand Down
5 changes: 1 addition & 4 deletions packages/cli/src/commands/auth/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ import {
setActiveAccount,
} from "../../lib/db/auth.js";
import { AuthError, ResolutionError } from "../../lib/errors.js";
import {
type AccountSwitchResult,
formatAccountSwitch,
} from "../../lib/formatters/accounts.js";
import { formatAccountSwitch } from "../../lib/formatters/accounts.js";
import { CommandOutput } from "../../lib/formatters/output.js";
import { parseLoginUrl } from "./login.js";

Expand Down
3 changes: 0 additions & 3 deletions packages/cli/src/commands/dashboard/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ import { applySentryUrlContext } from "../../lib/sentry-url-parser.js";
import { buildDashboardUrl } from "../../lib/sentry-web-urls.js";
import { setOrgProjectContext } from "../../lib/telemetry.js";
import { DashboardCreateOutputSchema } from "../../generated/output-schemas/dashboard.js";
import type { DashboardCreateOutput } from "../../output-schemas/dashboard.js";
import { withDashboardErrors } from "./resolve.js";

type CreateFlags = {
readonly json: boolean;
readonly fields?: string[];
};

type CreateResult = DashboardCreateOutput;

/** `dashboard create`'s positionals, parsed: the title and the target. */
type CreateInput = {
readonly title: string;
Expand Down
5 changes: 1 addition & 4 deletions packages/cli/src/commands/dashboard/widget/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ import { formatWidgetDeleted } from "../../../lib/formatters/human.js";
import { CommandOutput } from "../../../lib/formatters/output.js";
import { buildDeleteCommand } from "../../../lib/mutate-command.js";
import { buildDashboardUrl } from "../../../lib/sentry-web-urls.js";
import {
type DashboardWidgetDeleteOutput,
prepareDashboardForUpdate,
} from "../../../types/dashboard.js";
import { prepareDashboardForUpdate } from "../../../types/dashboard.js";
import { type DashboardArguments, dashboardArguments } from "../arguments.js";
import { withDashboardErrors, resolveWidgetIndex } from "../resolve.js";
import { DashboardWidgetDeleteOutputSchema } from "../../../generated/output-schemas/dashboard.js";
Expand Down
5 changes: 1 addition & 4 deletions packages/cli/src/commands/replay/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import { buildCommand } from "../../lib/command.js";
import { parseFilePath } from "../../lib/completion-target.js";
import { ApiError, ResolutionError } from "../../lib/errors.js";
import { CommandOutput } from "../../lib/formatters/output.js";
import {
formatReplayDownloadResult,
type ReplayDownloadData,
} from "../../lib/formatters/replay.js";
import { formatReplayDownloadResult } from "../../lib/formatters/replay.js";
import {
applyFreshFlag,
FRESH_ALIASES,
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/api/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { resolveOrgRegion } from "../region.js";
import { getSdkClientConfig } from "../sentry-sdk-client.js";

import {
API_MAX_PER_PAGE,
getOrgSdkConfig,
MAX_PAGINATION_PAGES,
type PaginatedResponse,
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/api/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { applyCustomHeaders } from "../custom-headers.js";
import { ApiError, ValidationError } from "../errors.js";

import {
API_MAX_PER_PAGE,
getOrgSdkConfig,
ORG_FANOUT_CONCURRENCY,
type PaginatedResponse,
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/api/traces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { getSdkClientConfig } from "../sentry-sdk-client.js";
import { isAllDigits } from "../utils.js";

import {
API_MAX_PER_PAGE,
apiRequestToRegion,
getOrgSdkConfig,
type PaginatedResponse,
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/formatters/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { tableCell, text } from "@sentry/toolkit-core/markdown";
import type {
DetailedSentryLog,
SentryLog,
TraceItemAttribute,
} from "../../types/index.js";
import { stringifyUnknown } from "../errors.js";
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/formatters/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* treats them as zero-width for column sizing.
*/

import { tableCell } from "@sentry/toolkit-core/markdown";
import type { Writer } from "../../types/index.js";
import {
isPlainOutput,
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/types/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
nullable,
nullish,
number,
object,
optional,
pipe,
record,
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/types/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import {
number,
object,
optional,
partial,
pipe,
record,
string,
Expand Down
3 changes: 0 additions & 3 deletions packages/cli/test/lib/sentry-urls.property.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ const traceIdArb = stringMatching(/^[a-f0-9]{32}$/);
/** Valid dashboard IDs (numeric strings) */
const dashboardIdArb = stringMatching(/^[1-9][0-9]{0,8}$/);

/** Valid project IDs (numeric strings, same shape as other Sentry IDs) */
const projectIdArb = stringMatching(/^[1-9][0-9]{0,8}$/);

/** Common Sentry regions */
const sentryRegionArb = constantFrom("us", "de", "eu", "staging");

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/script/zod-v3-stub-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Zod 3 module reaches the output.
*/

import { mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { createRequire } from "node:module";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
Expand Down
12 changes: 6 additions & 6 deletions packages/logger/bench/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ async function setUp(name) {
logfmtReporter,
sentryReporter,
} = await import(ENTRY);
let sink;
const stream = { write: (chunk) => (sink = chunk) };
const send = (message, attributes) => (sink = attributes ?? message);
let _sink;
const stream = { write: (chunk) => (_sink = chunk) };
const send = (message, attributes) => (_sink = attributes ?? message);
const sentryLogger = {
trace: send,
debug: send,
Expand All @@ -72,15 +72,15 @@ async function setUp(name) {

switch (name) {
case "noop": {
const noop = (...args) => (sink = args);
const noop = (...args) => (_sink = args);
return () => noop("Logged in as %s", "jane");
}
case "debug": {
const log = logger({ log: (record) => (sink = record) });
const log = logger({ log: (record) => (_sink = record) });
return () => log.debug("Logged in as %s", "jane");
}
case "noopReporter": {
const log = logger({ log: (record) => (sink = record) });
const log = logger({ log: (record) => (_sink = record) });
return () => log.info("Logged in as %s", "jane");
}
case "formatWrite":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import type {
const TextPart = memo(function TextPart({
text,
role,
messageId,
isStreaming,
messageData,
onSlashCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ function getTokenCount(content: ToolMessage[]): number {
}, 0);
}

export function ToolInvocation({
tool,
messageId,
index,
}: ToolInvocationProps) {
export function ToolInvocation({ tool }: ToolInvocationProps) {
const [isExpanded, setIsExpanded] = useState(false);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import { VSCodeInstructions } from "./instructions/vscode";
import { WarpInstructions } from "./instructions/warp";
import { ZedInstructions } from "./instructions/zed";

const mcpServerName = import.meta.env.DEV ? "sentry-dev" : "sentry";

export default function RemoteSetup() {
const endpoint = new URL("/mcp", window.location.href).href;
return (
<>
<Prose className="mb-6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import CodeSnippet from "../ui/code-snippet";
import { Prose } from "../ui/prose";
import InstallTabs, { Tab } from "./install-tabs";

const mcpServerName = import.meta.env.DEV ? "sentry-dev" : "sentry";
const orderedSkills = [...skillDefinitions]
.filter((skill) => !skill.deprecated)
.sort((a, b) => a.order - b.order);
Expand Down
11 changes: 2 additions & 9 deletions packages/mcp-cloudflare/src/server/lib/approval-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,8 @@ export async function renderApprovalDialog(
request: Request,
options: ApprovalDialogOptions,
): Promise<Response> {
const {
client,
server,
scope,
redirectUri,
state,
cookieSecret,
defaultSkills,
} = options;
const { client, scope, redirectUri, state, cookieSecret, defaultSkills } =
options;
const defaultSkillIds =
defaultSkills === undefined
? new Set(APPROVABLE_SKILLS.map((skill) => skill.id))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("verifyConstraintsAccess", () => {
{ accessToken: undefined, label: "undefined" },
];

for (const { accessToken, label } of testCases) {
for (const { accessToken } of testCases) {
const result = await verifyConstraintsAccess(
{ organizationSlug: "org", projectSlug: null },
{ accessToken, sentryHost: host },
Expand Down
4 changes: 2 additions & 2 deletions packages/mcp-cloudflare/src/server/oauth/authorize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const mockOAuthProvider = {
};

// Create test app with mocked environment
function createTestApp(env: Partial<Env> = {}) {
function createTestApp() {
const app = new Hono<{ Bindings: Env }>();
app.route("/oauth", oauthRoute);
return app;
Expand Down Expand Up @@ -100,7 +100,7 @@ describe("oauth authorize routes", () => {
SENTRY_CLIENT_SECRET: "test-client-secret",
SENTRY_HOST: "sentry.io",
};
app = createTestApp(testEnv);
app = createTestApp();
});

describe("GET /oauth/authorize", () => {
Expand Down
1 change: 0 additions & 1 deletion packages/mcp-cloudflare/src/server/oauth/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ vi.mock("@sentry/cloudflare", () => ({

import {
OAUTH_GRANT_AGE_BUCKET_ATTRIBUTE,
OAUTH_GRANT_SHAPE_ATTRIBUTE,
OAUTH_REFRESH_OUTCOME_ATTRIBUTE,
OAUTH_UPSTREAM_EXPIRES_IN_BUCKET_ATTRIBUTE,
} from "./telemetry";
Expand Down
4 changes: 0 additions & 4 deletions packages/mcp-cloudflare/src/server/routes/chat-oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ const ClientRegistrationResponseSchema = z.object({
client_id_issued_at: z.number().optional(),
});

type ClientRegistrationResponse = z.infer<
typeof ClientRegistrationResponseSchema
>;

// Get or register OAuth client with the MCP server
export async function getOrRegisterChatClient(
env: Env,
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-cloudflare/src/server/routes/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function syncOpenRouterEnvFromBindings(
async function refreshTokenIfNeeded(
c: Context<{ Bindings: Env }>,
): Promise<{ token: string; authData: AuthData } | null> {
const { getCookie, setCookie, deleteCookie } = await import("hono/cookie");
const { getCookie, deleteCookie } = await import("hono/cookie");

const authDataCookie = getCookie(c, "sentry_auth_data");
if (!authDataCookie) {
Expand Down
4 changes: 2 additions & 2 deletions packages/mcp-cloudflare/src/server/routes/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ function jsonResponse(json: unknown, status = 200) {

export default new Hono()
// Index: advertise available endpoints
.get("/", (c) =>
.get("/", () =>
jsonResponse({
endpoints: ["/.mcp/tools.json"],
}),
)
// Tools
.get("/tools.json", (c) => jsonResponse(TOOL_DEFINITIONS));
.get("/tools.json", () => jsonResponse(TOOL_DEFINITIONS));
5 changes: 0 additions & 5 deletions packages/mcp-core/scripts/generate-otel-namespaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ const OtelYamlFileSchema = z.object({
groups: z.array(OtelGroupSchema),
});

// TypeScript types inferred from Zod schemas
type OtelAttribute = z.infer<typeof OtelAttributeSchema>;
type OtelGroup = z.infer<typeof OtelGroupSchema>;
type OtelYamlFile = z.infer<typeof OtelYamlFileSchema>;

interface JsonAttribute {
description: string;
type: string;
Expand Down
6 changes: 0 additions & 6 deletions packages/mcp-core/src/api-client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,15 @@ import {
} from "@sentry/api";
import { operations } from "@sentry/api/operations";
import {
ApiError,
ApiNotFoundError,
apiPath,
ApiRateLimitError,
type ApiTarget,
ApiValidationError,
applyStatsMixinTimeParams,
applyTimeParams,
createApiClientCore,
createApiError,
createApiTransport,
createIdempotentOperationMatcher,
parseStatsPeriod,
readJsonResponse,
type RetryPolicy,
selectIdempotentWrites,
Expand Down Expand Up @@ -99,7 +95,6 @@ import {
isProfilesDataset,
normalizeEventsDataset,
} from "../utils/events-datasets";
import { isNumericId } from "../utils/slug-validation";
import {
type DashboardUrlOptions,
getAIConversationsUrl as getAIConversationsUrlUtil,
Expand Down Expand Up @@ -1021,7 +1016,6 @@ export class SentryApiService {
start,
end,
aggregateFunctions,
groupByFields,
} = params;

const urlParams = new URLSearchParams();
Expand Down
Loading
Loading