Commit Graph

64 Commits

Author SHA1 Message Date
Shaun Arman
61cb5db63e fix: harden pr-review workflow and sync versions to 0.2.50
Workflow changes:
- Switch Ollama to https://ollama-ui.tftsr.com/ollama/v1 (OpenAI-compat)
  with OLLAMA_API_KEY secret — removes hardcoded internal IP
- Update endpoint to /chat/completions and response parsing to
  .choices[0].message.content for OpenAI-compat format
- Add concurrency block to prevent racing on same PR number
- Add shell: bash + set -euo pipefail to all steps
- Add TF_TOKEN presence validation before posting review
- Add --max-time 30 and HTTP status check to comment POST curl
- Redact common secret patterns from diff before sending to Ollama
- Add binary diff warning via grep for "^Binary files"
- Add UTC timestamps to Ollama call and review post log lines
- Add always-run Cleanup step to remove /tmp artifacts

Version consistency:
- Sync Cargo.toml and package.json from 0.1.0 to 0.2.50 to match
  tauri.conf.json
2026-04-12 17:40:12 -05:00
Shaun Arman
44584d6302 fix: restore migration 014, bump version to 0.2.50, harden pr-review workflow
- Restore 014_create_ai_providers migration and tests missing due to
  branch diverging from master before PR #34 merged
- Bump version from 0.2.10 to 0.2.50 to match master and avoid regression
- Trim diff input to 20 KB to prevent Ollama token overflow
- Add --max-time 120 to curl to prevent workflow hanging indefinitely
2026-04-12 17:40:12 -05:00
Shaun Arman
1db1b20762 fix: use bash shell and remove bash-only substring expansion in pr-review 2026-04-12 17:39:45 -05:00
Shaun Arman
8f73a7d017 fix: add diagnostics to identify empty Ollama response root cause 2026-04-12 17:39:45 -05:00
Shaun Arman
5e61d4f550 fix: correct Ollama URL, API endpoint, and JSON construction in pr-review workflow
- Fix OLLAMA_URL to point at actual Ollama server (172.0.1.42:11434)
- Fix API path from /v1/chat to /api/chat (Ollama native endpoint)
- Fix response parsing from OpenAI format to Ollama native (.message.content)
- Use jq to safely construct JSON bodies in both Analyze and Post steps
- Add HTTP status code check and response body logging for diagnostics
2026-04-12 17:39:45 -05:00
Shaun Arman
d759486b51 fix: add debugging output for Ollamaresponse 2026-04-12 17:39:45 -05:00
Shaun Arman
63a055d4fe fix: simplified workflow syntax 2026-04-12 17:39:45 -05:00
Shaun Arman
98a0f908d7 fix: use IP addresses for internal services 2026-04-12 17:39:45 -05:00
Shaun Arman
f47dcf69a3 fix: use actions/checkout with token auth and self-hosted runner 2026-04-12 17:39:45 -05:00
Shaun Arman
0b85258e7d fix: use ubuntu container with git installed 2026-04-12 17:39:45 -05:00
Shaun Arman
8cee1c5655 fix: remove actions/checkout to avoid Node.js dependency 2026-04-12 17:39:45 -05:00
Shaun Arman
de59684432 fix: rename GITEA_TOKEN to TF_TOKEN to comply with naming restrictions 2026-04-12 17:39:45 -05:00
Shaun Arman
849d3176fd feat: add automated PR review workflow with Ollama AI 2026-04-12 17:39:45 -05:00
Shaun Arman
c49b8ebfc0 fix: force single test thread for Rust tests to eliminate race conditions
All checks were successful
Test / frontend-typecheck (pull_request) Successful in 1m9s
Test / frontend-tests (pull_request) Successful in 1m8s
Test / rust-fmt-check (pull_request) Successful in 2m49s
Test / rust-clippy (pull_request) Successful in 19m2s
Test / rust-tests (pull_request) Successful in 20m25s
- Add --test-threads=1 flag to all Rust test commands
- Update .gitea/workflows/test.yml to use serial test execution
- Update AGENTS.md to reflect the serial test requirement

Environment variable modifications in Rust tests cause race conditions
when tests run in parallel because std::env is shared global state.
2026-04-09 10:43:45 -05:00
Shaun Arman
f54d1aa6a8 fix(ci): remove explicit docker.sock mount — act_runner mounts it automatically 2026-04-05 21:18:11 -05:00
Shaun Arman
eb8a0531e6 feat(ci): add persistent pre-baked Docker builder images
Add three Dockerfiles under .docker/ and a build-images.yml workflow that
pushes them to the local Gitea container registry (172.0.0.29:3000).

Each image pre-installs all system deps, Node.js 22, and the Rust cross-
compilation target so release builds can skip apt-get entirely:

  trcaa-linux-amd64:rust1.88-node22   — webkit2gtk, gtk3, all Tauri deps
  trcaa-windows-cross:rust1.88-node22 — mingw-w64, nsis, Windows target
  trcaa-linux-arm64:rust1.88-node22   — arm64 multiarch dev libs, Rust 1.88

build-images.yml triggers automatically when .docker/ changes on master
and supports workflow_dispatch for manual/first-time builds.

auto-tag.yml is NOT changed in this commit — switch it to use the new
images in the follow-up PR (after images are pushed to the registry).

One-time server setup required before first use:
  echo '{"insecure-registries":["172.0.0.29:3000"]}' \
    | sudo tee /etc/docker/daemon.json && sudo systemctl restart docker
2026-04-05 21:07:17 -05:00
Shaun Arman
0796297e8c fix(ci): remove all Ollama bundle download steps — use UI download button instead 2026-04-05 20:53:57 -05:00
Shaun Arman
809c4041ea fix(ci): skip Ollama download on macOS build — runner has no access to GitHub binary assets 2026-04-05 20:53:57 -05:00
Shaun Arman
215c0ae218 feat(ui): fix model dropdown, auth prefill, PII persistence, theme toggle, and Ollama bundle
- AIProviders: hide top model row when custom_rest active (dropdown lower in form handles it);
  clear auth header prefill on format switch; rename User ID / CORE ID → Email Address
- Dashboard + Ollama: add border-border/bg-card classes to Refresh buttons for dark-bg contrast
- Security + settingsStore: wire PII toggle state to persisted Zustand store so pattern
  selections survive app restarts
- App: add Sun/Moon theme toggle button to sidebar footer (always visible when collapsed)
- system.rs: add install_ollama_from_bundle command (copies bundled binary to /usr/local/bin)
- auto-tag.yml: add Download Ollama step to all 4 platform build jobs with SHA256 verification
- tauri.conf.json: add resources/ollama/* to bundle resources
- docs: add install_ollama_from_bundle to IPC-Commands wiki

Security: CI download steps verify SHA256 against Ollama's published sha256sums.txt before bundling.
2026-04-05 19:30:41 -05:00
Shaun Arman
73a4c71196 fix(ci): restrict arm64 bundles to deb,rpm — skip AppImage
linuxdeploy-aarch64.AppImage cannot be reliably executed in a cross-
compile context (amd64 host, aarch64 target) even with QEMU binfmt
and APPIMAGE_EXTRACT_AND_RUN. The .deb and .rpm cover all major arm64
Linux distros. An arm64 AppImage can be added later via a native
arm64 build job if required.
2026-04-05 17:02:20 -05:00
Shaun Arman
acccab4235 fix(ci): set APPIMAGE_EXTRACT_AND_RUN=1 for arm64 AppImage bundling
linuxdeploy and its plugins are themselves AppImages. Inside a Docker
container FUSE is unavailable, so they cannot self-mount. Setting
APPIMAGE_EXTRACT_AND_RUN=1 causes them to extract to a temp directory
and run directly, bypassing the FUSE requirement.
2026-04-05 15:56:09 -05:00
Shaun Arman
7ecf66a8cd fix(ci): add make to arm64 host tools for OpenSSL vendored build
openssl-src compiles OpenSSL from source and requires make.
The old Debian image had it; it was not carried over to the
Ubuntu 22.04 host tools list.
2026-04-05 15:09:22 -05:00
Shaun Arman
5546f9f615 fix(ci): use POSIX dot instead of source in arm64 build step
The act runner executes run: blocks with sh (dash), not bash.
'source' is a bash built-in; POSIX sh uses '.' instead.

Co-Authored-By: fix/arm64-source-sh <noreply@local>
2026-04-05 14:41:18 -05:00
Shaun Arman
eb4cf59192 fix(ci): remove GITHUB_PATH append that was breaking arm64 install step
$GITHUB_PATH is unset in this Gitea Actions environment, causing the
echo redirect to fail with a non-zero exit, which killed the Install
dependencies step before the Build step could run.

The append was unnecessary — the Build step already sources
$HOME/.cargo/env as its first line, which puts Cargo's bin dir in PATH.

Co-Authored-By: fix/yaml-heredoc-indent <noreply@local>
2026-04-05 14:04:32 -05:00
Shaun Arman
9188a63305 fix(ci): switch build-linux-arm64 to Ubuntu 22.04 with ports mirror
The Debian single-mirror multiarch approach causes irreconcilable
apt dependency conflicts when both amd64 and arm64 point at the same
repo: the binary-all index is duplicated and certain -dev package pairs
lack Multi-Arch: same. This produces "held broken packages" regardless
of sources.list tweaks.

Ubuntu 22.04 routes arm64 through ports.ubuntu.com/ubuntu-ports, a
separate mirror from archive.ubuntu.com (amd64). This eliminates all
cross-arch index overlaps. Rust is installed via rustup since it is not
pre-installed in the Ubuntu base image. libayatana-appindicator3-dev
is dropped — no tray icon is used by this application.

Co-Authored-By: fix/yaml-heredoc-indent <noreply@local>
2026-04-05 12:51:19 -05:00
Shaun Arman
5ab00a3759 fix(ci): replace heredoc with printf in arm64 install step
YAML block scalars end when a line is found with less indentation than
the scalar's own indent level. The heredoc body was at column 0 while
the rest of the run: block was at column 10, causing Gitea's YAML parser
to reject the entire workflow file with:

  yaml: line 412: could not find expected ':'

This silently invalidated auto-tag.yml on every push to master since the
apt-sources commit was merged, which is why PR#9 and PR#10 merges produced
no action runs.

Fix: replace the heredoc with a printf that stays within the block scalar's
indentation so the YAML remains valid.
2026-04-05 12:11:12 -05:00
Shaun Arman
a04ba02424 fix(ci): add workflow_dispatch and concurrency guard to auto-tag
Gitea 1.22 silently drops a push event for a workflow when a run for that
same workflow+branch is already in progress. This caused the PR#9 merge to
master to produce no auto-tag run.

- workflow_dispatch: allows manual triggering via API when an event is dropped
- concurrency group (cancel-in-progress: false): causes Gitea to queue a second
  run rather than discard it when one is already active
2026-04-05 11:41:21 -05:00
Shaun Arman
15b69e2350 fix(ci): rebuild apt sources with per-arch entries before arm64 cross-compile install
rust:1.88-slim (Debian Bookworm) uses DEB822-format sources which have no arch
restriction. After dpkg --add-architecture arm64, apt tries to resolve deps for
both amd64 and arm64 simultaneously and hits 'held broken packages' conflicts on
shared -dev packages.

Fix: remove debian.sources and write a clean sources.list that pins amd64 repos
to [arch=amd64] and arm64 repos to [arch=arm64]. This gives apt a clear,
non-conflicting view of each architecture's package set.
2026-04-05 11:05:46 -05:00
Shaun Arman
cde4a85cc7 fix(ci): fix arm64 cross-compile, drop cargo install tauri-cli, move wiki-sync
build-linux-arm64: switch from QEMU-emulated linux-arm64 runner to cross-compile
on linux-amd64 using aarch64-linux-gnu toolchain. Removes the uname -m arch guard
that was causing the job to exit immediately (QEMU reports x86_64 as kernel arch),
and fixes the artifact path to the explicit target directory.

All build jobs: replace `cargo install tauri-cli --locked` with `npx tauri build`,
using the pre-compiled @tauri-apps/cli binary from devDependencies. Eliminates the
20-30 min Tauri CLI recompilation on every run.

wiki-sync: move from test.yml to auto-tag.yml. test.yml only fires on pull_request
events so the `if: github.ref == 'refs/heads/master'` guard was never true and the
wiki was never updated. auto-tag.yml triggers on push to master, so wiki sync now
runs on every merge.

Update releaseWorkflowCrossPlatformArtifacts.test.ts to match the new workflow.
2026-04-05 10:33:53 -05:00
Shaun Arman
b1d794765f fix(ci): unblock release jobs and namespace linux artifacts by arch
Drop fragile job-condition gates that were blocking release jobs, and upload linux artifacts with arch-prefixed release asset names so amd64 and arm64 outputs can coexist even when bundle filenames are identical.

Made-with: Cursor
2026-04-04 23:17:12 -05:00
Shaun Arman
7b5f2daaa4 fix(ci): run linux arm release natively and enforce arm artifacts
Avoid cross-compiling GTK/glib on the arm release job by building natively on ARM64 hosts, add an explicit architecture guard, and restrict uploads to arm64/aarch64 artifact filenames so amd64 outputs cannot be published as arm releases.

Made-with: Cursor
2026-04-04 22:46:23 -05:00
Shaun Arman
aaa48d65a2 fix(ci): force explicit linux arm64 target for release artifacts
Build linux arm64 bundles with --target aarch64-unknown-linux-gnu and upload from the target-specific bundle path so arm64 releases cannot accidentally publish amd64 artifacts.

Made-with: Cursor
2026-04-04 22:15:02 -05:00
Shaun Arman
e20228da6f refactor(ci): remove standalone release workflow
Delete .gitea/workflows/release.yml and keep release orchestration in auto-tag.yml only, then update related workflow tests and docs to reference the unified pipeline.

Made-with: Cursor
2026-04-04 21:34:15 -05:00
Shaun Arman
2d2c62e4f5 fix(ci): repair auto-tag workflow yaml so jobs trigger
Replace heredoc-based Python error logging with single-line python invocations to keep YAML block indentation valid, restoring Gitea's ability to parse and trigger auto-tag plus downstream release build jobs.

Made-with: Cursor
2026-04-04 21:28:52 -05:00
Shaun Arman
b69c132a0a fix(ci): run post-tag release builds without job-output gating
Remove auto-tag job output dependencies and conditional gates so release build jobs always run after autotag completes, resolving skipped fan-out caused by output/if evaluation issues in Gitea Actions.

Made-with: Cursor
2026-04-04 21:24:24 -05:00
Shaun Arman
a6b4ed789c fix(ci): use stable auto-tag job outputs for release fanout
Rename the auto-tag job id to a non-hyphenated identifier and update needs/output references so dependent release jobs evaluate conditions correctly and reliably run after tagging.

Made-with: Cursor
2026-04-04 21:21:35 -05:00
Shaun Arman
93ead1362f fix(ci): guarantee release jobs run after auto-tag
Run linux/windows/macos/arm release build and upload jobs in the auto-tag workflow with needs:auto-tag outputs so release execution no longer depends on a second tag-triggered workflow dispatch path.

Made-with: Cursor
2026-04-04 21:19:13 -05:00
Shaun Arman
48041acc8c fix(ci): trigger release workflow from auto-tag pushes
Switch auto-tag to create and push tags via git instead of the tag API so Gitea emits a real tag push event that reliably starts release builds. Document the trigger behavior and add a workflow regression test.

Made-with: Cursor
2026-04-04 21:14:41 -05:00
Shaun Arman
2d35e2a2c1 fix(ci): harden release asset uploads for reruns
Make all release upload steps fail fast when expected artifacts are missing, replace existing same-name assets before uploading, and print HTTP/body details on upload failures so Linux/Windows publishing issues are diagnosable and reruns remain deterministic.

Made-with: Cursor
2026-04-04 21:09:03 -05:00
Shaun Arman
c3fd83f330 fix(ci): make release artifacts reliable across platforms
Override OpenSSL vendoring for the windows-gnu release build so cross-compiles no longer fail on pkg-config lookup, and fail fast when Linux release jobs produce no artifacts so incomplete releases are detected immediately.

Made-with: Cursor
2026-04-04 19:53:40 -05:00
Shaun Arman
4e7a5b64ba ci: run test workflow only on pull requests
Avoid duplicate Test workflow executions by removing push triggers and keeping pull_request validation as the single gate. Also fix remaining clippy format string violations in integration modules to keep rust-clippy passing.

Made-with: Cursor
2026-04-04 18:52:13 -05:00
Shaun Arman
8e7356e62d ci: skip test workflow pushes on master
Avoid rerunning the full test workflow on direct master pushes while keeping pull request validation intact. Update the CI/CD wiki page to reflect the new trigger behavior.

Made-with: Cursor
2026-04-04 16:45:55 -05:00
Shaun Arman
b426f56149 fix: resolve macOS bundle path after app rename
Find the generated .app bundle dynamically in release CI so macOS packaging no longer depends on the legacy TFTSR.app name. Add a unit test to prevent regressions by asserting the old hardcoded path is not reintroduced.

Made-with: Cursor
2026-04-04 16:28:01 -05:00
Shaun Arman
64492c743b fix: ARM64 build uses native target instead of cross-compile
Some checks failed
Release / build-macos-arm64 (push) Successful in 5m14s
Release / build-linux-arm64 (push) Has been cancelled
Release / build-linux-amd64 (push) Has been cancelled
Release / build-windows-amd64 (push) Has been cancelled
The ARM64 build was failing because explicitly specifying
--target aarch64-unknown-linux-gnu on an ARM64 runner was
triggering cross-compilation logic.

Changes:
- Remove rustup target add (not needed for native build)
- Remove --target flag from cargo tauri build
- Update artifact path: target/aarch64-unknown-linux-gnu/release/bundle
  → target/release/bundle

This allows the native ARM64 toolchain to build without
attempting cross-compilation and avoids the pkg-config
cross-compilation configuration requirement.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-04 09:59:56 -05:00
Shaun Arman
1d40dfb15b fix: use Wiki secret for authenticated wiki sync (v0.2.8)
Some checks failed
Release / build-macos-arm64 (push) Has been cancelled
Release / build-windows-amd64 (push) Has been cancelled
Release / build-linux-arm64 (push) Has been cancelled
Release / build-linux-amd64 (push) Has been cancelled
- Updated wiki-sync job to use secrets.Wiki for authentication
- Simplified clone/push logic with token-based auth
- Wiki push will now succeed with proper credentials
- Bumped version to 0.2.8

The workflow now uses the 'Wiki' secret created in Gitea Actions
to authenticate wiki repository pushes. This fixes the authentication
issue that was preventing automatic wiki synchronization.
2026-04-03 16:47:32 -05:00
Shaun Arman
94b486b801 feat: add automatic wiki sync to CI workflow (v0.2.7)
- Added wiki-sync job to .gitea/workflows/test.yml
- Runs only on pushes to master branch
- Automatically copies docs/wiki/*.md to Gogs wiki repository
- Supports token-based authentication via secrets.GITHUB_TOKEN
- Handles wiki initialization if repository doesn't exist
- Bumped version to 0.2.7

Wiki sync will now automatically update the Gogs wiki at
https://gogs.tftsr.com/sarman/tftsr-devops_investigation/wiki
whenever docs/wiki/ files are modified on master.
2026-04-03 16:42:37 -05:00
Shaun Arman
952cf4fe27 fix: install jq in Linux/Windows build containers
Some checks failed
Test / rust-tests (push) Waiting to run
Test / frontend-typecheck (push) Waiting to run
Test / frontend-tests (push) Waiting to run
Auto Tag / auto-tag (push) Successful in 5s
Test / rust-fmt-check (push) Successful in 2m3s
Test / rust-clippy (push) Has been cancelled
Release / build-windows-amd64 (push) Has been cancelled
Release / build-linux-arm64 (push) Has been cancelled
Release / build-macos-arm64 (push) Failing after 5m24s
Release / build-linux-amd64 (push) Has been cancelled
Add jq package to apt-get install commands for:
- build-linux-amd64
- build-windows-amd64
- build-linux-arm64

This fixes upload failures where jq was not available to parse
the release API JSON response.

Tested:
- YAML syntax validation ✓
- jq command parsing ✓
- Error handling logic ✓

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-03 12:16:36 -05:00
Shaun Arman
905487be5b fix: improve release artifact upload error handling
Some checks failed
Auto Tag / auto-tag (push) Successful in 4s
Test / rust-fmt-check (push) Successful in 2m9s
Release / build-macos-arm64 (push) Successful in 5m41s
Test / rust-clippy (push) Successful in 17m30s
Release / build-linux-arm64 (push) Failing after 21m46s
Test / rust-tests (push) Successful in 12m47s
Test / frontend-typecheck (push) Successful in 1m27s
Test / frontend-tests (push) Successful in 1m29s
Release / build-linux-amd64 (push) Failing after 20m6s
Release / build-windows-amd64 (push) Failing after 14m15s
- Use jq instead of grep for JSON parsing
- Add explicit error checking for RELEASE_ID
- Add informative logging for debugging upload failures
- Fail fast if release ID cannot be retrieved

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-03 11:01:02 -05:00
Shaun Arman
d6117034ee fix: ARM64 build native compilation instead of cross-compilation
Some checks failed
Auto Tag / auto-tag (push) Successful in 6s
Test / rust-fmt-check (push) Successful in 2m8s
Test / rust-tests (push) Has been cancelled
Test / rust-clippy (push) Has been cancelled
Test / frontend-typecheck (push) Has been cancelled
Test / frontend-tests (push) Has been cancelled
Release / build-windows-amd64 (push) Has been cancelled
Release / build-linux-arm64 (push) Has been cancelled
Release / build-macos-arm64 (push) Has been cancelled
Release / build-linux-amd64 (push) Has been cancelled
The linux-arm64 job runs on a native ARM64 runner, so cross-compilation
setup is not needed. Removed dpkg --add-architecture, cross-compiler,
and architecture-specific package suffixes. This fixes "held broken
packages" error during dependency installation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-03 10:05:55 -05:00
Shaun Arman
b356eef44f fix: remove Woodpecker CI and fix Gitea Actions ARM64 build
Some checks failed
Test / frontend-typecheck (push) Waiting to run
Test / frontend-tests (push) Waiting to run
Auto Tag / auto-tag (push) Successful in 5s
Test / rust-fmt-check (push) Successful in 2m11s
Release / build-linux-arm64 (push) Failing after 2m15s
Release / build-macos-arm64 (push) Successful in 5m25s
Test / rust-clippy (push) Successful in 12m10s
Test / rust-tests (push) Has been cancelled
Release / build-windows-amd64 (push) Has been cancelled
Release / build-linux-amd64 (push) Has been cancelled
- Remove .woodpecker/ directory entirely (not in use)
- Fix ARM64 build in .gitea/workflows/release.yml:
  - Remove --platform flag (Docker version too old)
  - Use cross-compilation instead (dpkg multiarch + gcc-aarch64-linux-gnu)
  - Set PKG_CONFIG environment variables for ARM64 libraries
  - Set CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER

This matches the working cross-compilation approach from commit d489338b.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-04-03 08:10:29 -05:00