-
Notifications
You must be signed in to change notification settings - Fork 76
fix: batch bug fixes -- installer fallback, target registry, lockfile idempotency #456
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
Changes from all commits
ff4e5ce
e68e514
fa953c6
0f04fce
cecd437
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -874,12 +874,20 @@ def _log_integration(msg): | |
| package_info, project_root, | ||
| diagnostics=diagnostics, managed_files=managed_files, force=force, | ||
| ) | ||
| # Build human-readable list of target dirs from deployed paths | ||
| _skill_target_dirs: set[str] = set() | ||
| for tp in skill_result.target_paths: | ||
| rel = tp.relative_to(project_root) | ||
| if rel.parts: | ||
| _skill_target_dirs.add(rel.parts[0]) | ||
| _skill_targets = sorted(_skill_target_dirs) | ||
| _skill_target_str = ", ".join(f"{d}/skills/" for d in _skill_targets) or "skills/" | ||
| if skill_result.skill_created: | ||
| result["skills"] += 1 | ||
| _log_integration(f" └─ Skill integrated -> .github/skills/") | ||
| _log_integration(f" |-- Skill integrated -> {_skill_target_str}") | ||
| if skill_result.sub_skills_promoted > 0: | ||
| result["sub_skills"] += skill_result.sub_skills_promoted | ||
| _log_integration(f" └─ {skill_result.sub_skills_promoted} skill(s) integrated -> .github/skills/") | ||
| _log_integration(f" |-- {skill_result.sub_skills_promoted} skill(s) integrated -> {_skill_target_str}") | ||
| for tp in skill_result.target_paths: | ||
| deployed.append(tp.relative_to(project_root).as_posix()) | ||
|
|
||
|
|
@@ -1302,19 +1310,21 @@ def _collect_descendants(node, visited=None): | |
| # Get config target from apm.yml if available | ||
| config_target = apm_package.target | ||
|
|
||
| # Auto-create .github/ if neither .github/ nor .claude/ exists. | ||
| # Per skill-strategy Decision 1, .github/skills/ is the standard skills location; | ||
| # creating .github/ here ensures a consistent skills root and also enables | ||
| # VSCode/Copilot integration by default (quick path to value), even for | ||
| # projects that don't yet use .claude/. | ||
| github_dir = project_root / GITHUB_DIR | ||
| claude_dir = project_root / CLAUDE_DIR | ||
| if not github_dir.exists() and not claude_dir.exists(): | ||
| github_dir.mkdir(parents=True, exist_ok=True) | ||
| if logger: | ||
| logger.verbose_detail( | ||
| "Created .github/ as standard skills root (.github/skills/) and to enable VSCode/Copilot integration" | ||
| ) | ||
| # Ensure auto_create targets exist. | ||
| # Copilot (.github) has auto_create=True -- it is always created so | ||
| # there is a guaranteed skills root even for greenfield projects. | ||
| from apm_cli.integration.targets import active_targets as _active_targets | ||
|
|
||
| _targets = _active_targets(project_root) | ||
| for _t in _targets: | ||
| if _t.auto_create: | ||
| _target_dir = project_root / _t.root_dir | ||
| if not _target_dir.exists(): | ||
| _target_dir.mkdir(parents=True, exist_ok=True) | ||
| if logger: | ||
| logger.verbose_detail( | ||
| f"Created {_t.root_dir}/ ({_t.name} target)" | ||
| ) | ||
|
Comment on lines
+1313
to
+1327
|
||
|
|
||
| detected_target, detection_reason = detect_target( | ||
| project_root=project_root, | ||
|
|
@@ -2109,9 +2119,16 @@ def _collect_descendants(node, visited=None): | |
| existing.add_dependency(dep) | ||
| lockfile = existing | ||
|
|
||
| lockfile.save(lockfile_path) | ||
| if logger: | ||
| logger.verbose_detail(f"Generated apm.lock.yaml with {len(lockfile.dependencies)} dependencies") | ||
| # Only write when the semantic content has actually changed | ||
| # (avoids generated_at churn in version control). | ||
| existing_lockfile = LockFile.read(lockfile_path) if lockfile_path.exists() else None | ||
| if existing_lockfile and lockfile.is_semantically_equivalent(existing_lockfile): | ||
| if logger: | ||
| logger.verbose_detail("apm.lock.yaml unchanged -- skipping write") | ||
| else: | ||
| lockfile.save(lockfile_path) | ||
| if logger: | ||
| logger.verbose_detail(f"Generated apm.lock.yaml with {len(lockfile.dependencies)} dependencies") | ||
| except Exception as e: | ||
| _lock_msg = f"Could not generate apm.lock.yaml: {e}" | ||
| diagnostics.error(_lock_msg) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These skill integration tree lines use a different ASCII prefix ("|--") than the rest of the install integration output in this function (which uses "└─"). This makes the output formatting inconsistent; consider standardizing on one prefix (preferably ASCII everywhere if following the encoding rule) and updating all related tree_item call sites accordingly.