Copilot/add copilot cli hooks#74
Open
atulmgupta wants to merge 3 commits into
Open
Conversation
Co-authored-by: atulmgupta <12709019+atulmgupta@users.noreply.github.com>
Co-authored-by: atulmgupta <12709019+atulmgupta@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces repository-scoped GitHub Copilot CLI/cloud-agent hooks to enforce TeslaSyncβs working agreement during automated editing sessions, along with a small workflow adjustment and a set of related frontend/doc touch-ups.
Changes:
- Add Copilot hook configuration + Node scripts for
preToolUsecommand guarding,postToolUseguideline auditing, andsessionStartcontext injection. - Update the Copilot setup workflow runner default for non-manual runs.
- Misc. System Status UI/test and changelog edits (likely formatting/content alignment).
Reviewed changes
Copilot reviewed 8 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/features/system/components/status/UpdateAvailableCallout.tsx | System Status update-available callout component (needs i18n). |
| web/src/features/system/components/status/TeslaAuthCard.tsx | Tesla auth status card (needs i18n). |
| web/src/features/system/components/status/StatusPageSkeleton.tsx | Status page skeleton loader (a11y label should be localized). |
| web/src/features/system/components/status/tests/UpdateAvailableCallout.test.tsx | Tests for update callout. |
| web/src/features/system/components/status/tests/TeslaAuthCard.test.tsx | Tests for Tesla auth card. |
| web/src/features/system/components/status/tests/BackupActionsCard.test.tsx | Tests for backup actions card. |
| web/src/features/system/components/status/tests/AnomalyInlineRow.test.tsx | Tests for anomaly inline row. |
| web/src/features/admin/components/devtools/FleetApiSection.tsx | Devtools Fleet API section; contains a stray CR character in an import line. |
| web/src/components/layout/Layout.tsx | Minor import formatting touch-up. |
| web/src/components/data-display/PlaybackControls.tsx | Minor comment formatting touch-up. |
| CHANGELOG.md | Changelog edits; one entry conflicts with actual callout link behavior. |
| .github/workflows/copilot-setup-steps.yml | Runner default adjusted to ubuntu-latest for non-manual runs. |
| .github/hooks/scripts/session-context.js | Hook script that injects working-agreement context at session start. |
| .github/hooks/scripts/guidelines-audit.js | Hook script that audits edited files for prohibited patterns (advisory). |
| .github/hooks/scripts/command-guard.js | Hook script that blocks forbidden/destructive shell commands. |
| .github/hooks/README.md | Documentation for hooks (contains an incorrect link path). |
| .github/hooks/20-session-context.json | Hook wiring for sessionStart. |
| .github/hooks/10-guidelines-audit.json | Hook wiring for postToolUse. |
| .github/hooks/00-command-guard.json | Hook wiring for preToolUse. |
Comment on lines
+37
to
+41
| <p className="text-sm font-semibold text-[var(--text-primary)]"> | ||
| Update available{latest ? ` β v${latest}` : ''} | ||
| </p> | ||
| <p className="text-xs text-[var(--text-secondary)] mt-0.5"> | ||
| {current ? `You're running v${current}. ` : ''}Review the release notes before upgrading your deployment. |
Comment on lines
+42
to
+48
| const TONE: Record<Severity, { bar: string; icon: string; Icon: typeof ShieldCheck; label: string; badge: 'success' | 'warning' | 'danger' | 'neutral' }> = { | ||
| ok: { bar: 'bg-green-500/40', icon: 'text-green-400', Icon: ShieldCheck, label: 'Connected', badge: 'success' }, | ||
| warn: { bar: 'bg-amber-500/50', icon: 'text-amber-300', Icon: ShieldAlert, label: 'Expires soon', badge: 'warning' }, | ||
| expired: { bar: 'bg-red-500/60', icon: 'text-red-400', Icon: ShieldX, label: 'Token expired', badge: 'danger' }, | ||
| disconnected: { bar: 'bg-red-500/60', icon: 'text-red-400', Icon: ShieldX, label: 'Not connected', badge: 'danger' }, | ||
| unknown: { bar: 'bg-zinc-500/40', icon: 'text-zinc-400', Icon: ShieldAlert, label: 'Unknown', badge: 'neutral' }, | ||
| } |
Comment on lines
+12
to
+27
| import { Skeleton } from '@/components/feedback/Skeleton' | ||
| import { GlassPanel } from '@/components/ui' | ||
|
|
||
| function SkeletonRow({ height = 44 }: { height?: number }) { | ||
| return <Skeleton height={height} className="w-full" /> | ||
| } | ||
|
|
||
| export function StatusPageSkeleton() { | ||
| return ( | ||
| <div | ||
| className="space-y-5 max-w-3xl mx-auto" | ||
| role="status" | ||
| aria-busy="true" | ||
| aria-label="Loading system status" | ||
| data-testid="status-page-skeleton" | ||
| > |
Comment on lines
+18
to
19
| import { ICON_COLOR_MAP, ONBOARDING_STEPS, TELEMETRY_FIELDS } from './constants' | ||
| import { Icons } from '@/lib/icons'; |
Comment on lines
+7
to
+10
| The hook commands use the cross-platform `command` field (Node.js), so they work on | ||
| Linux, macOS, Windows (PowerShell), and the cloud-agent Linux sandbox. Node 20 is already | ||
| provisioned by [`.github/copilot-setup-steps.yml`](../copilot-setup-steps.yml). | ||
|
|
Comment on lines
+80
to
+83
| - **Tesla auth dedicated card** β Promotes account auth from a single health row to a fuller card with token-expiry countdown (healthy / expiring within 7 days / expired / disconnected) and a primary "Re-authenticate" CTA | ||
| - **Inline anomaly row** β New `<AnomalyInlineRow>` surfaces the most recent anomaly detected for the primary vehicle as a Health row (links to `/anomaly-detection`); renders nothing when there are no anomalies in the last 24h | ||
| - **Update-available callout** β Prominent in-page callout above the chip bar when `/system/update-check` reports a new release; links to `/changelog` (distinct from the global `<NewVersionBanner>` for client bundle reloads) | ||
| - **Run quick backup** β New "Run quick backup now" button inside the Backups accordion (mutation via `POST /backup/quick`); disables-while-pending, surfaces success/failure via toasts, and invalidates `backup-runs` queries on settle |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Closes #
Type of Change
Checklist
Screenshots (if applicable)