bcbd1bdb22
Integ / changes (push) Has been skipped
Pre-commit / pre-commit (push) Failing after 1s
CLI exit codes / changes (push) Has been skipped
Test (Install) / changes (push) Has been skipped
Test (Python) / changes (push) Has been skipped
Test (TypeScript) / changes (push) Has been skipped
CLI exit codes / cli-gate (push) Has been cancelled
Test (Install) / test-install-gate (push) Has been cancelled
Integ / integ-gate (push) Has been cancelled
Test (Python) / test-python-gate (push) Has been cancelled
Test (TypeScript) / test-typescript-gate (push) Has been cancelled
Test (Install) / python-minimal (3.12) (push) Has been cancelled
Test (Install) / python-minimal (3.11) (push) Has been cancelled
Test (Install) / python-extra (agno, mirage.agents.agno) (push) Has been cancelled
Test (Install) / python-extra (chroma, mirage.resource.chroma) (push) Has been cancelled
Test (Install) / python-extra (pdf, mirage.core.filetype.pdf) (push) Has been cancelled
Integ / integ (push) Has been cancelled
Integ / integ-database (push) Has been cancelled
Integ / integ-database-ts (push) Has been cancelled
Integ / integ-data (push) Has been cancelled
Integ / integ-ssh (push) Has been cancelled
Integ / integ-ssh-ts (push) Has been cancelled
Test (Python) / audit (push) Has been cancelled
Test (TypeScript) / test (push) Has been cancelled
Test (TypeScript) / python-fs-shim (push) Has been cancelled
CLI exit codes / Python CLI (push) Has been cancelled
CLI exit codes / TypeScript CLI (push) Has been cancelled
CLI exit codes / Cross-language snapshot interop (push) Has been cancelled
Test (Python) / test (push) Has been cancelled
Test (Python) / import-isolation (deepagents, openai, mirage.agents.openai_agents) (push) Has been cancelled
Test (Python) / import-isolation (deepagents, pydantic-ai, mirage.agents.pydantic_ai) (push) Has been cancelled
Integ / integ-ts (push) Has been cancelled
Integ / integ-fuse (push) Has been cancelled
Test (Install) / python-extra (databricks, mirage.resource.databricks_volume) (push) Has been cancelled
Test (Install) / python-extra (deepagents, mirage.agents.langchain) (push) Has been cancelled
Test (Install) / python-extra (email, mirage.resource.email) (push) Has been cancelled
Test (Install) / python-extra (fuse, mirage.fuse.mount) (push) Has been cancelled
Test (Install) / python-extra (hdf5, mirage.core.filetype.hdf5) (push) Has been cancelled
Test (Install) / python-extra (hf, mirage.resource.hf_buckets) (push) Has been cancelled
Test (Install) / python-extra (lancedb, mirage.resource.lancedb) (push) Has been cancelled
Test (Install) / python-extra (langfuse, mirage.resource.langfuse) (push) Has been cancelled
Test (Install) / python-extra (mongodb, mirage.resource.mongodb) (push) Has been cancelled
Test (Install) / python-extra (nextcloud, mirage.resource.nextcloud) (push) Has been cancelled
Test (Install) / python-extra (openai, mirage.agents.openai_agents) (push) Has been cancelled
Test (Install) / python-extra (openhands, mirage.agents.openhands, 3.12) (push) Has been cancelled
Test (Install) / python-extra (parquet, mirage.core.filetype.parquet) (push) Has been cancelled
Test (Install) / python-extra (postgres, mirage.resource.postgres) (push) Has been cancelled
Test (Install) / python-extra (pydantic-ai, mirage.agents.pydantic_ai) (push) Has been cancelled
Test (Install) / python-extra (qdrant, mirage.resource.qdrant) (push) Has been cancelled
Test (Install) / python-extra (redis, mirage.resource.redis) (push) Has been cancelled
Test (Install) / python-extra (s3, mirage.resource.s3) (push) Has been cancelled
Test (Install) / python-extra (ssh, mirage.resource.ssh) (push) Has been cancelled
Test (Install) / ts-minimal (push) Has been cancelled
214 lines
8.0 KiB
Python
214 lines
8.0 KiB
Python
# ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
# ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
|
|
|
|
import asyncio
|
|
import json
|
|
import os
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
from mirage import MountMode, Workspace
|
|
from mirage.resource.linear import LinearConfig, LinearResource
|
|
|
|
load_dotenv(".env.development")
|
|
|
|
config = LinearConfig(api_key=os.environ["LINEAR_API_KEY"])
|
|
resource = LinearResource(config=config)
|
|
|
|
|
|
async def main() -> None:
|
|
ws = Workspace({"/linear": resource}, mode=MountMode.READ)
|
|
|
|
print("=== not-found errors show the full virtual path ===")
|
|
for cmd in ("cat /linear/__nf_missing__.txt",
|
|
"head /linear/__nf_missing__.txt",
|
|
"stat /linear/__nf_missing__.txt"):
|
|
result = await ws.execute(cmd)
|
|
print(f"$ {cmd}")
|
|
print(f" exit={result.exit_code} "
|
|
f"{(await result.stderr_str()).strip()}")
|
|
|
|
print("=== ls /linear/teams/ ===")
|
|
result = await ws.execute("ls /linear/teams/")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== ls -l /linear/teams/ (mtime from updatedAt) ===")
|
|
long_result = await ws.execute("ls -l /linear/teams/")
|
|
print(await long_result.stdout_str())
|
|
|
|
first_team = (await result.stdout_str()).strip().splitlines()[0] if (
|
|
await result.stdout_str()).strip() else ""
|
|
if not first_team:
|
|
print("No teams available")
|
|
return
|
|
|
|
print(f"=== cat /linear/teams/{first_team}/team.json ===")
|
|
result = await ws.execute(f"cat /linear/teams/{first_team}/team.json")
|
|
print(await result.stdout_str())
|
|
|
|
print(f"=== ls /linear/teams/{first_team}/issues/ ===")
|
|
issue_result = await ws.execute(f"ls /linear/teams/{first_team}/issues/")
|
|
print(await issue_result.stdout_str())
|
|
|
|
print(f"=== ls /linear/teams/{first_team}/projects/ ===")
|
|
project_result = await ws.execute(
|
|
f"ls /linear/teams/{first_team}/projects/")
|
|
print(await project_result.stdout_str())
|
|
|
|
project_names = (await project_result.stdout_str()).strip().splitlines()
|
|
mirage_project = next(
|
|
(name for name in project_names if name.startswith("Mirage__")),
|
|
"",
|
|
)
|
|
if mirage_project:
|
|
print(
|
|
f"=== cat /linear/teams/{first_team}/projects/{mirage_project} ==="
|
|
)
|
|
result = await ws.execute(
|
|
f"cat /linear/teams/{first_team}/projects/{mirage_project}")
|
|
print(await result.stdout_str())
|
|
|
|
project_payload = json.loads(await result.stdout_str())
|
|
print("=== issues in Mirage project ===")
|
|
for issue in project_payload.get("issues", []):
|
|
print(f"{issue['issue_key']}: "
|
|
f"{issue['title']} "
|
|
f"[{issue['state_name']}]")
|
|
else:
|
|
print("Mirage project not found in first team")
|
|
|
|
first_issue = (await
|
|
issue_result.stdout_str()).strip().splitlines()[0] if (
|
|
await issue_result.stdout_str()).strip() else ""
|
|
if not first_issue:
|
|
print("No issues available in first team")
|
|
return
|
|
|
|
issue_path = f"/linear/teams/{first_team}/issues/{first_issue}"
|
|
|
|
print("=== cat issue.json ===")
|
|
result = await ws.execute(f"cat {issue_path}/issue.json")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== head -n 3 comments.jsonl ===")
|
|
result = await ws.execute(f"head -n 3 {issue_path}/comments.jsonl")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== tail -n 1 comments.jsonl ===")
|
|
result = await ws.execute(f"tail -n 1 {issue_path}/comments.jsonl")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== wc -l comments.jsonl ===")
|
|
result = await ws.execute(f"wc -l {issue_path}/comments.jsonl")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== stat issue.json ===")
|
|
result = await ws.execute(f"stat {issue_path}/issue.json")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== jq .title issue.json ===")
|
|
result = await ws.execute(f'jq ".title" {issue_path}/issue.json')
|
|
print(await result.stdout_str())
|
|
|
|
print("=== jq .state_name issue.json ===")
|
|
result = await ws.execute(f'jq ".state_name" {issue_path}/issue.json')
|
|
print(await result.stdout_str())
|
|
|
|
print("=== tree -L 1 /linear/ ===")
|
|
result = await ws.execute("tree -L 1 /linear/")
|
|
print(await result.stdout_str())
|
|
|
|
print(f"=== tree -L 1 teams/{first_team} ===")
|
|
result = await ws.execute(f"tree -L 1 /linear/teams/{first_team}/")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== find issues -name '*.json' ===")
|
|
result = await ws.execute(
|
|
f'find /linear/teams/{first_team}/issues/ -name "*.json"'
|
|
" | head -n 5")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== find teams -type d (directory filter) ===")
|
|
result = await ws.execute(f"find /linear/teams/{first_team}/ -type d"
|
|
" | head -n 5")
|
|
print(await result.stdout_str())
|
|
|
|
# -path matches the display path; -size counts dirs and sizeless
|
|
# rendered files as 0 (so +0c drops them, -1k keeps them).
|
|
print("=== find team -path '*issues*' ===")
|
|
result = await ws.execute(f'find /linear/teams/{first_team}/'
|
|
f' -path "*issues*" | head -n 5')
|
|
print(await result.stdout_str())
|
|
|
|
print("=== find team -maxdepth 1 -size +0c (dirs drop out) ===")
|
|
result = await ws.execute(
|
|
f"find /linear/teams/{first_team}/ -maxdepth 1 -size +0c")
|
|
print(f" exit={result.exit_code}")
|
|
print(await result.stdout_str())
|
|
|
|
print(f"=== du -s teams/{first_team} (walk fallback) ===")
|
|
result = await ws.execute(f"du -s /linear/teams/{first_team}/")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== grep Mirage issue.json ===")
|
|
result = await ws.execute(f'grep Mirage {issue_path}/issue.json')
|
|
print(await result.stdout_str())
|
|
|
|
print("=== rg Backlog team.json ===")
|
|
result = await ws.execute(
|
|
f"rg Backlog /linear/teams/{first_team}/team.json")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== basename ===")
|
|
result = await ws.execute(f"basename {issue_path}/issue.json")
|
|
print(await result.stdout_str())
|
|
|
|
print("=== dirname ===")
|
|
result = await ws.execute(f"dirname {issue_path}/issue.json")
|
|
print(await result.stdout_str())
|
|
|
|
# ── glob expansion (exercises resolve_glob → readdir) ──
|
|
issues_dir = f"/linear/teams/{first_team}/issues"
|
|
print(f"=== echo {issues_dir}/* (glob) ===")
|
|
r = await ws.execute(f"echo {issues_dir}/*")
|
|
out = (await r.stdout_str()).strip()
|
|
print(f" {out[:200]}")
|
|
|
|
print(f"\n=== for f in {issues_dir}/* (glob loop) ===")
|
|
r = await ws.execute(f"for f in {issues_dir}/*; do echo found:$f; done"
|
|
" | head -n 3")
|
|
out = (await r.stdout_str()).strip()
|
|
for line in out.splitlines():
|
|
print(f" {line[:120]}")
|
|
|
|
# ── mid-path glob: the team segment is the pattern, the literal
|
|
# tail keeps walking (lists teams once, then filters).
|
|
print("\n=== echo /linear/teams/*/issues (mid-path glob) ===")
|
|
r = await ws.execute("echo /linear/teams/*/issues")
|
|
out = (await r.stdout_str()).strip()
|
|
print(f" {out[:200]}")
|
|
assert out.endswith("/issues"), "mid-path glob did not expand"
|
|
|
|
# A glob that matches nothing stays the literal word, so the
|
|
# command reports it like GNU coreutils.
|
|
print("\n=== cat /linear/teams/zz-none-*/team.json (no match) ===")
|
|
r = await ws.execute("cat /linear/teams/zz-none-*/team.json")
|
|
err = (await r.stderr_str()).strip()
|
|
print(f" exit={r.exit_code} {err[:120]}")
|
|
assert r.exit_code == 1 and "zz-none-*" in err
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|