Skip to content

Conversation

@wclausen-square
Copy link
Collaborator

Redo of #16. I didn't set the base branch correctly before merging 🤦

wclausen-square and others added 7 commits October 28, 2025 14:36
This commit adds the foundational types for artifact removal:
- ArtifactRemoverEvent models for analytics and results tracking
- LocalArtifactRepository interface and implementation for managing local Maven artifacts
- ArtifactRemoverEventStream interface for event reporting
- Supporting data classes: InstalledBom, InstalledProject, RepositoryStats

These provide the foundation for removing old artifacts from local Maven repositories.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
This commit adds the main artifact removal logic:
- ArtifactRemover class with removeArtifacts() method
- Parallel deletion of old BOMs and artifacts
- Retention policy (keeps most recent N BOMs by default)
- Repository measurement before and after cleanup
- Event logging for analytics

The remover identifies artifacts not present in recent BOMs and removes them
to free up disk space in the local Maven repository.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
This commit adds the Koin DI module for artifact remover:
- ArtifactRemoverConfig for configuration
- Module factory function artifactRemoverModules()
- Wiring for ArtifactRemoverEventStream, LocalArtifactRepository, and ArtifactRemover
- Extension properties for accessing dependencies

This completes the core artifact remover infrastructure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
This commit adds comprehensive test coverage for the remover:

Tests:
- ArtifactRemoverTest: 8 unit tests for the main remover logic

Test Utilities:
- FakeArtifactRemoverEventStream: Mock event stream for testing
- FakeLocalArtifactRepository: Mock local repository with configurable failures

Test coverage includes:
- Empty repository handling
- BOM retention policy
- Artifact deletion based on recent BOMs
- Deletion failure handling
- Repository measurement
- Event logging
- Custom retention counts
- Multiple BOMs with different versions

All tests pass successfully!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
This commit adds the CLI command for artifact removal:
- ArtifactRemoverCommand class extending AbstractArtifactSwapCommand
- Integration with core ArtifactRemover via dependency injection
- Configuration through ArtifactRemoverOptions
- Command-line interface using picocli annotations

The command examines the local m2 repository and removes artifacts
that are not needed based on the retention policy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
This commit adds integration tests for the CLI remover command:

Tests:
- ArtifactRemoverCommandTest: 2 integration tests verifying CLI argument parsing and remover execution

Test Utilities:
- FakeArtifactRemoverEventStream: Mock event stream
- FakeLocalArtifactRepository: Mock repository for CLI tests

Test coverage includes:
- CLI argument parsing (--maven-local-path)
- Command initialization and DI setup
- Artifact removal execution
- Event logging verification

All tests pass successfully!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@wclausen-square wclausen-square merged commit 2e095a7 into main Oct 31, 2025
3 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.

3 participants