13 Commits
Author SHA1 Message Date
fork-sync[bot] ff9006d2ef fix(tools): scan all branches for workflow files 2026-09-16 23:03:31 +02:00
fork-sync[bot] fdacc08649 feat(tools): verbose mode for sync-registry-secrets 2026-09-16 23:01:34 +02:00
fork-sync[bot] 54d7506a30 fix(tools): use Gitea secret field name "data", not "value" 2026-09-16 22:57:14 +02:00
fork-sync[bot] 8606450d3c feat(tools): trim to debug-mode logging only 2026-09-16 22:52:31 +02:00
fork-sync[bot] 305a442462 feat(tools): add admin self-check to sync-registry-secrets 2026-09-16 22:50:02 +02:00
fork-sync[bot] c1166ec140 feat(tools): add sync-registry-secrets script 2026-09-16 10:40:42 +02:00
fork-sync[bot] 6e6df1e1df ci: add sync-registry-secrets workflow 2026-09-16 10:39:52 +02:00
hermes ae400c416e feat(fork-sync): discover forks dynamically via Gitea API
Removes the hardcoded FORK_PAIRS list. The workflow now calls
GET /api/v1/users/{user}/repos and walks every repo where
`fork=true`, using `parent.full_name` as the upstream.

Behaviour:
- FORK_PAIRS env still works as an explicit override (used by tests).
- New forks owned by hermes are picked up automatically without any
  config change.
- Repos whose parent is not accessible (private, deleted, ACL change)
  are skipped with a single ::note:: log line.
- All other behaviour unchanged: clones, FF, branch creation, push.

Tested locally against the live Gitea: discovered 5 forks
(brencher, ansible, reverseproxy, mcps, hermes-voice-gateway) and
synced them as expected.

Assisted-By: hermes-agent:minimax-m3
2026-09-14 20:12:48 +00:00
hermes 9f6ef132f8 fix(fork-sync): actually push to origin after FF
The previous version only updated local clones (the CI workdir) but
never pushed the synced state back to the fork. This means the Gitea
web UI kept showing stale branches even after a green CI run.

Now `git push origin <branch>` runs after each successful fast-forward
and after each created branch. The local CI run can then verify via
the Gitea API that the fork actually moved.

Note: forks whose default_branch differs from upstream default_branch
(e.g. hermes/hermes-voice-gateway uses feat/voice-gateway-mvp while
upstream Org1/hermes-voice-gateway uses main) will still lag on the
default branch. To keep both in sync, run the workflow with a
FORK_BRANCHES env that includes the upstream default_branch name.

Assisted-By: hermes-agent:minimax-m3
2026-09-14 17:38:22 +00:00
hermes a63f8f3f9c fix(workflow): treat fork-sync rc=2 as success-with-changes
fork-sync.py exits with code 2 when it has alerts to report (changes
detected) and 1 on real errors. The workflow was treating any non-empty
output as a failure, which made every run where branches were created
show up as failure in CI even though everything worked correctly.

Workflow now distinguishes:
  rc=0: nothing to report
  rc=2: changes reported (success, but worth surfacing in CI summary)
  rc>=3 or other: real failure, mark as such

Assisted-By: hermes-agent:minimax-m3
2026-09-14 17:10:16 +00:00
hermes bd96dba9a1 fix(fork-sync): handle missing upstream remote gracefully
`git remote remove upstream` exits non-zero when the remote does not exist,
which then blocks `git remote add upstream` from succeeding. The first-run
CI clones failed on a non-empty error stream even though the second
attempt would have succeeded.

Fix: only `git remote add` when the previous `remove` actually removed
something (returncode 0). When the remote was already absent, skip the
add since fetch will set it up implicitly. This makes the first-run
clone idempotent.

Assisted-By: hermes-agent:minimax-m3
2026-09-14 17:06:46 +00:00
hermes 0d111f29de fix: use HERMES_GITEA_TOKEN secret (GITEA_* prefix is reserved)
Gitea rejects secret names matching ^GIT(EA|HUB)_ per services/secrets/validation.go.
Renamed to HERMES_GITEA_TOKEN and updated workflow + README accordingly.

Assisted-By: hermes-agent:minimax-m3
2026-09-14 17:00:03 +00:00
hermes 4059b4194f feat: initial fork-sync workflow
Adds:
- .gitea/workflows/fork-sync.yml — hourly Gitea Actions workflow that clones
  hermes/* forks, fast-forwards branches with upstream counterparts, creates
  tracking branches for upstream-only branches, surfaces divergences.
- tools/fork-sync.py — shared sync script (used by both the workflow and the
  hermes-agent local cron fallback).
- README.md — operator documentation.

Forks covered by default: hermes/{brencher,ansible,reverseproxy,mcps,
hermes-voice-gateway} ← admin/{brencher,ansible,reverseproxy,mcps} and
Org1/{hermes-voice-gateway}.

Assisted-By: hermes-agent:minimax-m3
2026-09-14 16:56:58 +00:00