Rename Installation to Instance
Follows the portal: the noun is "instance" everywhere the app says it — UI strings, CLI output, error details, docs and comments. The wire keys (`instance_id`, `instance_token`) and the hub route this calls move with it. An existing cloud.json is adopted rather than refused: without the key alias the dataclass fails to parse, which the caller swallows and reads as "never enrolled" instead of "reconnect". `instance_key` on a node type becomes `target_key`. It means the outside thing a node points at, which is a different sense of the word, and keeping both would put two meanings of "instance" in one codebase. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015YrQnKV3bnQd4K342y8tKj
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Which installation a command is for, and where its token lives.
|
||||
"""Which instance a command is for, and where its token lives.
|
||||
|
||||
A repository with its own venv gets its own engine, so "which one" is a fact
|
||||
about the working directory rather than about the machine.
|
||||
@@ -14,14 +14,14 @@ from fluksio.sdk import client
|
||||
|
||||
@pytest.fixture
|
||||
def elsewhere(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
|
||||
"""A working directory with no installation above it."""
|
||||
"""A working directory with no instance above it."""
|
||||
monkeypatch.chdir(tmp_path)
|
||||
monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path / "xdg"))
|
||||
monkeypatch.setattr(client, "GLOBAL_DATA_DIR", tmp_path / "home" / ".fluksio")
|
||||
return tmp_path
|
||||
|
||||
|
||||
def test_a_project_local_installation_is_found_from_below(elsewhere: Path):
|
||||
def test_a_project_local_instance_is_found_from_below(elsewhere: Path):
|
||||
(elsewhere / ".fluksio").mkdir()
|
||||
deep = elsewhere / "src" / "pkg" / "sub"
|
||||
deep.mkdir(parents=True)
|
||||
@@ -31,7 +31,7 @@ def test_a_project_local_installation_is_found_from_below(elsewhere: Path):
|
||||
|
||||
|
||||
def test_the_nearest_one_wins(elsewhere: Path):
|
||||
"""An installation inside another belongs to the directory it is in."""
|
||||
"""An instance inside another belongs to the directory it is in."""
|
||||
(elsewhere / ".fluksio").mkdir()
|
||||
inner = elsewhere / "inner"
|
||||
(inner / ".fluksio").mkdir(parents=True)
|
||||
@@ -63,7 +63,7 @@ def test_the_credential_beside_the_data_is_the_one_used(elsewhere: Path):
|
||||
assert client._stored()["token"] == "local"
|
||||
|
||||
|
||||
def test_a_login_from_before_installations_were_local_still_works(elsewhere: Path):
|
||||
def test_a_login_from_before_instances_were_local_still_works(elsewhere: Path):
|
||||
"""`fluksio login` wrote to XDG once; that must not stop answering."""
|
||||
legacy = client._legacy_config_path()
|
||||
legacy.parent.mkdir(parents=True)
|
||||
|
||||
Reference in New Issue
Block a user