feat: remove deprecated functions for v1.13.0 release#58
Conversation
This commit removes all deprecated package-level convenience functions in favor of the functional options API (*WithOptions) and struct-based methods, preparing for the v1.13.0 release. Breaking Changes: - Removed parser.Parse(), ParseReader(), ParseBytes() - Removed validator.Validate(), ValidateParsed() - Removed converter.Convert(), ConvertParsed() - Removed joiner.Join(), JoinParsed() - Removed differ.Diff(), DiffParsed() Migration: - Users should migrate to *WithOptions functional options API - Struct-based methods (New().Method()) remain unchanged - See MIGRATION_V1.12_TO_V1.13.md for detailed migration guide Changes: - Removed 11 deprecated package-level convenience functions - Removed 33 test/benchmark functions testing deprecated APIs - Updated remaining tests to use ParseWithOptions and struct methods - Renamed migration guide: MIGRATION_V1_TO_V2.md → MIGRATION_V1.12_TO_V1.13.md - Updated all version references from v2.0 to v1.13.0 - Added semantic versioning note to CLAUDE.md explaining the approach All tests pass (1,547 tests), code coverage maintained. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Split large parser_test.go into 6 focused test files to avoid token limits and improve maintainability. Added local Claude Code review workflow as replacement for GitHub Actions code review. Test File Organization: - parser_test.go (456 lines, 15 tests) - Core parsing tests - parser_options_test.go (343 lines, 23 tests) - Functional options API - parser_refs_test.go (340 lines, 5 tests) - Reference resolution - parser_validation_test.go (524 lines, 7 tests) - Validation tests - parser_url_test.go (524 lines, 8 tests) - URL parsing/fetching - parser_utils_test.go (338 lines, 5 tests) - Utility functions Local Code Review Setup: - scripts/local-code-review.sh - Manual code review script - Review uncommitted, staged, or branch changes - Uses Claude Code CLI for automated review - Provides feedback on quality, security, performance, testing - scripts/pre-push-hook - Git pre-push hook - Automatically reviews branch changes before push - Can be skipped with SKIP_REVIEW=1 or --no-verify - scripts/install-git-hooks.sh - One-time setup installer - Updated CLAUDE.md with local code review documentation Benefits: - Faster feedback during development (local vs GitHub Actions) - No GitHub Actions usage/costs for code review - Developers get immediate feedback before pushing - Can review changes at different stages (uncommitted/staged/branch) All 63 parser tests pass successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
==========================================
- Coverage 66.26% 65.87% -0.39%
==========================================
Files 42 42
Lines 7795 7752 -43
==========================================
- Hits 5165 5107 -58
- Misses 2079 2086 +7
- Partials 551 559 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR removes all deprecated package-level convenience functions (11 total) to prepare for the v1.13.0 release. The codebase is standardized on the *WithOptions functional options API pattern, which provides better clarity, flexibility, and extensibility. Additionally, the PR splits a large parser test file into 6 focused files for better maintainability and adds a local code review workflow using Claude Code CLI.
Key Changes:
- Removed 11 deprecated convenience functions across parser, validator, converter, joiner, and differ packages
- Split
parser/parser_test.go(2,495 lines) into 6 focused test files for better organization - Added local code review scripts and Git hooks for faster development feedback
- Updated migration guide to reflect v1.13.0 instead of v2.0.0
- Updated all tests and benchmarks to use the new
*WithOptionsAPI
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| validator/validator.go | Removed deprecated Validate() and ValidateParsed() convenience functions |
| validator/validator_test.go | Removed tests for deprecated convenience functions (279 lines) |
| validator/validator_bench_test.go | Removed benchmarks for deprecated convenience functions |
| parser/parser.go | Removed deprecated Parse(), ParseReader(), and ParseBytes() convenience functions |
| parser/parser_test.go | Reorganized core parsing tests (reduced from 2,495 to 456 lines) |
| parser/parser_validation_test.go | New file: validation-focused tests (524 lines) |
| parser/parser_url_test.go | New file: URL parsing tests (524 lines) |
| parser/parser_utils_test.go | New file: utility function tests (338 lines) |
| parser/parser_refs_test.go | New file: reference resolution tests (340 lines) |
| parser/parser_options_test.go | New file: functional options API tests (343 lines) |
| parser/parser_bench_test.go | Removed benchmarks for deprecated convenience functions |
| parser/parser_fuzz_test.go | Updated fuzz test to use ParseWithOptions() |
| parser/json_bench_test.go | Updated benchmarks to use ParseWithOptions() |
| parser/resolver_test.go | Updated tests to use ParseWithOptions() |
| joiner/joiner.go | Removed deprecated Join() and JoinParsed() convenience functions |
| joiner/joiner_test.go | Removed tests for deprecated convenience functions (384 lines) |
| joiner/joiner_bench_test.go | Removed benchmark for deprecated convenience function |
| differ/differ.go | Removed deprecated Diff() and DiffParsed() convenience functions |
| differ/differ_test.go | Removed tests for deprecated convenience functions (90 lines) |
| differ/differ_bench_test.go | Removed benchmarks for deprecated convenience functions |
| converter/converter.go | Removed deprecated Convert() and ConvertParsed() convenience functions |
| converter/converter_test.go | Removed tests for deprecated convenience functions (99 lines) |
| converter/converter_bench_test.go | Removed benchmarks for deprecated convenience functions |
| scripts/pre-push-hook | New Git pre-push hook for local code review |
| scripts/local-code-review.sh | New script for running local Claude Code review |
| scripts/install-git-hooks.sh | New script for installing Git hooks |
| MIGRATION_V1.12_TO_V1.13.md | Updated migration guide to reflect v1.13.0 release |
| CLAUDE.md | Added documentation for local code review workflow |
The Claude Code CLI is installed as 'claude', not 'claude-code'. Also updated the installation URL to the correct quickstart guide. Changes: - check_requirements() now checks for 'claude' command - Updated install URL to https://code.claude.com/docs/en/quickstart#step-1:-install-claude-code - Updated usage examples to use 'claude' instead of 'claude-code' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The Claude CLI doesn't have a --no-context flag. Use --print instead for non-interactive piped output. Tested with: ./scripts/local-code-review.sh branch Successfully performs code review and displays results. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
GitHub Actions runners can experience resource contention when running tests with higher parallelism, leading to transient hangs. Reducing parallelism to 1 ensures more consistent test execution. Changes: - Reduced -parallel flag from 2 to 1 - Tests still complete quickly (~20s) with lower parallelism - Prevents resource-related hangs in CI environment Trade-off: Slightly slower tests in CI, but much more reliable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
This PR removes all deprecated package-level convenience functions and prepares the codebase for the v1.13.0 release. It also splits large test files and adds a local code review workflow.
Breaking Changes
Removed Functions (11 total)
parser package:
Parse(specPath, resolveRefs, validateStructure)→ UseParseWithOptions(WithFilePath(...), ...)ParseReader(reader, resolveRefs, validateStructure)→ UseParseWithOptions(WithReader(...), ...)ParseBytes(data, resolveRefs, validateStructure)→ UseParseWithOptions(WithBytes(...), ...)validator package:
Validate(specPath, includeWarnings, strictMode)→ UseValidateWithOptions(WithFilePath(...), ...)ValidateParsed(parseResult, includeWarnings, strictMode)→ UseValidateWithOptions(WithParsed(...), ...)converter package:
Convert(specPath, targetVersion)→ UseConvertWithOptions(WithFilePath(...), WithTargetVersion(...))ConvertParsed(parseResult, targetVersion)→ UseConvertWithOptions(WithParsed(...), WithTargetVersion(...))joiner package:
Join(specPaths, config)→ UseJoinWithOptions(WithFilePaths(...), WithConfig(...))JoinParsed(parsedDocs, config)→ UseJoinWithOptions(WithParsedDocs(...), WithConfig(...))differ package:
Diff(sourcePath, targetPath)→ UseDiffWithOptions(WithSourceFilePath(...), WithTargetFilePath(...))DiffParsed(source, target)→ UseDiffWithOptions(WithSourceParsed(...), WithTargetParsed(...))Migration Impact
New().Method()patterns remain fully supportedMIGRATION_V1.12_TO_V1.13.mdRationale for v1.13.0 (Minor) instead of v2.0.0 (Major)
While this is technically a breaking change, we're releasing as v1.13.0 instead of v2.0.0 because:
See CLAUDE.md for the full rationale. Future breaking changes will follow semantic versioning more strictly.
Test File Improvements
Split
parser/parser_test.go(2,495 lines) into 6 focused files:parser_test.go(456 lines, 15 tests) - Core parsingparser_options_test.go(343 lines, 23 tests) - Functional options APIparser_refs_test.go(340 lines, 5 tests) - Reference resolutionparser_validation_test.go(524 lines, 7 tests) - Validationparser_url_test.go(524 lines, 8 tests) - URL operationsparser_utils_test.go(338 lines, 5 tests) - UtilitiesBenefits: Better organization, maintainability, and avoids token limits for AI tools.
Local Code Review Workflow
Added local code review workflow as replacement for GitHub Actions:
New scripts:
scripts/local-code-review.sh- Manual code review using Claude Code CLIscripts/pre-push-hook- Git pre-push hook for automated reviewscripts/install-git-hooks.sh- One-time setup installerBenefits:
Usage:
Test Plan
make checkpasses (linting, formatting, tests)Checklist
go fmt)🤖 Generated with Claude Code