Repository navigation
Fix pull alias - #1610
Merged
Merged
Fix pull alias#1610
Conversation
josephjclark
added a commit
that referenced
this pull request
Nov 3, 2026
* Keep non-ASCII letters and punctuation in ids derived from names (#1605) * Keep non-ASCII letters and punctuation in ids slugify replaced every non-word character with a hyphen, so names in other scripts lost their letters and their ids didn't match Lightning's. It now only replaces characters that aren't safe in file names. Names that differ only by case or by space vs hyphen still give the same id. A pull now rejects them, as Lightning's export does, so the resources.yaml writer no longer adds -2 suffixes to channel keys. * Track channel ids in the checkout file The new slug rules change some resources.yaml keys, and merging only matched channels by key, so a channel whose key changed lost its id and was treated as removed. The checkout file now records channel_uuids by key, as it already does for workflows. A merge matches channels by id first, then by key, then by name. * add changeset for channels change * comments and tests --------- Co-authored-by: Joe Clark <jclark@openfn.org> * Fix pull alias (#1610) * add failing tests * fix * changeset * versions --------- Co-authored-by: Midigo Frank <39288959+midigofrank@users.noreply.github.com>
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.
When fetching or pulling a sandbox by UUID with no
--alias, the CLI always defaulted the alias to the sandbox id. If the project had already been pulled under a different alias, this wrote a second project file and could fail with a UUID conflict.Now the sandbox id is only used as the alias when the local project doesn't already have one, so a repeat fetch updates the existing file.
QA
This is the problem which we're facing with github sync in prod:
We expect that when pulling the project, we re-use the existing local alias, and no new file is created.
But actually, the fetch code will force the alias to the sandbox id, creating a new statefile, and then throwing an error for a UUID conflict.
Tests
packages/cli/test/projects/fetch.test.ts: fetches a sandbox twice (with, then without an alias) and asserts only thestagingfile exists, and that nomy-sandboxfile is written after either fetch.integration-tests/cli/test/sync/commands.test.ts: the same flow throughproject pullagainst the mock Lightning.Both fail without the fix and pass with it.
Notes
A first-ever sandbox pull with no alias should still default to the sandbox id. The new condition relies on
remoteProject.cli.aliasbeing unset in that case, which is worth a look in review.AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy