-
Notifications
You must be signed in to change notification settings - Fork 55
L/small fixes 3 #320
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
L/small fixes 3 #320
Conversation
| normalized = normalized.replace(" ", "-").replace("_", "-") | ||
| normalized = re.sub(r"[^a-z0-9-]", "", normalized) | ||
| normalized = re.sub(r"-+", "-", normalized) | ||
| return normalized.strip("-") or "converted" |
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.
Duplicated name normalization logic across files
Low Severity
_normalize_name in harbor.py is a near-exact copy of normalize_environment_name in hud/cli/utils/environment.py (and Environment._normalize_name). The only difference is the empty-string fallback ("converted" vs "environment"). This duplicated normalization logic increases maintenance risk — a fix in one copy could be missed in the others. The existing utility could be reused with the fallback handled at the call site.
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| adapted.append(f"# [harbor original] {line}") | ||
| else: | ||
| adapted.append(line) | ||
| return "\n".join(adapted) |
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.
Multi-line CMD/ENTRYPOINT leaves orphaned continuation lines
Medium Severity
_adapt_harbor_dockerfile does line-by-line matching and only comments out the first line of a multi-line CMD or ENTRYPOINT instruction that uses backslash continuation. The continuation lines (e.g., "-c", \) remain as bare, invalid Dockerfile instructions, causing Docker build failures for any Harbor task whose Dockerfile uses multi-line CMD/ENTRYPOINT.


Note
Medium Risk
Adds new CLI workflows and modifies core scenario argument deserialization plus MCP transport patching; mistakes could break task execution or cause new failure modes in client/server communication.
Overview
Adds a new, pluggable
hud convertcommand that converts Harbor-style task directories/datasets into HUD-ready output: generatedenv.py,Dockerfile.hud,pyproject.toml, copied task assets/build context, and a v5taskset.json(with auto-detect and optional interactive format selection).Extends deployment with
hud deploy --allto discover and sequentially deploy all environment subdirectories in a converted output folder, and updates docs to reflect the new convert/deploy workflow.Includes robustness fixes: scenario arg deserialization now avoids mis-coercing
Literal["0", ...]values and falls back safely when annotations can’t be resolved; MCP streamable HTTP transport is patched to re-raise JSON response handling errors to prevent hangs; version bumps to0.5.21with new tests covering the converter and Literal deserialization edge cases.Written by Cursor Bugbot for commit b6dab5e. This will update automatically on new commits. Configure here.