Skip to content

ci(docs-sync): forward-port the tutorials into cosmos/docs latest/ - #18

Merged
evanorti merged 1 commit into
mainfrom
sync-forward-port-latest
Sep 4, 2026
Merged

ci(docs-sync): forward-port the tutorials into cosmos/docs latest/#18
evanorti merged 1 commit into
mainfrom
sync-forward-port-latest

Conversation

@evanorti

@evanorti evanorti commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

The sync writes the tutorials into cosmos/docs sdk/next/tutorials/example/ and nothing carries them into sdk/latest/. latest/ is the default view for readers, and it sat two syncs behind for months: it described localnet as running several validators when scripts/localnet/init.sh gentxes node0 only, and described a code: 0 broadcast response as the chain having executed the transaction.

These pages are the one exception to cosmos/docs' version freeze. They instruct git clone https://github.com/cosmos/example and git checkout main, so they document whatever main is now. Freezing a copy protects nothing; it leaves latest/ describing code the reader is not running.

Changes

  • Set up Node, which this workflow did not need before
  • After the transform, run cosmos-docs/scripts/sync-next-to-latest.js over the tutorials, which copies next/ into latest/ and rewrites /sdk/next/ links to /sdk/latest/
  • Stage sdk/latest/tutorials/example/ alongside next/, so one PR carries both copies and gets one review

The script and the reasoning live in cosmos/docs, so only the call is here.

Review focus

The step skips itself when scripts/sync-next-to-latest.js is absent from cosmos/docs main, so merge order does not matter. The workflow checks out cosmos/docs with no ref:, so it gets main, and the script lands there with cosmos/docs#345. Until then this step logs a warning and exits 0.

The loop guard is unaffected: the commit still carries [docs-sync], which is what cosmos/docs' outgoing workflow skips on.

Verification

Rehearsed locally against fresh clones of both repos, running the real steps in order: transform into next/, then the forward-port. It produced 5 changed files under latest/, no /sdk/next/ links left in latest/, no /sdk/latest/ links in next/, and no noindex leaking from next/'s front matter into latest/. The skip branch was tested separately and exits 0.

🤖 Generated with Claude Code

The example tutorials tell the reader to clone this repo and check out main,
so they document whatever main is now rather than a released version. A frozen
copy in cosmos/docs latest/ therefore describes code the reader is not running.
Nothing carried the sync into latest/, and it sat two syncs behind for months.

The script and the reasoning live in cosmos/docs; only the call is here. The
step skips itself when the script is absent, so this works whether it merges
before or after the cosmos/docs side.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown

Greptile Summary

The PR extends the documentation synchronization workflow so the transformed tutorials are also copied from the next documentation tree into latest.

  • Sets up Node.js 20 for the forward-port script.
  • Safely skips the forward-port while the corresponding cosmos/docs script is absent.
  • Stages both tutorial versions in the generated documentation PR.
  • Requires the repository-mandated changelog entry before merging.

Confidence Score: 4/5

The workflow change appears functionally safe, but the explicit repository changelog requirement must be satisfied before merging.

No behavioral failure was established in the synchronization flow; the only accepted issue is the omitted changelog entry required for every repository change.

Files Needing Attention: .github/workflows/docs-sync.yml and CHANGELOG.md

Important Files Changed

Filename Overview
.github/workflows/docs-sync.yml Adds Node setup, forwards generated tutorials from next to latest, and stages both trees; the required changelog update is missing.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[example docs/] -->|transform.py| B[cosmos/docs sdk/next/tutorials/example]
  B -->|sync-next-to-latest.js| C[cosmos/docs sdk/latest/tutorials/example]
  B --> D[Stage generated files]
  C --> D
  D --> E[Open or update cosmos/docs PR]
Loading

Reviews (1): Last reviewed commit: "ci(docs-sync): forward-port the tutorial..." | Re-trigger Greptile

Comment on lines +39 to +42
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Changelog Entry Missing

This workflow change does not update CHANGELOG.md. The repository requires every change to add an entry under ## [Unreleased] describing what changed and why. This requirement must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@evanorti
evanorti merged commit d253d9c into main Sep 4, 2026
4 checks passed
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