bump-spectra
Bump the spectra dependency to the latest version from hex.pm and verify compatibility.
Instructions
You are tasked with updating the spectra Erlang library dependency to the latest version. Since Spectral is a thin Elixir wrapper around spectra, this is a critical operation that requires careful verification.
Steps to Follow
- •
Check Current Version
- •Read
mix.exsto identify the current spectra version requirement - •Note the current version constraint (e.g.,
~> 0.3.0)
- •Read
- •
Fetch Latest Version from Hex.pm
- •Use
mix hex.info spectrato get information about the latest available version - •Alternatively, fetch from https://hex.pm/api/packages/spectra to get version information
- •Identify the latest stable version (non-pre-release)
- •Use
- •
Review Changelog/Release Notes
- •Check for breaking changes in the spectra releases between the current and target versions
- •Look for:
- •API changes that might affect the wrapper functions
- •New features that could be exposed through the Spectral wrapper
- •Deprecations or removed functionality
- •Bug fixes that might affect behavior
- •
Update Dependencies
- •In
mix.exs, locate the:spectradependency entry (for example, a line starting with{:spectra, ...}) and update its version constraint to the desired~> X.Y.Zvalue - •Update the installation example in
README.mdif the major/minor version changes - •Run
mix deps.getto fetch the new version - •Run
mix deps.update spectrato ensure the dependency is updated
- •In
- •
Verify Wrapper Compatibility Check if the Spectral wrapper modules need updates:
- •
lib/spectral.ex: Review ifencode/4,decode/4, andschema/3still properly delegate to:spectra - •
lib/spectral/openapi.ex: Verify OpenAPI builder functions still work with:spectra_openapi - •Look for:
- •New functions in spectra that should be exposed
- •Changed function signatures
- •New options or parameters that should be supported
- •Deprecated functions that need migration
- •
- •
Update Documentation
- •Check if
README.mdneeds updates for:- •New features from spectra
- •Changed behavior or limitations
- •Updated examples
- •Version numbers in installation instructions
- •Update
CLAUDE.mdif architectural changes are needed
- •Check if
- •
Run Tests and Checks Execute the following commands in sequence:
bashmix format mix compile --force mix test mix credo mix dialyzer
If any tests fail:
- •Investigate the root cause
- •Determine if it's a breaking change in spectra
- •Update the wrapper code or tests as needed
- •Re-run the test suite
- •
Final Verification
- •Ensure all tests pass
- •Verify the code is properly formatted
- •Check that no new warnings appear
- •Review the changes you've made
- •
Summary Report Provide a summary including:
- •Old version → New version
- •List of files modified
- •Any breaking changes discovered
- •Any new features that could be exposed
- •Any wrapper code changes made
- •Test results
- •Recommendations for follow-up work (if any)
Important Notes
- •Always run tests: The test suite includes doctests, so ensure all examples in documentation still work
- •Check for new functionality: spectra might have added new features worth exposing in Spectral
- •Maintain backward compatibility: Try to avoid breaking changes in the Spectral wrapper unless necessary
- •Type safety: Ensure type specifications remain accurate after the update
- •Format first: Always run
mix formatbefore running tests
Error Handling
If you encounter errors:
- •Compilation errors: The API likely changed; investigate the spectra changelog and update wrapper code
- •Test failures: Compare behavior changes and decide if tests or code need updating
- •Dependency conflicts: Check if other dependencies need updating for compatibility
- •Type errors (dialyzer): Type specifications might need adjustment based on spectra changes
Success Criteria
The update is successful when:
- •The latest stable version of spectra is specified in mix.exs
- •All tests pass (
mix test) - •No compilation warnings or errors
- •Code is properly formatted (
mix format) - •Documentation is updated to reflect any changes
- •A clear summary of changes has been provided