Skip to content

pa-tui/pa-cli: the first-run login frames render the TS login dialog (frame-parity r3) #846

pa-tui/pa-cli: the first-run login frames render the TS login dialog (frame-parity r3)

pa-tui/pa-cli: the first-run login frames render the TS login dialog (frame-parity r3) #846

Workflow file for this run

# Non-blocking, PR-only guidance for files growing past 500 lines.
name: codebase-health
on:
pull_request:
permissions:
contents: read
jobs:
loc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Report growing Rust files over 500 lines
continue-on-error: true
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
git -C "$GITHUB_WORKSPACE" fetch --no-tags --depth=1 origin "$BASE_SHA"
python3 - <<'PY'
import os
import subprocess
from pathlib import Path
root = Path(os.environ['GITHUB_WORKSPACE'])
base = os.environ['BASE_SHA']
git = ['git', '-C', str(root)]
# --name-status -z -M keeps rename/copy sources, so a rename counts
# from the source path, not from zero.
out = subprocess.check_output(git + ['diff', '--name-status', '-z', '-M',
'--diff-filter=ACMR', base, 'HEAD', '--', '*.rs'])
tokens = [os.fsdecode(t) for t in out.split(b'\0')]
changed = []
i = 0
while i < len(tokens):
status = tokens[i]
if not status:
i += 1
continue
if status[0] in ('R', 'C'):
changed.append((tokens[i + 2], tokens[i + 1]))
i += 3
else:
changed.append((tokens[i + 1], None))
i += 2
findings = []
for path, source in changed:
if path == 'crates/pa-ai/src/models_generated.rs':
continue
before_path = source or path
old = subprocess.run(git + ['show', f'{base}:{before_path}'],
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL).stdout
before = len(old.splitlines())
# both counts come from git blobs, not the working tree: bounded
# reads, immune to symlinks in the checkout
after = len(subprocess.check_output(
git + ['show', f'HEAD:{path}']).splitlines())
if after > 500 and after > before:
findings.append((path, before, after))
# Annotations are capped at 10 per job by GitHub; the log carries the
# full list either way.
for path, before, after in findings[:10]:
print(f'::warning file={path},line=1,title=File size guidance::'
f'{before} -> {after} lines; consider splitting this module')
if len(findings) > 10:
print('remaining findings beyond the annotation cap:')
for path, before, after in findings[10:]:
print(f' {before} -> {after} lines: {path}')
print(f'{len(findings)} changed Rust file(s) grew beyond 500 lines (guidance only).')
PY