Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"worktree:setup": "node scripts/worktree.mjs setup",
"cloudflare:token": "node scripts/refresh-cloudflare-tunnel-token.mjs",
"prepare": "simple-git-hooks",
"lint": "pnpm file-length:check && pnpm oxlint-rules:check && pnpm migration-metadata:check && pnpm test-architecture:check && pnpm dashboard-style:check && pnpm --filter @sentry/junior tool-annotations:check && pnpm --filter @sentry/junior tool-key-casing:check && pnpm --filter @sentry/junior tool-error-classification:check && pnpm --filter @sentry/junior lint && pnpm --filter @sentry/junior-memory lint && pnpm --filter @sentry/junior-github lint && pnpm --filter @sentry/junior-google lint && pnpm --filter @sentry/junior-linear lint && pnpm --filter @sentry/junior-sentry lint && pnpm --filter @sentry/junior-vercel lint && pnpm --filter @sentry/junior-dashboard lint && pnpm ast-grep:lint && pnpm package:lint",
"lint": "pnpm file-length:check && pnpm oxlint-rules:check && pnpm migration-metadata:check && pnpm test-architecture:check && pnpm dashboard-style:check && pnpm --filter @sentry/junior tool-annotations:check && pnpm --filter @sentry/junior tool-key-casing:check && pnpm --filter @sentry/junior tool-error-classification:check && pnpm --filter @sentry/junior lint && pnpm --filter @sentry/junior-plugin-api lint && pnpm --filter @sentry/junior-memory lint && pnpm --filter @sentry/junior-github lint && pnpm --filter @sentry/junior-google lint && pnpm --filter @sentry/junior-linear lint && pnpm --filter @sentry/junior-sentry lint && pnpm --filter @sentry/junior-vercel lint && pnpm --filter @sentry/junior-dashboard lint && pnpm ast-grep:lint && pnpm package:lint",
"lint:fix": "pnpm --filter @sentry/junior lint:fix",
"file-length:check": "node --test scripts/check-file-length.test.mjs && node scripts/check-file-length.mjs",
"migration-metadata:check": "node --test scripts/check-drizzle-migrations.test.mjs && node scripts/check-drizzle-migrations.mjs",
Expand Down
5 changes: 5 additions & 0 deletions packages/junior-dashboard/.oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"name": "anti-slop",
"specifier": "../../tools/oxlint/anti-slop/index.ts"
},
{
"name": "junior",
"specifier": "../../tools/oxlint/junior/index.ts"
},
{
"name": "display-text",
"specifier": "./oxlint/display-text.ts"
Expand All @@ -27,6 +31,7 @@
"tools/oxlint/anti-slop/**"
],
"rules": {
"junior/zod-namespace-import": "error",
"react/rules-of-hooks": "error",
"react/exhaustive-deps": "error",
"react/preserve-manual-memoization": "off",
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-dashboard/src/api/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import * as z from "zod";

const dashboardSessionUserSchema = z
.object({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useQuery } from "@tanstack/react-query";
import { createContext, useContext } from "react";
import { z } from "zod";
import * as z from "zod";

import { fetchDashboardJson } from "../http";
import { conversationSideReadQueryKey } from "./queries";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import * as z from "zod";

import type { TranscriptViewTurnContext } from "../types";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type UseQueryResult,
} from "@tanstack/react-query";
import { KeyRound } from "lucide-react";
import type { z } from "zod";
import type * as z from "zod";
import {
disconnectServiceAccountResponseSchema,
serviceAccountListSchema,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery } from "@tanstack/react-query";
import { z } from "zod";
import * as z from "zod";

import { fetchDashboardJson } from "../../http";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery } from "@tanstack/react-query";
import { z } from "zod";
import * as z from "zod";

import { fetchDashboardJson } from "../../http";
import type { PluginUserPageRecord } from "../user/pluginUserPageData";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { Plug } from "lucide-react";
import type { z } from "zod";
import type * as z from "zod";
import {
connectionListSchema,
disconnectConnectionResponseSchema,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import * as z from "zod";
import type {
ConversationReportEvent,
ReviewItemPayload,
Expand Down
8 changes: 8 additions & 0 deletions packages/junior-dashboard/tsup.client.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { fileURLToPath } from "node:url";
import { defineConfig } from "tsup";

export default defineConfig({
Expand All @@ -19,6 +20,13 @@ export default defineConfig({
esbuildOptions(options) {
options.entryNames = "[name]-[hash]";
options.chunkNames = "chunks/[name]-[hash]";
// pnpm injects a separate copy of the plugin API into @sentry/junior.
// Resolve every import to one copy, so the browser loads it once.
options.alias = {
"@sentry/junior-plugin-api": fileURLToPath(
import.meta.resolve("@sentry/junior-plugin-api"),
),
};
},
minify: true,
define: {
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-evals/src/fixture/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Call results read through Junior's reporting API, the way the dashboard
* reads a Conversation. Tests never read stored rows directly.
*/
import type { z } from "zod";
import type * as z from "zod";
import {
conversationDetailReportSchema,
conversationPendingMessagesReportSchema,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
text,
timestamp,
} from "drizzle-orm/pg-core";
import { z } from "zod";
import * as z from "zod";

export const githubPullRequestStateSchema = z.enum([
"closed_unmerged",
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/events/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
eventMatchFieldsSchema,
type SubscribableResource,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { gitHubRepoDataSchema, gitHubRepoMatchFields } from "./scope.js";

export const GITHUB_RELEASE_EVENTS = ["release.published"] as const;
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/events/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
eventMatchFieldsSchema,
type EventMatchFields,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";

// The plugin lowercases every identifier, so scope values in event data are
// lowercase too. A saved identifier can then become exact filters.
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/github-status.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PluginCache } from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";

const GITHUB_STATUS_INCIDENTS_URL =
"https://www.githubstatus.com/api/v2/incidents.json";
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/issue-outcomes/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { and, eq, lte, sql } from "drizzle-orm";
import { z } from "zod";
import * as z from "zod";
import type { GitHubDb } from "../db/database.js";
import {
githubIssueStateReasonSchema,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/object-facts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ObjectAnnotation } from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";

const person = z.object({ login: z.string() });
const responseSchema = z.object({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import * as z from "zod";
import type { GitHubPullRequestCommitComposition } from "../db/schema.js";
import { botLoginFromEmail, isBotLogin } from "../webhooks/ownership.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/pull-request-outcomes/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { and, eq, lte, ne, sql } from "drizzle-orm";
import { z } from "zod";
import * as z from "zod";
import type { GitHubDb } from "../db/database.js";
import {
type GitHubPullRequestCommitComposition,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/clone-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type PluginToolOutput,
type PluginWorkspaceToolContext,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { isReservedSandboxDirectory } from "../sandbox-paths.js";

const inputSchema = z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
PluginToolInputError,
pluginToolOutputSchema,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import {
githubApi,
githubErrorMessage,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/create-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from "@sentry/junior-plugin-api";
import { Type, type Static } from "@sinclair/typebox";
import { Value } from "@sinclair/typebox/value";
import { z } from "zod";
import * as z from "zod";
import { appendGitHubFooter } from "./footer.js";
import { gitHubIssueSubscribable } from "../events/issue.js";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/create-pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from "@sentry/junior-plugin-api";
import { Type, type Static } from "@sinclair/typebox";
import { Value } from "@sinclair/typebox/value";
import { z } from "zod";
import * as z from "zod";
import { appendGitHubFooter } from "./footer.js";
import {
gitHubPullRequestCreateWatch,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/get-deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type PluginToolOutput,
type SubscribableResource,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { gitHubDeploymentSourceSubscribable } from "../events/deployment.js";
import { githubApi, parseRepo, repoPath } from "../tool-support/github-api.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/get-pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type PluginToolOutput,
type SubscribableResource,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { subscribableResourceSchema } from "@sentry/junior-plugin-api";
import { gitHubPullRequestSubscribable } from "../events/pull-request.js";
import { githubApi, parseRepo, repoPath } from "../tool-support/github-api.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/get-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
type PluginToolOutput,
type SubscribableResource,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { gitHubReleaseSourceSubscribable } from "../events/release.js";
import { githubApi, parseRepo, repoPath } from "../tool-support/github-api.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/get-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
type PluginToolOutput,
type SubscribableResource,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { gitHubRepositorySubscribable } from "../events/repository.js";
import { githubApi, parseRepo, repoPath } from "../tool-support/github-api.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/get-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
pluginToolOutputSchema,
type PluginToolOutput,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { loadGitHubStatusIncidents } from "../github-status.js";

const RECENT_INCIDENT_MS = 24 * 60 * 60 * 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
pluginToolOutputSchema,
type PluginToolOutput,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { botUserIdFromEmail } from "../webhooks/ownership.js";
import {
githubApi,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/stack-pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* chain of base branches.
*/
import type { ToolRegistrationHookContext } from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { githubApi, repoPath } from "../tool-support/github-api.js";

/** Longest chain of base branches to walk down to the trunk. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
PluginToolInputError,
pluginToolOutputSchema,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import {
githubApi,
githubErrorMessage,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/update-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
type PluginToolOutput,
type SubscribableResource,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { gitHubIssueSubscribable } from "../events/issue.js";
import {
appendGitHubRequesterAttribution,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
PluginToolInputError,
pluginToolOutputSchema,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { botUserIdFromEmail } from "../webhooks/ownership.js";
import {
githubApi,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/tools/update-pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
type PluginToolOutput,
type SubscribableResource,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { subscribableResourceSchema } from "@sentry/junior-plugin-api";
import { gitHubPullRequestSubscribable } from "../events/pull-request.js";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/webhooks/check-suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* GitHub check suite events.
*/
import type { EventInput } from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import {
githubRequest,
isRecord,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/webhooks/events.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EventInput } from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { gitHubDeploymentSourceResource } from "../events/deployment.js";
import { gitHubIssueResource } from "../events/issue.js";
import { gitHubPullRequestResource } from "../events/pull-request.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/webhooks/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
EventInput,
EventPublisher,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import type { GitHubDb } from "../db/database.js";
import type { GitHubPullRequestCommitComposition } from "../db/schema.js";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* call GitHub directly. Other plugin code must use host egress.
*/
import type { PluginCache } from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import {
githubRequest,
issueInstallationToken,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/webhooks/issue-outcome.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import * as z from "zod";
import { githubIssueStateReasonSchema } from "../db/schema.js";
import type {
GitHubIssueConversationsInput,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/webhooks/merge-conflict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
EventPublisher,
PluginLogger,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import { gitHubPullRequestResource } from "../events/pull-request.js";
import { gitHubRepoDataSchema } from "../events/scope.js";
import { pullRequestTargets } from "./event-targets.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
EventPublisher,
PluginLogger,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import type { GitHubDb } from "../db/database.js";
import { gitHubRepoDataSchema } from "../events/scope.js";
import { listGitHubPullRequestOpeners } from "../pull-request-requesters/store.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import * as z from "zod";
import {
GITHUB_SESSION_FOOTER_START,
githubConversationIds,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/webhooks/pull-request-people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
EventPublisher,
PluginLogger,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";

/** Pull request outcomes that the people involved need to hear about. */
const PEOPLE_EVENTS = new Set([
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-github/src/webhooks/pull-request-ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
PluginConversationReviewItems,
PluginLogger,
} from "@sentry/junior-plugin-api";
import { z } from "zod";
import * as z from "zod";
import type { GitHubDb } from "../db/database.js";
import {
claimGitHubPullRequestReadySync,
Expand Down
2 changes: 1 addition & 1 deletion packages/junior-google/src/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* it. Slack never carries the sign-in link, the authorization code, or tokens.
*/
import { createHash, randomBytes } from "node:crypto";
import { z } from "zod";
import * as z from "zod";
import {
GOOGLE_API_SCOPES,
GOOGLE_IDENTITY_SCOPES,
Expand Down
Loading
Loading