Repository navigation
Stand down when a sync belongs to another app in the repo - #119
Merged
Merged
Conversation
- Send the config's projectId when fetching a sync; the server answers with project_matches (localheroai/localhero-ai#841) - On a mismatch, print a notice and return before validating config, writing files, saving config, committing or completing the update - Exit 0: a job that is not the target has nothing to do - No project_matches from an older server: behave as before - Real-filesystem test with two app folders, each with its own localhero.json
- Anchor the .claude ignore to <rootDir>, so the main checkout still skips worktree copies (#111) while a worktree no longer ignores itself - Before, npm test in .claude/worktrees/<name> found no tests at all
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of localheroai/localhero-ai#841. Server side: localheroai/localhero-ai#860 (merged).
The bug
In a monorepo with one Localhero project per app, every matrix job receives the same
localhero-syncdispatch. Each runsciin sync mode, and the API key is organization-wide, so a sibling app fetches another app's sync and tries to write its files into its own folder. Onnewsroom-demothat was a red portal job (Source file is required for creating new JSON translation files) and a cancelled editor job.The change
getSyncTranslationssends the config'sprojectId; the server answers withproject_matches, resolved with friendly_id so a slug or a numeric id both work.project_matches: false,runSyncModeprints one line (a::notice::in Actions) and returns before validating config, writing files, saving config, committing, or completing the sync update.ciexits 0: a job that is not the target has nothing to do.project_matches(older server): unchanged behaviour.Ownership is checked with the raw config
ci()already read, beforegetValidProjectConfig(), so a sibling app whose config would fail validation still exits 0 instead of failing the matrix.Also in this branch: the Jest ignore for
.claude/is anchored to<rootDir>. The main checkout still skips worktree copies (#111), andnpm testinside a.claude/worktrees/checkout finds its own tests again instead of none.Verified
projectIdsent on every page.tests/commands/ci-monorepo.test.ts: two app folders on a real filesystem, each with its ownlocalhero.json, run from each. Fails with the guard disabled.apps/portalreproduces #841, exit 1apps/portal: notice, exit 0, no file changedapps/editor: the edit lands, with the slug or the numeric id inlocalhero.jsonapps/portalwithoutputLocales: []: still exit 0Not covered locally: the dispatch, the Action matrix and the commit. Next step is an RC on newsroom-demo with
portalback in the matrix.