Skip to content

refactor: implement terraform module dependency parser and enhance type system #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 10, 2025

Conversation

virgofx
Copy link
Member

@virgofx virgofx commented Jun 9, 2025

This pull request includes updates to improve the handling of Terraform modules, streamline test cases, and enhance documentation. Key changes include refactoring module-related functions, updating tests to use mock helpers, and clarifying input parameter descriptions in the documentation.

Key Changes

🏗️ Type System Reorganization

  • Moved types from index.ts to dedicated type files for better organization
  • Created specialized type files:
    • common.types.ts - Shared interfaces like ModuleInfo and ChangeInfo
    • config.types.ts - Configuration-related types
    • context.types.ts - Workspace context types
    • github.types.ts - GitHub API related types
    • wiki.types.ts - Wiki-specific types
    • node-child-process.types.ts - Node.js process types

🔍 New Terraform Module Parser

  • Added dedicated parser.ts with comprehensive Terraform module parsing capabilities
  • Implemented buildModuleDependencyGraph() for tracking local module dependencies
  • Added getModulesToRelease() to determine release propagation based on dependencies
  • Enhanced dependency-aware module release logic

🔧 Enhanced Core Functionality

  • Updated main.ts to use new parser and enhanced module handling
  • Improved configuration handling with better type safety
  • Enhanced changelog generation with dependency-aware logic
  • Updated pull request commenting with better module information
  • Improved release and tag management with new module system
  • Enhanced wiki functionality with better module organization
  • Removed deprecated semver utilities in favor of built-in logic

🧪 Comprehensive Test Coverage

  • Added extensive test coverage for new parser functionality
  • Updated all existing tests to work with new module system
  • Enhanced test fixtures and mocking for complex scenarios
  • Added test helpers for terraform module testing
  • Improved utility tests and removed deprecated test files

⚙️ Development Tooling & Configuration

  • Updated action.yml with new input parameters and improved documentation
  • Enhanced TypeScript configuration for better type checking
  • Added development scripts for parsing modules and testing workflows
  • Added test terraform modules (animal, zoo) for comprehensive testing scenarios
  • Updated package dependencies and configurations

Benefits

  • Dependency Awareness: The system now understands module dependencies and can propagate releases appropriately
  • Better Organization: Type system is now modular and easier to maintain
  • Enhanced Testing: Comprehensive test coverage ensures reliability
  • Improved Developer Experience: Better tooling and clearer code organization
  • Future-Ready: Solid foundation for additional dependency-aware features

Breaking Changes

  • Removed deprecated semver.ts utility functions
  • Type imports may need to be updated if consuming this as a library

Testing

  • All existing tests updated and passing
  • New comprehensive test suite for parser functionality
  • Added integration tests for dependency scenarios

virgofx added 13 commits June 9, 2025 21:03
- Move types from index.ts to dedicated type files for better organization
- Create common.types.ts for shared interfaces like ModuleInfo and ChangeInfo
- Create config.types.ts for configuration-related types
- Create context.types.ts for workspace context types
- Create github.types.ts for GitHub API related types
- Create wiki.types.ts for wiki-specific types
- Create node-child-process.types.ts for Node.js process types
- Update index.ts to re-export all types from dedicated files

This refactoring improves code organization and makes types easier to maintain.
- Add new parser.ts with comprehensive Terraform module parsing capabilities
- Implement buildModuleDependencyGraph() for tracking local module dependencies
- Add getModulesToRelease() to determine release propagation based on dependencies
- Enhance TerraformModule class with better change detection and release logic
- Add comprehensive test coverage for parser functionality
- Add test helpers for terraform module testing
- Improve module name normalization and path handling

This establishes a solid foundation for dependency-aware module releases and
better change detection across the Terraform module ecosystem.
- Update main.ts to use new parser and enhanced module handling
- Improve configuration handling with better type safety
- Enhance changelog generation with dependency-aware logic
- Update pull request commenting with better module information
- Improve release and tag management with new module system
- Update terraform-docs integration to work with enhanced modules
- Enhance wiki functionality with better module organization
- Remove deprecated semver utilities in favor of built-in logic
- Add new constants and improve file utility functions

These changes integrate the new parser system throughout the codebase and
improve the overall reliability and maintainability of the action.
- Update changelog tests to work with new module system and dependency tracking
- Enhance main.ts tests with better coverage of module parsing and release logic
- Improve pull request tests with dependency-aware scenarios
- Update release and tag management tests for new module handling
- Enhance terraform-docs tests with improved module integration
- Significantly expand terraform-module tests with comprehensive coverage
- Update wiki tests for new module organization and dependency features
- Improve utility tests and remove deprecated semver test file
- Add better test fixtures and mocking for complex scenarios

These test updates ensure comprehensive coverage of the refactored codebase
and provide confidence in the new dependency-aware release system.
- Update action.yml with new input parameters and improved documentation
- Update package.json with new development scripts and dependencies
- Enhance TypeScript configuration for better type checking
- Update .gitignore with additional patterns for development files
- Add development scripts for parsing modules and testing workflows
- Add test terraform modules (animal, zoo) for comprehensive testing scenarios
- Update package-lock.json with new dependency versions

These changes improve the development experience and provide better tooling
for testing and maintaining the terraform module release system.
@virgofx virgofx force-pushed the refactor/terraform-parser-dependency-system branch 2 times, most recently from f714aa5 to ca42a1a Compare June 10, 2025 17:39
…y; enhance action output handling in main.ts
@virgofx virgofx force-pushed the refactor/terraform-parser-dependency-system branch from ca42a1a to 7fe7870 Compare June 10, 2025 17:45
Copy link

📋 Release Plan

Module Type Latest
Version
New
Version
Release
Details
tf-modules/animal patch v1.0.0 🆕 Initial Release
📝 Changed Files
tf-modules/kms patch v1.0.0 🆕 Initial Release
tf-modules/s3-bucket-object patch v1.0.0 🆕 Initial Release
tf-modules/vpc-endpoint patch v1.0.0 🆕 Initial Release
tf-modules/zoo patch v1.0.0 🆕 Initial Release
📝 Changed Files

📝 Changelog

tf-modules/animal/v1.0.0 (2025-06-10)

  • 🔀PR #220 - refactor: implement terraform module dependency parser and enhance type system
  • chore: update configuration and add development tooling

    - Update action.yml with new input parameters and improved documentation
    - Update package.json with new development scripts and dependencies
    - Enhance TypeScript configuration for better type checking
    - Update .gitignore with additional patterns for development files
    - Add development scripts for parsing modules and testing workflows
    - Add test terraform modules (animal, zoo) for comprehensive testing scenarios
    - Update package-lock.json with new dependency versions

    These changes improve the development experience and provide better tooling
    for testing and maintaining the terraform module release system.

tf-modules/kms/v1.0.0 (2025-06-10)

  • 🔀PR #220 - refactor: implement terraform module dependency parser and enhance type system

tf-modules/s3-bucket-object/v1.0.0 (2025-06-10)

  • 🔀PR #220 - refactor: implement terraform module dependency parser and enhance type system

tf-modules/vpc-endpoint/v1.0.0 (2025-06-10)

  • 🔀PR #220 - refactor: implement terraform module dependency parser and enhance type system

tf-modules/zoo/v1.0.0 (2025-06-10)

  • 🔀PR #220 - refactor: implement terraform module dependency parser and enhance type system
  • chore: update configuration and add development tooling

    - Update action.yml with new input parameters and improved documentation
    - Update package.json with new development scripts and dependencies
    - Enhance TypeScript configuration for better type checking
    - Update .gitignore with additional patterns for development files
    - Add development scripts for parsing modules and testing workflows
    - Add test terraform modules (animal, zoo) for comprehensive testing scenarios
    - Update package-lock.json with new dependency versions

    These changes improve the development experience and provide better tooling
    for testing and maintaining the terraform module release system.
  • refactor: update output keys in CI workflow and README for consistency; enhance action output handling in main.ts

Wiki Statusℹ️

✅ Enabled

Automated Tag/Release Cleanupℹ️

⏸️ Existing tags and releases will be preserved as the delete-legacy-tags flag is disabled.

Powered by:   techpivot/terraform-module-releaser

Copy link

@virgofx virgofx merged commit 1e0fe58 into main Jun 10, 2025
24 checks passed
@virgofx virgofx deleted the refactor/terraform-parser-dependency-system branch June 10, 2025 17:47
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.

1 participant