This document outlines all breaking changes introduced in CTBase v0.18.0-beta compared to v0.17.4. Use this guide to migrate your code and understand the impact of these changes.
- Exception System Overhaul
- Module Reorganization
- Extension System Introduction
- Documentation Generation Changes
- TestRunner Enhancements
- API Changes
- Dependency Updates
- Migration Guide
- Version stabilization: Bumped from 0.18.6-beta to 0.18.7 for stable release. No functional changes; version promotion only.
- Code formatting: Applied JuliaFormatter to ensure consistent code style across the codebase. No functional changes; formatting only.
- CI improvements: Enhanced CompatHelper workflow with subdirs input for better dependency management. No functional changes; CI infrastructure only.
- No breaking changes. No migration required.
- Documenter Color Support: Added ANSI escape sequence support for exception display colors in generated documentation. Replaced
printstyledcalls with ANSI equivalents to enable automatic conversion to CSS classes by Documenter. No API changes; purely internal implementation improvement. No migration required. - Version bump to 0.18.6-beta for feature enhancement. No breaking changes. No migration required.
- Documentation reference fixes: removed unnecessary
@refmacros from cross-references in docstrings across multiple modules and extensions. No API changes; purely documentation improvement. No migration required. - Version bump to 0.18.5 for maintenance release. No functional changes. No migration required.
- Test artifacts cleanup: removed
test/extras/andtest/src/directories containing demo scripts and temporary build artifacts. No API changes; purely repository hygiene. No migration required. - Enhanced TestRunner internal documentation with comprehensive docstrings for helper functions. No functional changes; documentation only. No migration required.
- TestRunner progress bar now keeps full resolution up to 50 tests (previously 20) with cumulative coloring; compressed mode beyond 50 retains uniform bar. No breaking API change; purely visual behavior. No migration required.
The entire exception system has been redesigned with enhanced types and richer context. While most existing exception types are preserved, their constructors and internal structure have changed.
# v0.17.4
throw(CTBase.UnauthorizedCall("message"))
# v0.18.0-beta
throw(CTBase.PreconditionError("message"))All exceptions now support optional keyword arguments for enhanced context:
# v0.17.4
throw(CTBase.IncorrectArgument("message"))
# v0.18.0-beta (backward compatible)
throw(CTBase.IncorrectArgument("message"))
# v0.18.0-beta (enhanced version)
throw(CTBase.IncorrectArgument(
"message";
got="actual_value",
expected="expected_value",
suggestion="how to fix",
context="where it happened"
))Exceptions now have additional fields that may affect code using reflection:
# v0.17.4
struct IncorrectArgument <: CTException
var::String
end
# v0.18.0-beta
struct IncorrectArgument <: CTException
msg::String
got::Union{String, Nothing}
expected::Union{String, Nothing}
suggestion::Union{String, Nothing}
context::Union{String, Nothing}
end- Low Impact: Most existing
throwcalls will continue to work - Medium Impact: Code that inspects exception fields may need updates
- High Impact: Code that specifically catches
UnauthorizedCallneeds updates
The monolithic source structure has been replaced with a modular architecture. This affects internal module organization but preserves the public API.
# src/CTBase.jl
module CTBase
# All code in single file or directly included
include("exception.jl")
include("description.jl")
include("default.jl")
include("utils.jl")
end# src/CTBase.jl
module CTBase
# Modular organization
include("Exceptions/Exceptions.jl")
include("Core/Core.jl")
include("Unicode/Unicode.jl")
include("Descriptions/Descriptions.jl")
include("Extensions/Extensions.jl")
endNew Internal Modules:
CTBase.Exceptions: Enhanced exception systemCTBase.Core: Fundamental types and utilitiesCTBase.Unicode: Unicode character utilitiesCTBase.Descriptions: Description managementCTBase.Extensions: Extension system
- Low Impact: Public API remains unchanged
- Medium Impact: Code accessing internal module structure may break
- High Impact: Code that used
using CTBase: InternalModulepatterns
Several functions that previously had default implementations now require explicit extensions to be loaded.
# v0.17.4 - Had basic implementation
CTBase.automatic_reference_documentation()
# v0.18.0-beta - Requires extension
using CTBase.Extensions.DocumenterReference
CTBase.automatic_reference_documentation()# v0.17.4 - Had basic implementation
CTBase.postprocess_coverage()
# v0.18.0-beta - Requires extension
using CTBase.Extensions.CoveragePostprocessing
CTBase.postprocess_coverage()# v0.17.4 - Had basic implementation
CTBase.run_tests()
# v0.18.0-beta - Requires extension
using CTBase.Extensions.TestRunner
CTBase.run_tests()Attempting to use these functions without loading extensions now throws ExtensionError:
julia> CTBase.automatic_reference_documentation()
ERROR: ExtensionError. Please make: julia> using Documenter, Markdown, MarkdownAST- Medium Impact: Code using these functions needs extension loading
- Low Impact: Clear error messages guide users to solution
- Documentation: All affected functions are well-documented
The DocumenterReference extension has been significantly enhanced with new customization capabilities.
The API documentation title system has been standardized:
# v0.18.0-beta (variable titles)
# Different pages had inconsistent title patterns
# v0.18.0-beta.1 (standardized)
# All API pages consistently use:
# - "Public API" for exported functions
# - "Private API" for internal functionsAPI documentation generation now supports customizable titles and descriptions:
# v0.18.0-beta (fixed titles)
automatic_reference_documentation() # Used default titles
# v0.18.0-beta.1 (customizable)
automatic_reference_documentation(;
public_title="Custom Public API",
private_title="Internal Functions",
public_description="Custom description for public API",
private_description="Custom description for private API"
)- Low Impact: Existing code continues to work with defaults
- Medium Impact: Code relying on specific title patterns may need updates
- Enhancement: New customization provides better documentation control
Exception display formatting has changed significantly:
# v0.17.4
ERROR: IncorrectArgument: message
# v0.18.0-beta
β IncorrectArgument: messageSome internal types have been formalized:
# v0.17.4 - Implicit usage
Tuple{Vararg{Symbol}}
# v0.18.0-beta - Explicit alias
CTBase.DescVarArgUnicode functions are now in a dedicated module:
# v0.17.4 - Direct access
CTBase.ctindice(1)
# v0.18.0-beta - Still works (re-exported)
CTBase.ctindice(1)
# v0.18.0-beta - Direct module access
CTBase.Unicode.ctindice(1)The TestRunner extension has been significantly enhanced with advanced capabilities for test execution and progress tracking.
The progress bar implementation has been completely rewritten with adaptive width:
# v0.18.0-beta (basic progress)
[ββββββββββββββββββββββ] β [08/19] suite/exceptions/test_display.jl (2.5s)
# v0.18.0-beta.1 (adaptive width)
[ββββββββββββββββββ] β [08/19] suite/exceptions/test_display.jl (2.5s)
[ββββββββββββββββββββ] β [19/19] suite/exceptions/test_exceptions.jl (0.6s)The failure detection mechanism is now more robust and accurate:
# v0.18.0-beta (unreliable)
# @test failures sometimes showed as success
# v0.18.0-beta.1 (robust detection)
# Correctly detects both exceptions and @test assertion failuresUsers can now use test/suite and suite interchangeably:
# v0.18.0-beta (explicit paths required)
julia --project -e 'using Pkg; Pkg.test(; test_args=["suite/exceptions"])'
# v0.18.0-beta.1 (automatic stripping)
julia --project -e 'using Pkg; Pkg.test(; test_args=["test/suite"])' # Same resultThe callback system has been enhanced with rich context information:
# v0.18.0-beta (basic callbacks)
on_test_done = info -> println("Done: $(info.status)")
# v0.18.0-beta.1 (rich context)
on_test_done = info -> begin
if info.status == :error || info.status == :test_failed
println("β FAILED: $(info.spec)")
else
println("β Success: $(info.spec)")
end
endThe system now prevents ambiguous directory structures:
# v0.18.0-beta (allowed)
test/
βββ test/ # This would cause ambiguity with prefix stripping
# v0.18.0-beta.1 (protected)
ERROR: A subdirectory "test" exists inside the test directoryPath prefix stripping behavior has been standardized:
# v0.18.0-beta (explicit paths required)
julia --project -e 'using Pkg; Pkg.test(; test_args=["suite/exceptions"])'
# v0.18.0-beta.1 (automatic stripping)
julia --project -e 'using Pkg; Pkg.test(; test_args=["test/suite"])' # Same resultNote: The test/ prefix is now automatically stripped, making both forms equivalent.
All TestRunner functions now follow the project's documentation standards:
"""
$(TYPEDSIGNATURES)
Run tests with configurable file/function name builders...
# Arguments
- `args::AbstractVector{<:AbstractString}`: Command-line arguments...All internal references now use fully qualified names to prevent header conflicts:
# v0.18.0-beta (conflicts)
See also: `TestRunInfo` # Header conflicts
# v0.18.0-beta.1 (resolved)
See also: `TestRunner.TestRunInfo`# v0.17.4
julia = "1.8"
# v0.18.0-beta
julia = "1.10"# v0.18.0-beta additions
Aqua = "0.8"
OrderedCollections = "1"- Medium Impact: Projects on Julia < 1.10 cannot upgrade
- Low Impact: New dependencies are test-only
- Justification: Julia 1.10 provides better stability and performance
Find and replace UnauthorizedCall:
# In your codebase
find . -name "*.jl" -exec sed -i 's/UnauthorizedCall/PreconditionError/g' {} \;Update exception field access:
# Before
catch e
if e isa IncorrectArgument
println(e.var) # Direct field access
end
end
# After
catch e
if e isa IncorrectArgument
println(e.msg) # Use new field name
end
endAdd extension loading to your code:
# For documentation generation
using CTBase
using CTBase.Extensions.DocumenterReference
# For test coverage
using CTBase
using CTBase.Extensions.CoveragePostprocessing
# For advanced testing
using CTBase
using CTBase.Extensions.TestRunnerUpdate your project's compat requirements:
[compat]
julia = "1.10"Run comprehensive tests:
using CTBase
using CTBase.Extensions.TestRunner
# Test all functionality
CTBase.run_tests()function test_exception_migration()
# Test old-style constructors still work
e1 = CTBase.IncorrectArgument("test message")
@test e1.msg == "test message"
# Test new enhanced constructors
e2 = CTBase.IncorrectArgument("test"; got="bad", expected="good")
@test e2.got == "bad"
@test e2.expected == "good"
endfunction test_extension_loading()
# Test that extensions work
using CTBase.Extensions.TestRunner
@test_nowarn CTBase.run_tests(dry_run=true)
endProblem: ExtensionError when using documentation functions
Solution:
# Add this to your code
using CTBase.Extensions.DocumenterReferenceProblem: Code accessing e.var on exceptions
Solution:
# Update field access
# Old: e.var
# New: e.msgProblem: Project still on Julia 1.8/1.9
Solution:
# Update Julia
juliaup update 1.10- Public API: All public function signatures remain the same
- Exception Types: All exception types still exist
- Core Functionality: Description management, Unicode helpers work unchanged
- Re-exports: Common functions remain available from
CTBase
- Exception Internals: Field structure and constructors enhanced
- Module Organization: Internal structure modularized
- Extension Points: Some functions now require explicit extensions
- Error Messages: Enhanced formatting and context
- Documentation: Updated for v0.18.0-beta
- Examples: See
test/extras/for migration examples - Issues: Report migration problems on GitHub
- Discussions: Ask questions in GitHub Discussions
If you encounter migration issues:
- Check this guide for common solutions
- Run the test suite to identify specific problems
- Open an issue with minimal reproduction
- Join discussions for community support
This breaking changes guide is comprehensive but not exhaustive. Test your migration thoroughly and report any undocumented issues.