Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 110 additions & 18 deletions .github/workflows/ci.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 25 additions & 2 deletions .github/workflows/ci.yml.genie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,28 @@ const failureReminderStep = {
].join('\n'),
} as const

/**
* Verify the lock-pinned devenv rev emits OTEL shell-entry messages under a real PTY.
* `--no-reload` keeps the probe on the post-init shell-output path we care about
* without exercising the separate interactive reload loop, which currently
* panics on the pinned upstream commit.
*/
const verifyOtelShellEntryStep = {
name: 'Verify OTEL shell entry',
shell: 'bash' as const,
run: [
runDevenvTasksBefore('otel:test'),
'command -v script >/dev/null 2>&1',
'tmp_log="$(mktemp)"',
`printf 'printf "OTEL_MODE=%%s\\n" "$OTEL_MODE"\nprintf "OTEL_GRAFANA_LINK_URL=%%s\\n" "$OTEL_GRAFANA_LINK_URL"\nexit\n' | script -qefc '"${'${DEVENV_BIN:?DEVENV_BIN not set}'}" shell --no-reload' "$tmp_log"`,
"grep -q '\\[otel\\] Using .* OTEL stack' \"$tmp_log\"",
"grep -q '\\[otel\\] Start with: devenv up' \"$tmp_log\"",
"grep -q '^OTEL_MODE=' \"$tmp_log\"",
"grep -q '^OTEL_GRAFANA_LINK_URL=http' \"$tmp_log\"",
'rm -f "$tmp_log"',
].join('\n'),
} as const

/**
* Temporary diagnostics summary for #272.
* Remove once #201/#272 are root-caused and we can return to a minimal CI flow.
Expand Down Expand Up @@ -112,7 +134,7 @@ const nixDiagnosticsSummaryStep = {
].join('\n'),
} as const

const job = (step: { name: string; run: string }) => ({
const job = (step: { name: string; run: string }, extraSteps: readonly any[] = []) => ({
'runs-on': namespaceRunner({
profile: 'namespace-profile-linux-x86-64',
runId: '${{ github.run_id }}',
Expand All @@ -121,6 +143,7 @@ const job = (step: { name: string; run: string }) => ({
env: standardCIEnv,
steps: [
...baseSteps,
...extraSteps,
step,
savePnpmStoreStep(),
nixDiagnosticsSummaryStep,
Expand Down Expand Up @@ -186,7 +209,7 @@ const jobs: Record<CIJobName, ReturnType<typeof job> | ReturnType<typeof multiPl
typecheck: job({
name: 'Type check',
run: runDevenvTasksBefore('ts:check'),
}),
}, [verifyOtelShellEntryStep]),
lint: job({
name: 'Format + lint',
run: runDevenvTasksBefore('lint:check'),
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ All notable changes to this project will be documented in this file.
### Fixed

- **@overeng/tui-react**: Format timeline timestamps as human-readable durations (e.g. `6m 18s / 16m 21s`) instead of raw seconds (`377.9s / 980.6s`) in `TuiStoryPreview` (#472)
- **devenv/tasks**: make warm shell bootstrap commit-scoped and remove `ts:emit` from shell entry
- Adds an outer `setup:auto` cache so warm `devenv shell` skips unchanged bootstrap work instead of traversing `pnpm:install`, `genie:run`, and `mr:apply` on every entry
- Switches shell bootstrap from `mr:sync` to initial `mr:apply` so a fresh worktree is normalized without fetching on every shell
- Replaces setup fingerprint tool-version probes with resolved tool-identity hashing so warm shells do not pay `pnpm`, `genie`, or `mr` CLI startup just to validate unchanged setup inputs
- Speeds up warm task status paths by using direct `mr status`, fingerprint-based `genie:run` caching, a one-process `pnpm:install` projection hash that preserves the previous structural guarantees, and a `ts:emit` graph that excludes `noEmit` references at emit time
- Hardens the fast paths by making the outer cache only track setup inputs while each task still verifies its own outputs before skipping
- **devenv/otel**: pin `devenv` temporarily to the post-#2661 upstream commit and move OTEL shell-entry notices onto `devenv.messages`
- Resolves OTEL mode, dashboard sync, and Grafana trace-link construction in a dedicated shell-entry task instead of ad-hoc `enterShell` output
- Auto-displays the OTEL shell-entry message through upstream task messages while keeping `otel-trace` as a lightweight re-open helper
- Adds a TODO to switch the temporary commit pin back to the `v2.0.7` tag once it is released
- Scrubs ambient task trace context before emitting `devenv/shell:entry` so the shell root span cannot self-parent or collide with later `dt` root spans
- Emits `devenv/shell:entry` via the pinned store path for `otel-span` so tracing still works before `enterShell` PATH mutations are fully visible
- **@overeng/genie**: Validate GitHub Actions `runs-on` labels before emitting workflow YAML
- Fails `genie` when workflow jobs serialize non-string, empty, or stale placeholder runner labels like `null` / `...=undefined`
- Prevents CI helper API drift from silently generating invalid workflow files that only fail later in GitHub Actions
Expand Down
4 changes: 2 additions & 2 deletions context/otel.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dt pnpm:install
dt check:quick

# 4. View traces
otel-trace # clickable trace URL for the current shell session
otel-trace # re-open the current shell session's trace URL
open $OTEL_GRAFANA_URL # Grafana UI -> Explore -> Tempo
```

Expand Down Expand Up @@ -93,7 +93,7 @@ otel-trace | cat # plain text: trace:<trace-id> <url>

The function parses `TRACEPARENT` (W3C format: `version-traceId-spanId-traceFlags`) and constructs a Grafana Explore URL from `OTEL_GRAFANA_LINK_URL`.

**Note:** Auto-display of the trace URL on shell entry is blocked by devenv's PTY task runner (`drain_pty_to_vt`), which consumes all shell output before the interactive session starts. Tracked upstream in [cachix/devenv#2500](https://github.com/cachix/devenv/issues/2500).
**Note:** This repo now uses `devenv.messages` to auto-display the OTEL shell-entry notice. `otel-trace` remains as an on-demand way to reopen the same link later in the session. The repo is temporarily pinned to the upstream post-[cachix/devenv#2661](https://github.com/cachix/devenv/pull/2661) commit while waiting for the next tagged release.

### `otel-span` -- Trace span CLI

Expand Down
19 changes: 11 additions & 8 deletions context/workarounds/devenv-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ removed as they are no longer needed.

**Issue:** https://github.com/cachix/devenv/issues/2500

**Upstream status:** Fixed by https://github.com/cachix/devenv/pull/2661.

**Repo status:** Temporarily resolved here by pinning `devenv` to the merged upstream commit while waiting for the next tagged release.

**Affected repos:** Any repo wanting to display messages (e.g. trace URLs) on shell entry

**Symptoms:**
Expand All @@ -136,11 +140,11 @@ removed as they are no longer needed.

devenv's PTY task runner sends two echo sentinels and reads until both are found, feeding all output to a headless VT. This intentionally hides task runner noise but also swallows any user-facing messages from `enterShell`.

**Workaround:**

Provide an on-demand `otel-trace` shell function instead of auto-displaying. The function is defined during rcfile sourcing and stays available in the interactive shell.
**Current repo approach:**

**Upstream proposal:** A post-drain hook mechanism (env var, file-based, or `ShellCommand` variant) to run code after the interactive session starts.
- Emit OTEL shell-entry notices through `devenv.messages` task output.
- Reuse the exported Grafana link env in `otel-trace` for on-demand reopening.
- Keep a TODO to return to the `v2.0.7` tag once that release is available.

---

Expand Down Expand Up @@ -243,10 +247,9 @@ Git hooks run in a subprocess that doesn't inherit the direnv environment.
- Remove manual JSON trace post-processing from CI pipelines
- Update R10 status in this document to reflect full compliance

- **DEVENV-05 fixed (post-drain hook via #2500):**
- Implement auto-display of otel trace URL using the new hook mechanism
- Remove "on-demand only" comment in `nix/devenv-modules/otel.nix`
- Update `context/otel.md` to reflect auto-display capability
- **DEVENV-05 follow-up (tagged release contains #2661):**
- Replace the temporary commit pin with the `v2.0.7` tag
- Remove the temporary pin note from `devenv.yaml` / CI docs

- **COMPAT-01 improved (web coding agent support):**
- When Claude Code Web adds Nix domains to allowlist: update status, remove "Full internet" workaround
Expand Down
8 changes: 4 additions & 4 deletions devenv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@ in
optionalTasks = [
"pnpm:install"
"genie:run"
"mr:sync"
"ts:emit"
"mr:apply"
];
completionsCliNames = [
"genie"
Expand Down Expand Up @@ -364,6 +363,7 @@ in
tasks."genie:check".after = [ "pnpm:install" ];
tasks."lint:check:genie".after = [ "pnpm:install" ];
tasks."mr:sync".after = [ "pnpm:install" ];
tasks."mr:apply".after = [ "pnpm:install" ];

tasks."gh:apply-settings" = {
after = [ "genie:run" ];
Expand Down
5 changes: 4 additions & 1 deletion devenv.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
inputs:
devenv:
url: github:cachix/devenv/v2.0.6
# Temporary pin to the post-#2661 commit so shell-entry task messages are
# available before the upstream v2.0.7 release lands.
# TODO: Switch back to github:cachix/devenv/v2.0.7 once it is released.
url: github:cachix/devenv/61170924d98492ad8842dca02ad8b912305d308b
nixpkgs:
url: github:NixOS/nixpkgs/nixos-unstable
git-hooks:
Expand Down
Loading
Loading