-
-
Notifications
You must be signed in to change notification settings - Fork 856
Tags listing now uses ClickHouse #2576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a5b805c
WIP using ClickHouse for the tags filter list
matt-aitken 6ec9723
WIP on tags listing
matt-aitken c9f93ad
Webapp: exclude test files when typechecking
matt-aitken 9fbbddc
Tags filtering working with CH
matt-aitken e27077e
Remove unused import
matt-aitken 76b3085
The AI filter should only look at the last past 30d of tags
matt-aitken 7135b71
Do the text query in ClickHouse
matt-aitken 6311840
Deal with encoded characters better
matt-aitken e3d61a8
More encoding fixes
matt-aitken f2caa3f
Fix for wrong items being checked
matt-aitken a33533d
Put applied tags back
matt-aitken e6727c7
Add the env.id to the dependencies array
matt-aitken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
apps/webapp/app/routes/resources.environments.$envId.runs.tags.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { type LoaderFunctionArgs } from "@remix-run/server-runtime"; | ||
import { z } from "zod"; | ||
import { timeFilters } from "~/components/runs/v3/SharedFilters"; | ||
import { $replica } from "~/db.server"; | ||
import { RunTagListPresenter } from "~/presenters/v3/RunTagListPresenter.server"; | ||
import { requireUserId } from "~/services/session.server"; | ||
|
||
const Params = z.object({ | ||
envId: z.string(), | ||
}); | ||
|
||
const SearchParams = z.object({ | ||
name: z.string().optional(), | ||
period: z.preprocess((value) => (value === "all" ? undefined : value), z.string().optional()), | ||
from: z.coerce.number().optional(), | ||
to: z.coerce.number().optional(), | ||
}); | ||
|
||
export async function loader({ request, params }: LoaderFunctionArgs) { | ||
const userId = await requireUserId(request); | ||
const { envId } = Params.parse(params); | ||
|
||
const environment = await $replica.runtimeEnvironment.findFirst({ | ||
select: { | ||
id: true, | ||
projectId: true, | ||
organizationId: true, | ||
}, | ||
where: { id: envId, organization: { members: { some: { userId } } } }, | ||
}); | ||
|
||
if (!environment) { | ||
throw new Response("Not Found", { status: 404 }); | ||
} | ||
|
||
const search = new URL(request.url).searchParams; | ||
|
||
const parsedSearchParams = SearchParams.safeParse({ | ||
name: search.get("name") ?? undefined, | ||
period: search.get("period") ?? undefined, | ||
from: search.get("from") ?? undefined, | ||
to: search.get("to") ?? undefined, | ||
}); | ||
|
||
if (!parsedSearchParams.success) { | ||
throw new Response("Invalid search params", { status: 400 }); | ||
} | ||
|
||
const { period, from, to } = timeFilters({ | ||
period: parsedSearchParams.data.period, | ||
from: parsedSearchParams.data.from, | ||
to: parsedSearchParams.data.to, | ||
}); | ||
|
||
const presenter = new RunTagListPresenter(); | ||
const result = await presenter.call({ | ||
environmentId: environment.id, | ||
projectId: environment.projectId, | ||
organizationId: environment.organizationId, | ||
name: parsedSearchParams.data.name, | ||
period, | ||
from, | ||
to, | ||
}); | ||
return result; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
apps/webapp/app/routes/resources.projects.$projectParam.runs.tags.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.