Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community.
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution.
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
- A reproducible test case or series of steps
- The version of our code being used
- Any modifications you've made relevant to the bug
- Anything unusual about your environment or deployment
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
- You are working against the latest source on the main branch.
- You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
- You open an issue to discuss any significant work - we would hate for your time to be wasted.
- You have Node.js v24+ - Required for running tests. Use
nvm use nodeto switch to the latest version. - All tests pass - Run
npm run validateto ensure your changes don't break existing functionality. - New functionality includes tests - Add appropriate unit tests and property tests for new features.
To send us a pull request, please:
- Fork the repository.
- Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
- Ensure you're using Node.js v24+ by running
nvm use node. - Ensure all tests pass by running
npm run validate. - Add tests for new functionality following our testing patterns.
- Commit to your fork using clear commit messages.
- Send us a pull request, answering any default questions in the pull request interface.
- Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
GitHub provides additional document on forking a repository and creating a pull request.
Node.js v24+ is required for running the test suite. The tests use modern JavaScript features that are not available in older Node versions.
# Check your Node version
node --version
# If using nvm, switch to the latest version
nvm use node
# Verify you're on v24+
node --version # Should show v24.x.x or higherImportant: Running tests with Node.js < v24 will cause errors like Unexpected token 'with'. Always run nvm use node before testing.
All pull requests must pass our comprehensive test suite:
# ALWAYS run this first to ensure correct Node version
nvm use node
# Run the full validation suite (required before PR submission)
npm run validate
# This runs:
# 1. ESLint code quality checks
# 2. Security audit (npm audit)
# 3. Unit tests (238 tests)
# 4. Property-based tests (10 universal correctness properties)Our test suite is organized into two complementary layers:
Focused tests for specific functionality organized by capability. See test/README.md for detailed documentation.
- CLI Options (
cli-options.test.js) - CLI option parsing and validation - Environment Variables (
environment-variables.test.js) - Environment variable handling - Configuration Files (
configuration-files.test.js) - Config file parsing - Configuration Precedence (
configuration-precedence.test.js) - Multi-source precedence - File Generation (
file-generation.test.js) - Template processing and file creation - Error Handling (
error-handling.test.js) - Validation and error scenarios - Property-Based Tests - 10 universal correctness properties with 1000+ test iterations
End-to-end project generation and validation scripts. See scripts/README.md for detailed documentation.
test-generate-projects.sh- Comprehensive project generation testing across all configurationstest-generate-configs.sh- Configuration file generation for manual testingtest-generation-parameters.sh- Flexible test runner with different verbosity levels
| What You're Adding | Where to Add Tests | Documentation |
|---|---|---|
| New CLI option | test/input-parsing-and-generation/cli-options.test.js |
test/README.md |
| New environment variable | test/input-parsing-and-generation/environment-variables.test.js |
test/README.md |
| New configuration option | test/input-parsing-and-generation/configuration-files.test.js |
test/README.md |
| New framework support | Both unit tests + scripts/test-generate-projects.sh |
Both README files |
| New template/file generation | test/input-parsing-and-generation/file-generation.test.js |
test/README.md |
| New validation/error handling | test/input-parsing-and-generation/error-handling.test.js |
test/README.md |
| End-to-end scenarios | scripts/test-generate-projects.sh |
scripts/README.md |
| Universal correctness properties | test/input-parsing-and-generation/parameter-matrix-compliance.property.test.js |
test/README.md |
When adding new functionality, include appropriate tests. See test/README.md and scripts/README.md for comprehensive testing guidelines.
Unit Tests (fast, focused testing):
- CLI option changes β
test/input-parsing-and-generation/cli-options.test.js - Environment variable changes β
test/input-parsing-and-generation/environment-variables.test.js - Config file changes β
test/input-parsing-and-generation/configuration-files.test.js - Precedence changes β
test/input-parsing-and-generation/configuration-precedence.test.js - Template/file changes β
test/input-parsing-and-generation/file-generation.test.js
Integration Tests (end-to-end validation):
- New framework support β
scripts/test-generate-projects.sh - New configuration scenarios β
scripts/test-generate-projects.sh - Configuration file generation β
scripts/test-generate-configs.sh
Unit Test Example:
import {
runGenerator,
validateFiles,
setupTestHooks
} from './test-utils.js';
describe('Your Feature Category', () => {
setupTestHooks('Your Feature Category');
it('should handle your specific functionality', async () => {
console.log(`\n π§ͺ Test #1: Testing your functionality...`);
console.log(` π Test Suite: Your Feature Category`);
const result = await runGenerator({
framework: 'sklearn',
yourNewOption: 'test-value',
skipPrompts: true
});
validateFiles(['expected-file.txt'], 'your feature test');
console.log(` β
Your functionality working correctly`);
});
});Integration Test Example:
# Add to scripts/test-generate-projects.sh
test_your_new_feature() {
local test_name="$1"
print_substep "Testing your new feature: $test_name"
mkdir -p "your-feature-test"
cd "your-feature-test"
if ml-container-creator --your-new-option --skip-prompts > ../test.log 2>&1; then
validate_files ["expected-file.txt"] "your feature test"
cd ..
record_test_result "Your Feature" "PASS"
else
cd ..
record_test_result "Your Feature" "FAIL"
fi
}Always include both positive and negative test cases:
// Test successful case
it('should generate files for valid configuration', async () => {
await runGenerator({
framework: 'sklearn',
modelFormat: 'pkl',
skipPrompts: true
});
validateFiles(['Dockerfile', 'requirements.txt'], 'sklearn generation');
});
// Test error case
it('should show error for invalid configuration', async () => {
try {
await runGenerator({
framework: 'invalid',
skipPrompts: true
});
assert.fail('Should have thrown an error');
} catch (error) {
assert(error.message.includes('not implemented'));
}
});If your feature affects parameter handling, consider adding property tests. See test/README.md for detailed property testing guidelines.
# Run tests continuously during development
npm run test:watch # Unit tests in watch mode
npm run test:property:watch # Property tests in watch mode
# Run specific test categories
npm test -- --grep "CLI Options" # Your specific functionality
npm test -- --grep "sklearn" # Framework-specific tests
# Run integration tests
./scripts/test-generate-projects.sh --verbose --keep-output
# Quick validation before committing
npm run validate # Full test suite + linting- Descriptive test names that explain what's being tested
- Console output showing test progress and context
- Proper cleanup of environment variables and temporary files
- Error handling for both expected and unexpected failures
- Performance considerations for property tests (reasonable iteration counts)
Our tests provide excellent debugging information. See the respective README files for detailed debugging guidance:
- Unit test debugging:
test/README.md - Integration test debugging:
scripts/README.md
All pull requests automatically run:
- ESLint code quality checks
- Security audit (npm audit)
- Complete test suite (unit + property tests)
- Node.js compatibility testing
Tests must pass on all supported Node.js versions before merge.
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opensource-codeofconduct@amazon.com with any additional questions or comments.
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page. Please do not create a public github issue.
See the LICENSE file for our project's licensing. We will ask you to confirm the licensing of your contribution.
Thank you for your interest in contributing to the ml-container-creator project! This document provides guidelines and information about contributing to this project.