Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
393aca3
flag rules backend model
aecsocket Oct 28, 2026
4bed0f5
project flag routes
aecsocket Oct 29, 2026
6873520
add rule editor frontend and rhai eval
aecsocket Oct 29, 2026
2f29c7e
wip: project flags can scan files for patterns
aecsocket Oct 29, 2026
799d773
persist scan patterns for rules
aecsocket Oct 29, 2026
600a114
more flag context
aecsocket Oct 29, 2026
8b68be6
listing and starting runs
aecsocket Nov 2, 2026
8907718
wip: consumer task for reading scan reqs
aecsocket Nov 2, 2026
660fc91
persist flag run results in db
aecsocket Nov 2, 2026
6b81dc1
run rule result persistence
aecsocket Nov 3, 2026
2676af9
route to fetch project flags
aecsocket Nov 3, 2026
35a2845
Merge branch 'main' into boris/dev-1493-flag-rules-backend
aecsocket Nov 4, 2026
05ef0eb
list runs/delete runs but keep active flags
aecsocket Nov 5, 2026
5d4347d
Merge branch 'main' into boris/dev-1493-flag-rules-backend
aecsocket Nov 5, 2026
c97cefb
allow kafka scans to not have a run_id
aecsocket Nov 5, 2026
7961dc1
sqlx prepare
aecsocket Nov 5, 2026
6d34d54
track how many scan jobs we have + how many kafka consumers
aecsocket Nov 7, 2026
62ee613
sqlx prepare
aecsocket Nov 7, 2026
927d974
default auto_resolve on add_gallery_images issue targets
clrxbl Nov 7, 2026
f1e1c63
Merge branch 'main' into boris/dev-1493-flag-rules-backend
aecsocket Nov 10, 2026
6411b67
scan size limits with env var
aecsocket Nov 10, 2026
cff217f
strip out run application
aecsocket Nov 10, 2026
6048e29
use a pending jobs ledger
aecsocket Nov 10, 2026
0b873b4
prepr
aecsocket Nov 10, 2026
811116b
disable source map uploads
aecsocket Nov 10, 2026
77b3634
address comments
aecsocket Nov 10, 2026
575db70
rules which don't depend on file scans won't fail if file scanning fails
aecsocket Nov 11, 2026
50b7ede
cap length of buffered rule logs
aecsocket Nov 11, 2026
e2bf442
impl retries for committing kafka
aecsocket Nov 11, 2026
0130674
Merge branch 'main' into boris/dev-1493-flag-rules-backend
aecsocket Nov 11, 2026
7349a03
fix ci
aecsocket Nov 11, 2026
8c762f0
Merge of #8152
mergify[bot] Nov 11, 2026
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
6 changes: 6 additions & 0 deletions .github/workflows/frontend-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ jobs:
BUILD_ENV: ${{ steps.meta.outputs.env }}
PREVIEW: ${{ inputs.preview && 'true' || 'false' }}

- name: Disable server source map uploads for previews
if: ${{ inputs.preview }}
working-directory: ./apps/frontend
run: |
sed -i 's/"upload_source_maps": true/"upload_source_maps": false/g' wrangler.jsonc
- name: Install Wrangler CLI
uses: cloudflare/wrangler-action@953926a2e2182532811c01a25e53647d93bf07c0 # v4.1.3
with:
Expand Down
93 changes: 92 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ redis = "1.7.1"
regex = "1.13.1"
reqwest = { version = "0.13.5", default-features = false, features = ["form", "query"] }
rgb = "0.8.53"
rhai = "1.27.0"
rust_decimal = { version = "1.43.0", features = ["serde-with-float", "serde-with-str"] }
rust_iso3166 = "0.2.0"
rust-s3 = { version = "0.38.0", default-features = false, features = [
Expand Down Expand Up @@ -264,6 +265,7 @@ unicode-segmentation = "1.13.3"
url = "2.5.8"
urlencoding = "2.1.3"
utoipa = { version = "6.0.0", features = ["actix_extras", "chrono", "decimal"] }
utoipa-actix-web = "0.2.0"
uuid = "1.28.0"
validator = "0.21.0"
webauthn-rs = "0.5.5"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<template>
<section class="flex flex-col gap-3" aria-label="File scan patterns">
<div class="flex flex-wrap items-center justify-between gap-2">
<h3 class="m-0 text-base font-semibold text-contrast">File scan patterns</h3>
<Button :disabled="disabled" @click="patterns.push({ name: '', pattern: '' })">
<PlusIcon />
Add pattern
</Button>
</div>
<Table :columns="columns" :data="rows" row-key="index" :row-below-visible="hasError">
<template #cell-name="{ row }">
<Input
:id="`file-pattern-name-${row.index}`"
v-model="row.entry.name"
:disabled="disabled"
aria-label="Pattern name"
placeholder="pattern_name"
autocomplete="off"
@keydown.enter.prevent
/>
</template>
<template #cell-regex="{ row }">
<Input
:id="`file-pattern-regex-${row.index}`"
v-model="row.entry.pattern"
:disabled="disabled"
aria-label="Regex pattern"
placeholder="(?i)forbidden text"
input-class="font-mono"
autocomplete="off"
:spellcheck="false"
@keydown.enter.prevent
/>
</template>
<template #header-actions>
<span class="sr-only">Remove</span>
</template>
<template #cell-actions="{ row }">
<IconButton
:disabled="disabled"
:circular="false"
:label="`Remove pattern ${row.index + 1}`"
@click="patterns.splice(row.index, 1)"
>
<TrashIcon />
</IconButton>
</template>
<template #row-below="{ row }">
<p role="alert" class="m-0 px-4 pb-2 text-sm text-red">{{ errors[row.index] }}</p>
</template>
<template #empty-state><span /></template>
</Table>
</section>
</template>

<script setup lang="ts">
import { PlusIcon, TrashIcon } from '@modrinth/assets'
import { Button, IconButton, Input, Table, type TableColumn } from '@modrinth/ui'
import { computed } from 'vue'
export interface FileScanPattern {
name: string
pattern: string
}
const patterns = defineModel<FileScanPattern[]>({ required: true })
const props = defineProps<{ disabled?: boolean; errors: string[] }>()
const rows = computed(() => patterns.value.map((entry, index) => ({ entry, index })))
const columns: TableColumn<'name' | 'regex' | 'actions'>[] = [
{ key: 'name', label: 'Name', width: '35%', cellClass: 'pr-2 py-2' },
{ key: 'regex', label: 'Regex', cellClass: 'pr-2 py-2' },
{ key: 'actions', width: '3.5rem', align: 'right' },
]
function hasError(row: { index: number }) {
return Boolean(props.errors[row.index])
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<template>
<div>
<div class="flex flex-wrap items-center gap-4">
<slot name="reference" />
<button
type="button"
class="flex cursor-pointer items-center gap-1 border-0 bg-transparent p-0 text-sm font-semibold text-contrast"
:aria-expanded="isOpen"
:aria-controls="schemaId"
@click="isOpen = !isOpen"
>
<ChevronRightIcon class="size-4 transition-transform" :class="{ 'rotate-90': isOpen }" />
Input schema
</button>
</div>
<div
v-if="isOpen"
:id="schemaId"
class="mt-3 rounded-xl border border-solid border-surface-5 bg-surface-2 p-3"
>
<div v-if="isPending" role="status" class="flex items-center gap-2 text-secondary">
<LoaderCircleIcon class="size-4 animate-spin" />
Loading schema…
</div>
<div v-else-if="isError" role="alert" class="flex flex-col items-start gap-2">
<p class="m-0 text-sm text-red">Could not load the input schema: {{ error?.message }}</p>
<Button :disabled="isFetching" @click="refetch()">Try again</Button>
</div>
<div v-else class="max-h-96 overflow-auto whitespace-pre-wrap break-words font-mono text-sm">
{{ example }}
</div>
</div>
</div>
</template>

<script setup lang="ts">
import { ChevronRightIcon, LoaderCircleIcon } from '@modrinth/assets'
import { Button, injectModrinthClient } from '@modrinth/ui'
import { useQuery } from '@tanstack/vue-query'
import { computed, ref, useId } from 'vue'
const client = injectModrinthClient()
const isOpen = ref(false)
const schemaId = useId()
const { data, isPending, isError, error, isFetching, refetch } = useQuery({
queryKey: ['moderation', 'project-flag', 'input-example'],
queryFn: () => client.labrinth.project_flags_internal.getRuleSchema(),
enabled: isOpen,
staleTime: 60_000,
})
const example = computed(() => (data.value ? JSON.stringify(data.value, null, 2) : ''))
</script>
Loading
Loading