Files
josh-sync/examples/josh-sync.yml
SBPro b28662d3b4 Release 2.0.0 — explicit monorepo_url, drop first-target-host inference
Breaking change. The monorepo's gitea host was previously inferred from the
first target's subrepo_url, silently coupling the two and breaking on any
multi-host setup (monorepo on host A, target on host B). v2.0.0 replaces the
inference with a required josh.monorepo_url field that mirrors subrepo_url —
same parsing, same SSH/HTTPS auth options, same shape.

- schema_version: 2 is now required; v1 configs are rejected with a clear migration error
- josh.monorepo_url is required; josh.monorepo_auth is optional (default https)
- mono_auth_url() in lib/auth.sh mirrors subrepo_auth_url()
- MONOREPO_API derives from monorepo_url's host instead of .[0].gitea_host;
  env-var override preserved as escape hatch
- initial_import() and force-push call mono_auth_url() instead of building URLs inline
- ADR-012 documents the rationale; CHANGELOG includes migration snippet

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 06:31:21 +03:00

56 lines
1.9 KiB
YAML

# .josh-sync.yml — Multi-target configuration example
# Place this at the root of your monorepo.
# Required since v2.0.0. Bump alongside the josh-sync major version when
# breaking config changes ship.
schema_version: 2
josh:
# Your josh-proxy instance URL (no trailing slash)
proxy_url: "https://josh.example.com"
# Repo path as josh-proxy sees it (org/repo)
monorepo_path: "org/monorepo"
# Monorepo git clone URL — git@host:org/repo.git (SSH) or https://host/org/repo.git.
# The gitea host is derived from this URL (used for the PR API and direct clones).
# The monorepo and any subrepo may live on different gitea hosts.
monorepo_url: "git@gitea.example.com:org/monorepo.git"
# Optional. Default "https". Use "ssh" to clone the monorepo via SSH (no token
# needed for the clone — PR creation still requires GITEA_TOKEN).
monorepo_auth: "ssh"
targets:
- name: "billing"
subfolder: "services/billing"
# josh_filter auto-derived as ":/services/billing" if omitted
subrepo_url: "https://gitea.example.com/ext/billing.git"
subrepo_auth: "https"
branches:
main: main
develop: develop
forward_only: []
exclude: # files excluded from subrepo (optional)
- ".monorepo/" # directory at subfolder root
- "**/internal/" # directory at any depth
- name: "auth"
subfolder: "services/auth"
subrepo_url: "git@gitea.example.com:ext/auth.git"
subrepo_auth: "ssh"
# Per-target credential override (reads from $AUTH_SSH_KEY instead of $SUBREPO_SSH_KEY)
subrepo_ssh_key_var: "AUTH_SSH_KEY"
branches:
main: main
forward_only: []
- name: "shared-lib"
subfolder: "libs/shared"
subrepo_url: "https://gitea.example.com/ext/shared-lib.git"
branches:
main: main
forward_only: [main] # one-way: mono → subrepo only
bot:
name: "josh-sync-bot"
email: "josh-sync-bot@example.com"
trailer: "Josh-Sync-Origin"