Skip to content

Sync from atlab fork#21

Merged
eywalker merged 14 commits into
nauticalab:mainfrom
atlab:main
Oct 27, 2025
Merged

Sync from atlab fork#21
eywalker merged 14 commits into
nauticalab:mainfrom
atlab:main

Conversation

@eywalker
Copy link
Copy Markdown
Contributor

This pull request focuses on improving configuration parsing, validation, and test coverage for developer environment configuration files. The changes enhance how resource units (CPU/memory) are handled and validated, provide stricter and clearer SSH key normalization, and significantly expand and clarify the test suite for configuration loading and error handling.

Resource normalization and summary improvements:

  • Updated the formatting and display of CPU and memory resources in the configuration summary, ensuring canonical Kubernetes-style units (e.g., "4000m" for CPU) are used and only non-zero values are shown.
  • Adjusted test expectations and configuration parsing to treat CPU as an integer and memory as a string, with test outputs reflecting the new canonical units. [1] [2] [3]

SSH key normalization and validation:

  • Added a new normalizeSSHKeys function to robustly handle SSH keys provided as a string, string array, or YAML array, with strict validation against empty or malformed entries.

Test suite enhancements:

  • Greatly expanded and clarified tests in parser_test.go to cover:
    • Canonical resource formatting and merging of global/user configs.
    • SSH key merging, validation, and error cases (missing, malformed, or empty keys).
    • Error handling for invalid YAML and resource values (e.g., non-integer CPU). [1] [2] [3] [4]
  • Improved test naming and assertions for clarity and robustness, including more precise error message checks and better coverage of default values.

General code hygiene:

  • Consistently used octal file permissions (e.g., 0o644, 0o755) for file and directory creation in tests. [1] [2] [3] [4]
  • Added missing imports (strings) where needed for new normalization and formatting logic. [1] [2] [3]

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 83.05785% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/config/validation.go 58.49% 16 Missing and 6 partials ⚠️
cmd/devenv/generate.go 0.00% 11 Missing ⚠️
internal/config/parser.go 88.23% 2 Missing and 2 partials ⚠️
internal/config/resources.go 96.74% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@eywalker eywalker merged commit 41d5852 into nauticalab:main Oct 27, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants