-
Notifications
You must be signed in to change notification settings - Fork 14
Add Project aliases with fuzzy matching #1167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/next
Are you sure you want to change the base?
Conversation
|
I think I'm going to change my mind here and make alias the bit before the The benefit of this is that changing aliases is easier - you just rename the file and it'll be instantly recognised. otherwise there's confusion between the |
This comment was marked as resolved.
This comment was marked as resolved.
d0aa655 to
58fd52d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This uses undici mocks but ofcourse the CLI runs out of a different proces, so the mocked endpoints don't return I'll need to refactor to use the lightning mock
|
Ah, also need aliasing on merge |
Changes to the lightning mock caused it to break
|
Almost happy with this but I've got myself a bit confused by something. What is the meaning of alias? If you're asking for a UUID, the alias is the file name to fetch to locally. Right now we try and find a local project file based on the UUID - not the alias. And that means when we write to the local alias file, we haven't properly checked for conflicts. If the identifier is an alias, then I suppose you could be saying "fetch the project with local alias A, and save it to local alias B!. So the identifier is what you use to look up the remote uuid. The I will need to refactor a bit around this important distinction, and add acouple of considered tests. |
Adds Aliases to Projects.
The
aliasreplacesenv(which was chosen before sandbox environments and is now causing chaos and confusion).aliasis saved in the Project class, but does not get serialized to a state file. It's just in the file name. This is nice because if a user wants to change alias, all they have to do is rename the file and it's instantly recognised.You can also use a domain with an alias.
Basically the idea is that anywhere you can reference a project, you can now use its id, UUID or alias.
There are a bunch of other refactors here:
getIdentifierin favour ofget qname. A qname, or qualified name, is simply aalias@domainidentifier.options.tshas gotten too big and broken as a the CLI has diversified, I've started a newproject/optionsfile which just holds options used by the project subcommand. This was a little painful but it's definitely a positive refactor, and I'll start slowly replicating that refactor across other commandsSo now we can do:
I've not done the deploy side of things as there's already a large deploy PR in progress. I'll rebase onto this and fix deploy over there.
AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy