Skip to content

fix(ci): scope publish script version sed to package section only#574

Merged
AlexMikhalev merged 1 commit intomainfrom
fix/publish-script-version-sed
Feb 23, 2026
Merged

fix(ci): scope publish script version sed to package section only#574
AlexMikhalev merged 1 commit intomainfrom
fix/publish-script-version-sed

Conversation

@AlexMikhalev
Copy link
Copy Markdown
Contributor

Summary

  • The update_versions function in publish-crates.sh used sed "s/^version = \".*\"/.../" which replaced all lines starting with version = " -- including dependency versions under [dependencies.X] sections
  • This corrupted notify's version from "6.1" to "1.10.0" in terraphim_router/Cargo.toml, causing cargo publish to fail with failed to select a version for the requirement notify = "^1.10.0"
  • Fix: use sed range addressing (0,/pattern/ on GNU, 1,/pattern/ on BSD) to only replace the first occurrence -- the [package] version line

Test plan

  • Verified locally: sed -i '0,/^version = ".*"/s/.../.../' terraphim_router/Cargo.toml changes only line 3 (package version), leaves notify version "6.1" on line 36 untouched
  • Re-tag v1.10.0 and verify cargo publish passes for terraphim_router

Generated with Terraphim AI

The update_versions function replaced ALL lines matching ^version = "..."
which corrupted dependency versions in multi-line [dependencies.X] blocks.
For example, notify's version "6.1" in terraphim_router was changed to
"1.10.0", causing cargo publish to fail with "failed to select a version".

Fix: use sed range addressing (0,/pattern/ on GNU, 1,/pattern/ on BSD)
to only replace the first occurrence -- the [package] version line.

Co-Authored-By: Terraphim AI <noreply@anthropic.com>
@AlexMikhalev AlexMikhalev merged commit dd2ee59 into main Feb 23, 2026
4 of 5 checks passed
@AlexMikhalev AlexMikhalev deleted the fix/publish-script-version-sed branch February 23, 2026 10:55
AlexMikhalev added a commit that referenced this pull request Feb 23, 2026
Patch release containing:
- fix: learn/check-update/update commands no longer require TuiService (#542)
- fix(ci): scope publish script version sed to package section only (#574)

Co-Authored-By: Terraphim AI <noreply@anthropic.com>
AlexMikhalev pushed a commit that referenced this pull request Apr 15, 2026
Part of Gitea zestic-ai/terraphim-ai #574 (step 2 of three).

Adds scripts/update-benchmark-snapshot.sh which extracts mean point
estimates from target/criterion/build_index_throughput/{100,1000}/new/
estimates.json and flattens them into benchmark-results/snapshot.json,
matching the schema consumed by terraphim.ai at
content/data/benchmarks.json. Metrics not yet directly wired to
Criterion output (inference_ns, search_latency_ms, graph_footprint_mb,
index_throughput_mibps) fall back to the hand-curated values from the
2025-11-11 test report; the snapshot records each metric's source in
source.notes for traceability.

Extends .github/workflows/performance-benchmarking.yml update-baseline
job with a step that runs the script (passing GITHUB_SHA and a
workflow_run URL for provenance) and commits snapshot.json alongside
baseline.json on main.

Validated locally: produces valid JSON (jq empty), 6 metrics, stable
across reruns apart from generated_at.

Step 3 (cross-repo PR bridge to terraphim.ai) remains deferred.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AlexMikhalev pushed a commit that referenced this pull request Apr 15, 2026
Part of Gitea zestic-ai/terraphim-ai #574 (step 3 of three).

Triggers on push to main when benchmark-results/snapshot.json changes,
or via manual dispatch. Checks out terraphim/terraphim.ai using a PAT
stored as TERRAPHIM_AI_SITE_TOKEN, copies snapshot.json into
content/data/benchmarks.json on a new branch benchmarks/sync-<sha>,
and opens a labelled PR against main.

Idempotency: compares source and destination with generated_at stripped
via jq; exits without opening a PR when only the timestamp has moved.

PR body cites the source commit and the terraphim-ai workflow run URL
for traceability. Label 'benchmarks' created on terraphim.ai side.

Required setup before first run:
  - Create PAT with contents:write + pull-requests:write on
    terraphim/terraphim.ai
  - Add as TERRAPHIM_AI_SITE_TOKEN in this repo's secrets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AlexMikhalev pushed a commit that referenced this pull request Apr 16, 2026
The publish-benchmarks-to-site workflow was blocked because it ran on
ubuntu-latest and required a GitHub PAT stored as TERRAPHIM_AI_SITE_TOKEN
in repo secrets. Every other workflow in this repo (deploy-docs,
performance-benchmarking) already solves auth via the self-hosted runner
on bigbox plus 1password/load-secrets-action@v2.

Changes:
- runs-on: ubuntu-latest -> [self-hosted, linux, x64]
- Auth via OP_GH_TOKEN from op://TerraphimPlatform/github-site-deploy/credential
- 1password/load-secrets-action@v2 injects GH_TOKEN at runtime
- Removed TERRAPHIM_AI_SITE_TOKEN secret dependency
- Updated actions/checkout from v4 to v6 for consistency

Requires one-off manual setup: create 1Password item "github-site-deploy"
in TerraphimPlatform vault with a fine-grained GitHub PAT scoped to
terraphim/terraphim.ai (contents:write + pull-requests:write).

Refs Gitea zestic-ai/terraphim-ai #574

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AlexMikhalev added a commit that referenced this pull request Apr 25, 2026
The update_versions function replaced ALL lines matching ^version = "..."
which corrupted dependency versions in multi-line [dependencies.X] blocks.
For example, notify's version "6.1" in terraphim_router was changed to
"1.10.0", causing cargo publish to fail with "failed to select a version".

Fix: use sed range addressing (0,/pattern/ on GNU, 1,/pattern/ on BSD)
to only replace the first occurrence -- the [package] version line.

Co-authored-by: Terraphim AI <noreply@anthropic.com>
AlexMikhalev added a commit that referenced this pull request Apr 25, 2026
Patch release containing:
- fix: learn/check-update/update commands no longer require TuiService (#542)
- fix(ci): scope publish script version sed to package section only (#574)

Co-Authored-By: Terraphim AI <noreply@anthropic.com>
AlexMikhalev pushed a commit that referenced this pull request Apr 25, 2026
Part of Gitea zestic-ai/terraphim-ai #574 (step 2 of three).

Adds scripts/update-benchmark-snapshot.sh which extracts mean point
estimates from target/criterion/build_index_throughput/{100,1000}/new/
estimates.json and flattens them into benchmark-results/snapshot.json,
matching the schema consumed by terraphim.ai at
content/data/benchmarks.json. Metrics not yet directly wired to
Criterion output (inference_ns, search_latency_ms, graph_footprint_mb,
index_throughput_mibps) fall back to the hand-curated values from the
2025-11-11 test report; the snapshot records each metric's source in
source.notes for traceability.

Extends .github/workflows/performance-benchmarking.yml update-baseline
job with a step that runs the script (passing GITHUB_SHA and a
workflow_run URL for provenance) and commits snapshot.json alongside
baseline.json on main.

Validated locally: produces valid JSON (jq empty), 6 metrics, stable
across reruns apart from generated_at.

Step 3 (cross-repo PR bridge to terraphim.ai) remains deferred.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AlexMikhalev pushed a commit that referenced this pull request Apr 25, 2026
Part of Gitea zestic-ai/terraphim-ai #574 (step 3 of three).

Triggers on push to main when benchmark-results/snapshot.json changes,
or via manual dispatch. Checks out terraphim/terraphim.ai using a PAT
stored as TERRAPHIM_AI_SITE_TOKEN, copies snapshot.json into
content/data/benchmarks.json on a new branch benchmarks/sync-<sha>,
and opens a labelled PR against main.

Idempotency: compares source and destination with generated_at stripped
via jq; exits without opening a PR when only the timestamp has moved.

PR body cites the source commit and the terraphim-ai workflow run URL
for traceability. Label 'benchmarks' created on terraphim.ai side.

Required setup before first run:
  - Create PAT with contents:write + pull-requests:write on
    terraphim/terraphim.ai
  - Add as TERRAPHIM_AI_SITE_TOKEN in this repo's secrets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AlexMikhalev pushed a commit that referenced this pull request Apr 25, 2026
The publish-benchmarks-to-site workflow was blocked because it ran on
ubuntu-latest and required a GitHub PAT stored as TERRAPHIM_AI_SITE_TOKEN
in repo secrets. Every other workflow in this repo (deploy-docs,
performance-benchmarking) already solves auth via the self-hosted runner
on bigbox plus 1password/load-secrets-action@v2.

Changes:
- runs-on: ubuntu-latest -> [self-hosted, linux, x64]
- Auth via OP_GH_TOKEN from op://TerraphimPlatform/github-site-deploy/credential
- 1password/load-secrets-action@v2 injects GH_TOKEN at runtime
- Removed TERRAPHIM_AI_SITE_TOKEN secret dependency
- Updated actions/checkout from v4 to v6 for consistency

Requires one-off manual setup: create 1Password item "github-site-deploy"
in TerraphimPlatform vault with a fine-grained GitHub PAT scoped to
terraphim/terraphim.ai (contents:write + pull-requests:write).

Refs Gitea zestic-ai/terraphim-ai #574

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant