From a3388bf3e1786b1f2ad61a4794691e2e0c7e7207 Mon Sep 17 00:00:00 2001 From: Michael Wegener Date: Sun, 19 Jul 2026 23:44:22 +0200 Subject: [PATCH] fix(bundle): reuse hostname local in _require_https guard Post-merge cleanup from PR #87 (upstream v0.13.0 sync). Two minor non-blocking items noted in review (#88): 1. src/specify_cli/commands/bundle/__init__.py:829 - use the `hostname` local captured in the try block instead of re-accessing `parsed.hostname` in the final guard, mirroring the sibling fix in src/specify_cli/presets/__init__.py:2093. Behavior unchanged (ParseResult is immutable for a given URL); this is a consistency cleanup to prevent drift in future refactors. 2. docs/reference/extensions.md - add blank lines after the closing code fence (line 180) and after the hook-fields table (line 227) in the new "Project Extension and Hook Configuration" section to satisfy CommonMark block separation. Tests: 651 passed in tests/unit/test_bundle_download_url.py + tests/test_workflows.py (acceptance criterion from #88). Closes #88 Assisted-by: opencode z-ai/glm-5.2 (autonomous) --- docs/reference/extensions.md | 2 ++ src/specify_cli/commands/bundle/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/reference/extensions.md b/docs/reference/extensions.md index 783b17888d..3dc40a53c9 100644 --- a/docs/reference/extensions.md +++ b/docs/reference/extensions.md @@ -178,6 +178,7 @@ Spec Kit stores project-level extension registration and hook configuration in: ```text .specify/extensions.yml ``` + The file contains installed extensions, global settings, and hooks that are surfaced before or after Spec Kit commands. ```yaml @@ -225,6 +226,7 @@ Each hook entry supports the following fields: | `prompt` | Message shown when asking whether to run an optional hook. | | `description` | Human-readable explanation of what the hook does. | | `condition` | Optional expression evaluated by `HookExecutor` (using `config.` or `env.` with `is set`, `==`, or `!=`). Current command templates do not evaluate conditions and skip hooks with a non-empty condition. | + Hook event names identify when a hook is invoked. They generally use `before_` or `after_`, such as `before_implement`, `after_implement`, `before_tasks`, and `after_tasks`. `HookExecutor.get_hooks_for_event()` returns hooks ordered by `priority`, with lower values first. However, current command templates read hook lists directly and surface them in their configured YAML order rather than using priority ordering. diff --git a/src/specify_cli/commands/bundle/__init__.py b/src/specify_cli/commands/bundle/__init__.py index d8fb22e511..6a2bd25583 100644 --- a/src/specify_cli/commands/bundle/__init__.py +++ b/src/specify_cli/commands/bundle/__init__.py @@ -826,7 +826,7 @@ def _require_https(label: str, url: str) -> None: raise BundlerError( f"Refusing to download {label} over non-HTTPS URL: {url}" ) - if not parsed.hostname: + if not hostname: raise BundlerError(f"Refusing to download {label} from URL with no host: {url}")