Skip to content

Commit 2ee6c9f

Browse files
kongchen1992meta-codesync[bot]
authored andcommitted
{Feature} Project Aria Plugins - Add Gemini CI validation and remove redundant smoke test
Summary: Two CI housekeeping changes: 1. Add `gemini-extension.json` validation to `validate_marketplace.py`, closing the coverage gap for the Gemini CLI extension added in D106684288. Checks that the file exists, has required `name` and `contextFileName` fields, and that `contextFileName` points to an existing file. 2. Remove `smoke-test.yml` — it runs the exact same three validation scripts that `validate.yml` already runs on every PR and push. ___ Differential Revision: D106689928 fbshipit-source-id: cc1a4bfba649fc1a62a6111e2fc51ea893c5461f
1 parent 99eb6be commit 2ee6c9f

2 files changed

Lines changed: 40 additions & 63 deletions

File tree

.github/workflows/smoke-test.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

scripts/validate_marketplace.py

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
6. Plugin names are unique across each marketplace.
2020
7. Plugin manifest `name` matches the marketplace entry `name`.
2121
8. Each plugin has README.md.
22+
9. `gemini-extension.json` is valid JSON with required fields and its
23+
`contextFileName` points to an existing file.
2224
"""
2325

2426
from __future__ import annotations
@@ -33,6 +35,7 @@
3335
CLAUDE_MARKETPLACE_JSON = REPO_ROOT / ".claude-plugin" / "marketplace.json"
3436
CLAUDE_SCHEMAS_DIR = REPO_ROOT / ".claude-plugin" / "schemas"
3537
CODEX_MARKETPLACE_JSON = REPO_ROOT / ".agents" / "plugins" / "marketplace.json"
38+
GEMINI_EXTENSION_JSON = REPO_ROOT / "gemini-extension.json"
3639
CODEX_INSTALLATION_POLICIES = {
3740
"NOT_AVAILABLE",
3841
"AVAILABLE",
@@ -291,23 +294,55 @@ def _validate_codex_marketplace(errors: list[str]) -> int:
291294
return len(plugin_names_seen)
292295

293296

297+
def _validate_gemini_extension(errors: list[str]) -> bool:
298+
ext = _load_json(GEMINI_EXTENSION_JSON, errors)
299+
if ext is None:
300+
return False
301+
302+
start = len(errors)
303+
label = "gemini-extension.json"
304+
for field in ("name", "contextFileName"):
305+
_expect_string(ext, field, label, errors)
306+
307+
context_file = ext.get("contextFileName")
308+
if isinstance(context_file, str) and context_file:
309+
context_path = (REPO_ROOT / context_file).resolve()
310+
try:
311+
context_path.relative_to(REPO_ROOT)
312+
except ValueError:
313+
_fail(
314+
f"{label}: contextFileName {context_file!r} escapes repo root",
315+
errors,
316+
)
317+
return len(errors) == start
318+
if not context_path.is_file():
319+
_fail(
320+
f"{label}: contextFileName {context_file!r} does not exist",
321+
errors,
322+
)
323+
return len(errors) == start
324+
325+
294326
def main() -> int:
295327
errors: list[str] = []
296328

297329
claude_plugin_count = _validate_claude_marketplace(errors)
298330
codex_plugin_count = _validate_codex_marketplace(errors)
331+
gemini_ok = _validate_gemini_extension(errors)
299332

300333
if errors:
301334
print(f"\n{len(errors)} marketplace validation error(s):\n", file=sys.stderr)
302335
for e in errors:
303336
print(f" - {e}", file=sys.stderr)
304337
return 1
305338

306-
print(
307-
"✅ marketplace manifests OK "
308-
f"({claude_plugin_count} Claude plugin(s), "
309-
f"{codex_plugin_count} Codex plugin(s) validated)"
310-
)
339+
parts = [
340+
f"{claude_plugin_count} Claude plugin(s)",
341+
f"{codex_plugin_count} Codex plugin(s)",
342+
]
343+
if gemini_ok:
344+
parts.append("Gemini extension")
345+
print(f"✅ marketplace manifests OK ({', '.join(parts)} validated)")
311346
return 0
312347

313348

0 commit comments

Comments
 (0)