feat(cli): replace --since with --until for 'older than' filtering in /oncall audit

This commit is contained in:
Sehoon Shon
2026-01-28 02:27:02 -05:00
parent e048e678b9
commit 9287a3dc63
2 changed files with 9 additions and 9 deletions

View File

@@ -62,14 +62,14 @@ export const oncallCommand: SlashCommand = {
} }
let limit = 100; let limit = 100;
let since: string | undefined; let until: string | undefined;
if (args && args.trim().length > 0) { if (args && args.trim().length > 0) {
const argArray = args.trim().split(/\s+/); const argArray = args.trim().split(/\s+/);
for (let i = 0; i < argArray.length; i++) { for (let i = 0; i < argArray.length; i++) {
const arg = argArray[i]; const arg = argArray[i];
if (arg === '--since' && i + 1 < argArray.length) { if (arg === '--until' && i + 1 < argArray.length) {
since = argArray[i + 1]; until = argArray[i + 1];
i++; i++;
} else { } else {
const parsedLimit = parseInt(arg, 10); const parsedLimit = parseInt(arg, 10);
@@ -86,7 +86,7 @@ export const oncallCommand: SlashCommand = {
<TriageIssues <TriageIssues
config={config} config={config}
initialLimit={limit} initialLimit={limit}
since={since} until={until}
onExit={() => context.ui.removeComponent()} onExit={() => context.ui.removeComponent()}
/> />
), ),

View File

@@ -62,12 +62,12 @@ export const TriageIssues = ({
config, config,
onExit, onExit,
initialLimit = 100, initialLimit = 100,
since, until,
}: { }: {
config: Config; config: Config;
onExit: () => void; onExit: () => void;
initialLimit?: number; initialLimit?: number;
since?: string; until?: string;
}) => { }) => {
const [state, setState] = useState<TriageState>({ const [state, setState] = useState<TriageState>({
status: 'loading', status: 'loading',
@@ -115,8 +115,8 @@ export const TriageIssues = ({
'-type:Task,Workstream,Feature,Epic', '-type:Task,Workstream,Feature,Epic',
'-label:workstream-rollup', '-label:workstream-rollup',
]; ];
if (since) { if (until) {
searchParts.push(`created:>=${since}`); searchParts.push(`created:<=${until}`);
} }
const { stdout } = await spawnAsync('gh', [ const { stdout } = await spawnAsync('gh', [
@@ -152,7 +152,7 @@ export const TriageIssues = ({
})); }));
} }
}, },
[since], [until],
); );
useEffect(() => { useEffect(() => {