Skip to content

Commit b0594ca

Browse files
committed
versioning, changelogs
1 parent 152a74f commit b0594ca

6 files changed

Lines changed: 219 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!-- version-type: patch -->
2+
# common
3+
4+
## ✨ Features
5+
6+
### Git Status Tracking
7+
8+
Extended `ServiceGitStatus` with fields for detecting out-of-sync clones without persisting state to the database:
9+
10+
- `upstreamStatus: 'present' | 'gone' | 'unknown'` — whether `origin/<currentBranch>` still exists on the remote
11+
- `worktreeStatus: 'clean' | 'dirty' | 'conflicts' | 'unknown'` — derived from `git status --porcelain`
12+
- `commitsBehind` — number of commits the local branch is behind `origin/<currentBranch>`
13+
- `lastPullError` — last pull error message on an already-cloned repo; cleared on successful pull
14+
- `warningsDismissed` — per-session flags for user-dismissed inline warnings (`upstreamGone`, `stale`)
15+
16+
### Stale Pipeline States
17+
18+
Added `'stale'` to both `InstallStatus` and `BuildStatus` so the UI can flag installs/builds that were invalidated by an external git change (branch switch or external pull performed outside the app).
19+
20+
### State History Events
21+
22+
Added new `ServiceStateEvent` values for external-origin transitions and a new trigger source:
23+
24+
- `external-branch-changed`, `external-pull-detected` — emitted when `.git/HEAD` or `refs/heads/*` change outside the app
25+
- `upstream-gone` — emitted when a fetch-with-prune reveals the checked-out branch was removed from origin
26+
- `marked-stale` — emitted when install/build are downgraded to `stale`
27+
- New `TriggerSource: 'system'`
28+
29+
### Patch Runs
30+
31+
Added `PatchRun` model to record one-shot upgrade operations with idempotent re-runs. Each run tracks `patchId`, status (`running` / `success` / `failed` / `orphaned`), timestamps, and an append-only log of timestamped messages for audit purposes.
32+
33+
### New REST Endpoints
34+
35+
Added two POST endpoints on `ServicesApi`:
36+
37+
- `/services/:id/delete-branch` — deletes a local branch, optionally switching to `switchTo` (or the remote default) when the branch is currently checked out
38+
- `/services/:id/dismiss-warning` — dismisses an inline warning (`'upstream-gone' | 'stale'`) for the service until the app is restarted
39+
40+
## 🧪 Tests
41+
42+
- Added `merge-service-view` tests covering the new `upstreamStatus`, `lastPullError`, and `warningsDismissed` fields
43+
44+
## ⬆️ Dependencies
45+
46+
- Bumped `@furystack/rest` from `^8.1.5` to `^9.0.0`
47+
- Bumped `vitest` from `^4.1.4` to `^4.1.5`
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!-- version-type: patch -->
2+
# frontend
3+
4+
## ✨ Features
5+
6+
### Inline Service Warnings
7+
8+
Added `ServiceWarnings` component that renders row-level actionable warnings inside the service table:
9+
10+
- **`upstream-gone`** — branch was removed from origin; offers "Delete local" (switches to the default branch then deletes the local branch) and "Dismiss" (session-scoped)
11+
- **`stale`** — install/build fell out of sync with the current working tree after an external git change; offers "Rebuild" (runs the update pipeline) and "Dismiss"
12+
13+
### Branch Selector Enhancements
14+
15+
`BranchSelector` now consumes the full clone lifecycle via `cloneStatus` (instead of a boolean `isCloned`), visualizes `upstream-gone` with a warning-colored border and a `title` tooltip, and surfaces `lastPullError` in the tooltip so a failed pull is discoverable without leaving the table.
16+
17+
### Unified Logs View
18+
19+
The dedicated `/logs` and `/logs/:processUid` routes have been replaced by the existing Service Detail `Logs` tab with a `?processUid=` query parameter. The tab auto-selects when a process UID is present so "View process logs" from History stays inside the detail page.
20+
21+
## ♻️ Refactoring
22+
23+
### `@furystack/shades` v14 Routing Migration
24+
25+
Migrated all routing call sites to the new `NestedRoute` API:
26+
27+
- `StackCraftNestedRouteLink` now takes `path` instead of `href`
28+
- `stackCraftNavigate` takes a single options object `{ path, params, query?, hash? }` instead of `(path, params)` positional arguments
29+
- Added `stackCraftReplace` (created from the new `createNestedReplace` factory) for hash-only navigation without history entries
30+
- `/stacks/:stackName/services/:serviceId` now declares its allowed `hash` values (`'overview' | 'logs' | 'history' | 'files' | 'configuration'`) and validates the `processUid` query parameter
31+
32+
### Service Detail Tab Sync
33+
34+
`ServiceDetail` now subscribes to `locationService.onLocationHashChanged` via `useObservable` (instead of reading a one-shot value into `useState`), so the active tab always matches the URL hash. Tab clicks call `stackCraftReplace` with the new hash, keeping browser history clean. When a `processUid` query is present the tab defaults to `'logs'`.
35+
36+
## 🗑️ Deprecated
37+
38+
- Removed the standalone `ServiceLogs` page (`/stacks/:stackName/services/:serviceId/logs` and `/logs/:processUid`). Link callers should point at `/stacks/:stackName/services/:serviceId` with `hash: 'logs'` and `query: { processUid }`.
39+
40+
## ⬆️ Dependencies
41+
42+
- Bumped `@furystack/shades` from `^13.2.2` to `^14.0.0`
43+
- Bumped `@furystack/shades-common-components` from `^15.2.0` to `^16.0.0`
44+
- Bumped `@furystack/shades-mfe` from `^3.0.6` to `^4.0.0`
45+
- Bumped `@furystack/rest-client-fetch` from `^8.1.7` to `^8.1.8`
46+
- Bumped `vite` from `^8.0.9` to `^8.0.10`
47+
- Bumped `vitest` from `^4.1.4` to `^4.1.5`
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!-- version-type: patch -->
2+
# monaco-mfe
3+
4+
## ⬆️ Dependencies
5+
6+
- Bumped `vite` from `^8.0.9` to `^8.0.10`
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<!-- version-type: patch -->
2+
# service
3+
4+
## ✨ Features
5+
6+
### Patcher Subsystem
7+
8+
Added a patcher that runs one-shot upgrade operations on startup with idempotency and crash recovery:
9+
10+
- `runPatch()` — skips patches that already have a `success` entry in `PatchRun`; retries previously failed or orphaned ones; transitions the run from `running` to `success`/`failed` while capturing timestamped log messages
11+
- `checkForOrphanedPatch()` — transitions any `PatchRun` rows stuck in `running` (from a previous crash) to `orphaned` so the patch is retried on the next startup
12+
- `PatchRunStore` — typed data store for `PatchRun` entries with auto-generated ids
13+
- `setupPatcher()` — wires the patcher into app startup and executes the registered patch list
14+
15+
First shipped patch: `0001-add-stale-status-enum` — migrates legacy `ServiceStatus` rows so the new `'stale'` values are valid for `installStatus` and `buildStatus`.
16+
17+
### External Git Change Detection
18+
19+
`GitHeadWatcher` now uses `chokidar` to watch both `.git/HEAD` and `.git/refs/heads/` for each cloned service (with recursive depth and `awaitWriteFinish` debouncing) and emits a typed `externalChange` event that distinguishes `branch-switched` (HEAD ref changed) from `pull-detected` (branch ref advanced):
20+
21+
```typescript
22+
type GitHeadChangeEvent = {
23+
serviceId: string
24+
previousBranch?: string
25+
currentBranch?: string
26+
previousSha?: string
27+
currentSha?: string
28+
kind: 'branch-switched' | 'pull-detected' | 'unknown'
29+
}
30+
```
31+
32+
Added `ExternalGitChangeListener` that subscribes to these events, appends the matching `external-branch-changed` / `external-pull-detected` entry to `ServiceStateHistory`, and downgrades `installStatus`/`buildStatus` from `installed`/`built` to `'stale'` (emitting a `marked-stale` history event).
33+
34+
### Upstream-Gone Detection
35+
36+
`GitOperationsService.cloneOrPullService()` now runs `git fetch --prune` before pulling and checks whether `origin/<currentBranch>` still exists. When the upstream is gone it:
37+
38+
- Sets `ServiceGitStatus.upstreamStatus = 'gone'`
39+
- Records an `upstream-gone` history event
40+
- Keeps `cloneStatus = 'cloned'` (the repo is still usable) and returns `{ upstreamGone: true }`
41+
42+
Pull errors on an already-cloned repo are now surfaced via `ServiceGitStatus.lastPullError` instead of regressing `cloneStatus` to `'failed'`, so the branch selector in the UI stays usable.
43+
44+
### New Git Actions
45+
46+
- `ServiceDeleteBranchAction` (`POST /services/:id/delete-branch`) — deletes a local branch; when it is currently checked out, switches to `switchTo` or the remote default branch first, then clears the cached `upstream-gone` marker
47+
- `ServiceDismissWarningAction` (`POST /services/:id/dismiss-warning`) — records a per-session dismissal flag (`upstreamGone` or `stale`) in the in-memory `ServiceGitStatus`
48+
49+
### GitService Additions
50+
51+
Added helper methods used by the above features:
52+
53+
- `fetch(cwd)``git fetch --prune`
54+
- `hasRemoteBranch(cwd, branch)` — checks for `refs/remotes/origin/<branch>`
55+
- `getDefaultBranch(cwd)` — resolves `origin/HEAD`
56+
- `deleteLocalBranch(cwd, branch, force)``git branch -d` / `-D`
57+
- `revParse(cwd, ref)` — returns the SHA of a ref (used to detect pull-advances)
58+
- `getCommitsBehind(cwd, branch)` — count of commits the local branch is behind origin
59+
60+
## 🧪 Tests
61+
62+
- Added `run-patch.spec.ts` and `check-for-orphaned-patch.spec.ts` covering idempotent re-runs, retry of failed patches, and orphan recovery
63+
- Added `external-git-change-listener.spec.ts` covering history recording and stale-marking for both `branch-switched` and `pull-detected` kinds
64+
- Added `service-delete-branch-action.spec.ts` covering checkout-before-delete, forced delete, and upstream cleanup
65+
- Added `service-dismiss-warning-action.spec.ts` covering both warning kinds
66+
- Expanded `git-head-watcher.spec.ts` for the chokidar-based watcher and the new `externalChange` event shape
67+
- Expanded `git-operations-service.spec.ts` for upstream-gone detection and the `lastPullError` behavior
68+
- Expanded `git-service.spec.ts` for `fetch`, `hasRemoteBranch`, `deleteLocalBranch`, and `revParse`
69+
- Expanded `git-watcher.spec.ts` for the new status fields
70+
71+
## ⬆️ Dependencies
72+
73+
- Added `chokidar` `^5.0.0` for reliable recursive filesystem watching on `.git/refs/heads/`
74+
- Bumped `@furystack/rest-service` from `^12.3.5` to `^13.0.0`
75+
- Bumped `@furystack/entity-sync-service` from `^1.0.12` to `^1.0.13`
76+
- Bumped `@furystack/websocket-api` from `^13.2.7` to `^13.2.8`
77+
- Bumped `vitest` from `^4.1.4` to `^4.1.5`
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!-- version-type: patch -->
2+
# stack-craft
3+
4+
## 📦 Build
5+
6+
### TypeScript Project References
7+
8+
Root `tsconfig.json` is now a solution file that references the `common`, `service`, and `frontend` sub-projects (`files: []`, `references: [...]`). Removed the top-level `incremental` and `composite` options (they now live in each sub-project).
9+
10+
### Lint Coverage for Non-Compiled Files
11+
12+
Added `tsconfig.lint.json` (extends the root `tsconfig.json` with `noEmit: true`) to include e2e specs, Vite configs, and other `*.config.{ts,mts,mjs}` files in the ESLint `parserOptions.project` list. ESLint now runs with the full set of per-package tsconfigs plus the new lint config:
13+
14+
```js
15+
parserOptions: {
16+
project: [
17+
'common/tsconfig.json',
18+
'service/tsconfig.json',
19+
'frontend/tsconfig.json',
20+
'monaco-mfe/tsconfig.json',
21+
'tsconfig.lint.json',
22+
],
23+
}
24+
```
25+
26+
Expanded the ESLint ignore list to cover compiled config and e2e artifacts emitted next to sources (`**/*.config.{js,mjs,d.ts,d.mts}`, source maps, `e2e/**/*.{js,d.ts,js.map}`).
27+
28+
## 📚 Documentation
29+
30+
- Updated the `REST_SERVICE.mdc` Cursor rule
31+
32+
## ⬆️ Dependencies
33+
34+
- Bumped `@furystack/eslint-plugin` from `^2.1.5` to `^2.2.0`
35+
- Bumped `vite` from `^8.0.9` to `^8.0.10`
36+
- Bumped `vitest` / `@vitest/coverage-v8` from `^4.1.4` to `^4.1.5`

.yarn/versions/4e60fec0.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
releases:
2+
common: patch
3+
frontend: patch
4+
monaco-mfe: patch
5+
service: patch
6+
stack-craft: patch

0 commit comments

Comments
 (0)