Compare commits
No commits in common. "ca56b583c545703e562a7b80e098f36e5ead47f2" and "f38ca7e2fc9135cbbab8154f06acb8bde4b1bc7f" have entirely different histories.
ca56b583c5
...
f38ca7e2fc
@ -37,11 +37,6 @@ jobs:
|
|||||||
key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-linux-amd64-
|
${{ runner.os }}-cargo-linux-amd64-
|
||||||
- name: Install dependencies
|
|
||||||
run: npm install --legacy-peer-deps
|
|
||||||
- name: Update version from Git
|
|
||||||
run: node scripts/update-version.mjs
|
|
||||||
- run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml
|
|
||||||
- run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
|
- run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
|
||||||
|
|
||||||
rust-clippy:
|
rust-clippy:
|
||||||
@ -77,7 +72,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-linux-amd64-
|
${{ runner.os }}-cargo-linux-amd64-
|
||||||
- run: cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings
|
- run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml -- -D warnings
|
||||||
|
|
||||||
rust-tests:
|
rust-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -112,7 +107,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-linux-amd64-
|
${{ runner.os }}-cargo-linux-amd64-
|
||||||
- run: cargo test --manifest-path src-tauri/Cargo.toml -- --test-threads=1
|
- run: cargo test --locked --manifest-path src-tauri/Cargo.toml -- --test-threads=1
|
||||||
|
|
||||||
frontend-typecheck:
|
frontend-typecheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "tftsr",
|
"name": "tftsr",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.2.62",
|
"version": "0.2.50",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
"version:update": "node scripts/update-version.mjs",
|
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
"test": "vitest",
|
"test": "vitest",
|
||||||
|
|||||||
@ -1,111 +0,0 @@
|
|||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
import { execSync } from 'child_process';
|
|
||||||
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
||||||
import { resolve, dirname } from 'path';
|
|
||||||
import { fileURLToPath } from 'url';
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
|
||||||
const __dirname = dirname(__filename);
|
|
||||||
const projectRoot = resolve(__dirname, '..');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate version is semver-compliant (X.Y.Z)
|
|
||||||
*/
|
|
||||||
function isValidSemver(version) {
|
|
||||||
return /^[0-9]+\.[0-9]+\.[0-9]+$/.test(version);
|
|
||||||
}
|
|
||||||
|
|
||||||
function validateGitRepo(root) {
|
|
||||||
if (!existsSync(resolve(root, '.git'))) {
|
|
||||||
throw new Error(`Not a Git repository: ${root}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getVersionFromGit() {
|
|
||||||
validateGitRepo(projectRoot);
|
|
||||||
try {
|
|
||||||
const output = execSync('git describe --tags --abbrev=0', {
|
|
||||||
encoding: 'utf-8',
|
|
||||||
cwd: projectRoot,
|
|
||||||
shell: false
|
|
||||||
});
|
|
||||||
let version = output.trim();
|
|
||||||
|
|
||||||
// Remove v prefix
|
|
||||||
version = version.replace(/^v/, '');
|
|
||||||
|
|
||||||
// Validate it's a valid semver
|
|
||||||
if (!isValidSemver(version)) {
|
|
||||||
const pkgJsonVersion = getFallbackVersion();
|
|
||||||
console.warn(`Invalid version format "${version}" from git describe, using package.json fallback: ${pkgJsonVersion}`);
|
|
||||||
return pkgJsonVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
return version;
|
|
||||||
} catch (e) {
|
|
||||||
const pkgJsonVersion = getFallbackVersion();
|
|
||||||
console.warn(`Failed to get version from Git tags, using package.json fallback: ${pkgJsonVersion}`);
|
|
||||||
return pkgJsonVersion;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFallbackVersion() {
|
|
||||||
const pkgPath = resolve(projectRoot, 'package.json');
|
|
||||||
if (!existsSync(pkgPath)) {
|
|
||||||
return '0.2.50';
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const content = readFileSync(pkgPath, 'utf-8');
|
|
||||||
const json = JSON.parse(content);
|
|
||||||
return json.version || '0.2.50';
|
|
||||||
} catch {
|
|
||||||
return '0.2.50';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updatePackageJson(version) {
|
|
||||||
const fullPath = resolve(projectRoot, 'package.json');
|
|
||||||
if (!existsSync(fullPath)) {
|
|
||||||
throw new Error(`File not found: ${fullPath}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const content = readFileSync(fullPath, 'utf-8');
|
|
||||||
const json = JSON.parse(content);
|
|
||||||
json.version = version;
|
|
||||||
|
|
||||||
// Write with 2-space indentation
|
|
||||||
writeFileSync(fullPath, JSON.stringify(json, null, 2) + '\n', 'utf-8');
|
|
||||||
console.log(`✓ Updated package.json to ${version}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateTOML(path, version) {
|
|
||||||
const fullPath = resolve(projectRoot, path);
|
|
||||||
if (!existsSync(fullPath)) {
|
|
||||||
throw new Error(`File not found: ${fullPath}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const content = readFileSync(fullPath, 'utf-8');
|
|
||||||
const lines = content.split('\n');
|
|
||||||
const output = [];
|
|
||||||
|
|
||||||
for (const line of lines) {
|
|
||||||
if (line.match(/^\s*version\s*=\s*"/)) {
|
|
||||||
output.push(`version = "${version}"`);
|
|
||||||
} else {
|
|
||||||
output.push(line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
writeFileSync(fullPath, output.join('\n') + '\n', 'utf-8');
|
|
||||||
console.log(`✓ Updated ${path} to ${version}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const version = getVersionFromGit();
|
|
||||||
console.log(`Setting version to: ${version}`);
|
|
||||||
|
|
||||||
updatePackageJson(version);
|
|
||||||
updateTOML('src-tauri/Cargo.toml', version);
|
|
||||||
updateTOML('src-tauri/tauri.conf.json', version);
|
|
||||||
|
|
||||||
console.log(`✓ All version fields updated to ${version}`);
|
|
||||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@ -6139,7 +6139,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "trcaa"
|
name = "trcaa"
|
||||||
version = "0.2.62"
|
version = "0.2.50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "trcaa"
|
name = "trcaa"
|
||||||
version = "0.2.62"
|
version = "0.2.50"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
@ -53,7 +53,3 @@ mockito = "1.2"
|
|||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
strip = true
|
strip = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,30 +1,3 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let version = get_version_from_git();
|
|
||||||
|
|
||||||
println!("cargo:rustc-env=APP_VERSION={version}");
|
|
||||||
println!("cargo:rerun-if-changed=.git/refs/heads/master");
|
|
||||||
println!("cargo:rerun-if-changed=.git/refs/tags");
|
|
||||||
|
|
||||||
tauri_build::build()
|
tauri_build::build()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_version_from_git() -> String {
|
|
||||||
if let Ok(output) = std::process::Command::new("git")
|
|
||||||
.arg("describe")
|
|
||||||
.arg("--tags")
|
|
||||||
.arg("--abbrev=0")
|
|
||||||
.output()
|
|
||||||
{
|
|
||||||
if output.status.success() {
|
|
||||||
let version = String::from_utf8_lossy(&output.stdout)
|
|
||||||
.trim()
|
|
||||||
.trim_start_matches('v')
|
|
||||||
.to_string();
|
|
||||||
if !version.is_empty() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
"0.2.50".to_string()
|
|
||||||
}
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ use crate::ollama::{
|
|||||||
OllamaStatus,
|
OllamaStatus,
|
||||||
};
|
};
|
||||||
use crate::state::{AppSettings, AppState, ProviderConfig};
|
use crate::state::{AppSettings, AppState, ProviderConfig};
|
||||||
use std::env;
|
|
||||||
|
|
||||||
// --- Ollama commands ---
|
// --- Ollama commands ---
|
||||||
|
|
||||||
@ -276,11 +275,3 @@ pub async fn delete_ai_provider(
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the application version from build-time environment
|
|
||||||
#[tauri::command]
|
|
||||||
pub async fn get_app_version() -> Result<String, String> {
|
|
||||||
env::var("APP_VERSION")
|
|
||||||
.or_else(|_| env::var("CARGO_PKG_VERSION"))
|
|
||||||
.map_err(|e| format!("Failed to get version: {e}"))
|
|
||||||
}
|
|
||||||
|
|||||||
@ -120,7 +120,6 @@ pub fn run() {
|
|||||||
commands::system::get_settings,
|
commands::system::get_settings,
|
||||||
commands::system::update_settings,
|
commands::system::update_settings,
|
||||||
commands::system::get_audit_log,
|
commands::system::get_audit_log,
|
||||||
commands::system::get_app_version,
|
|
||||||
])
|
])
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("Error running Troubleshooting and RCA Assistant application");
|
.expect("Error running Troubleshooting and RCA Assistant application");
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
"frontendDist": "../dist",
|
"frontendDist": "../dist",
|
||||||
"devUrl": "http://localhost:1420",
|
"devUrl": "http://localhost:1420",
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
"beforeBuildCommand": "npm run version:update && npm run build"
|
"beforeBuildCommand": "npm run build"
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"security": {
|
"security": {
|
||||||
@ -41,7 +41,4 @@
|
|||||||
"shortDescription": "Troubleshooting and RCA Assistant",
|
"shortDescription": "Troubleshooting and RCA Assistant",
|
||||||
"longDescription": "Structured AI-backed assistant for IT troubleshooting, 5-whys root cause analysis, and post-mortem documentation with offline Ollama support."
|
"longDescription": "Structured AI-backed assistant for IT troubleshooting, 5-whys root cause analysis, and post-mortem documentation with offline Ollama support."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
|
import { getVersion } from "@tauri-apps/api/app";
|
||||||
import { Routes, Route, NavLink, useLocation } from "react-router-dom";
|
import { Routes, Route, NavLink, useLocation } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
Home,
|
Home,
|
||||||
@ -14,7 +15,7 @@ import {
|
|||||||
Moon,
|
Moon,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { useSettingsStore } from "@/stores/settingsStore";
|
import { useSettingsStore } from "@/stores/settingsStore";
|
||||||
import { getAppVersionCmd, loadAiProvidersCmd, testProviderConnectionCmd } from "@/lib/tauriCommands";
|
import { loadAiProvidersCmd, testProviderConnectionCmd } from "@/lib/tauriCommands";
|
||||||
|
|
||||||
import Dashboard from "@/pages/Dashboard";
|
import Dashboard from "@/pages/Dashboard";
|
||||||
import NewIssue from "@/pages/NewIssue";
|
import NewIssue from "@/pages/NewIssue";
|
||||||
@ -49,7 +50,7 @@ export default function App() {
|
|||||||
void useLocation();
|
void useLocation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getAppVersionCmd().then(setAppVersion).catch(() => {});
|
getVersion().then(setAppVersion).catch(() => {});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Load providers and auto-test active provider on startup
|
// Load providers and auto-test active provider on startup
|
||||||
|
|||||||
@ -486,8 +486,3 @@ export const loadAiProvidersCmd = () =>
|
|||||||
|
|
||||||
export const deleteAiProviderCmd = (name: string) =>
|
export const deleteAiProviderCmd = (name: string) =>
|
||||||
invoke<void>("delete_ai_provider", { name });
|
invoke<void>("delete_ai_provider", { name });
|
||||||
|
|
||||||
// ─── System / Version ─────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
export const getAppVersionCmd = () =>
|
|
||||||
invoke<string>("get_app_version");
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user