The CF Java Plugin now includes comprehensive CI/CD integration with automated testing, linting, and quality assurance for both Go and Python codebases.
-
Build and Snapshot Release (
.github/workflows/build-and-snapshot.yml)- Triggers: Push to main/master, PRs, weekly schedule, manual dispatch
- Jobs:
- Python test suite validation (if available)
- Multi-platform Go builds (Linux, macOS, Windows)
- Automated snapshot releases
-
Pull Request Validation (
.github/workflows/pr-validation.yml)- Triggers: All pull requests to main/master
- Validation Steps:
- Go formatting (
go fmt) and linting (go vet) - Python code quality (flake8, black, isort)
- Markdown linting and formatting
- Python test execution
- Plugin build verification
- Go formatting (
The CI automatically detects if the Python test suite exists by checking for:
test/requirements.txttest/setup.sh
If found, runs Python linting validation. Note: Python test execution is temporarily disabled in CI.
./setup-dev-env.sh # One-time setup- ✅ Go code formatting (
go fmt) - ✅ Go static analysis (
go vet) - ✅ Python linting (flake8) - if test suite exists
- ✅ Python formatting (black) - auto-fixes issues
- ✅ Import sorting (isort) - auto-fixes issues
- ✅ Python syntax validation
- ✅ Markdown linting (markdownlint) - checks git-tracked files
- Auto-fixes: Python formatting and import sorting
- Blocks commits: On critical linting issues
- Warnings: For non-critical issues or missing Python suite
- flake8: Line length 120, ignores E203,W503
- black: Line length 120, compatible with flake8
- isort: Black-compatible profile for import sorting
- markdownlint: Automated markdown formatting (120 char limit, git-tracked files only)
./scripts/lint-go.sh check # Check Go code formatting and static analysis
./scripts/lint-go.sh fix # Auto-fix Go code issues
./scripts/lint-python.sh check # Check Python code quality
./scripts/lint-python.sh fix # Auto-fix Python code issues
./scripts/lint-markdown.sh check # Check formatting
./scripts/lint-markdown.sh fix # Auto-fix issues
./scripts/lint-all.sh check # Check all (Go, Python, Markdown)cd test
./setup.sh # Setup environment
./test.py all # Run all testsCI Status: Python tests are currently disabled in CI workflows but can be run locally.
- Generated in XML format for Codecov integration
- Covers the
frameworkmodule - Includes terminal output for local development
git clone <repository>
cd cf-cli-java-plugin
./setup-dev-env.sh# Make changes
code cf-java-plugin.code-workspace
# Commit (hooks run automatically)
git add .
git commit -m "Feature: Add new functionality"
# Push (triggers CI)
git push origin feature-branch
# Create PR (triggers validation)# Test pre-commit hooks
.git/hooks/pre-commit
# Test VS Code configuration
./test-vscode-config.sh
# Run specific tests
cd test && pytest test_jfr.py -v- Formatting enforcement via
go fmt - Static analysis via
go vet
- Style compliance: flake8 (PEP 8 + custom rules)
- Formatting: black (consistent style)
- Import organization: isort (proper import ordering)
- Style compliance: markdownlint (120 char limit, git-tracked files only)
- Automated formatting with relaxed rules for compatibility
For running Python tests in CI that require Cloud Foundry credentials, configure these GitHub repository secrets:
| Secret Name | Description | Example |
|---|---|---|
CF_API |
Cloud Foundry API endpoint | https://api.cf.eu12.hana.ondemand.com |
CF_USERNAME |
Cloud Foundry username | your-username |
CF_PASSWORD |
Cloud Foundry password | your-password |
CF_ORG |
Cloud Foundry organization | sapmachine-testing |
CF_SPACE |
Cloud Foundry space | dev |
-
Navigate to Repository Settings:
- Go to your GitHub repository
- Click "Settings" → "Secrets and variables" → "Actions"
-
Add New Repository Secret:
- Click "New repository secret"
- Enter the secret name (e.g.,
CF_USERNAME) - Enter the secret value
- Click "Add secret"
-
Repeat for all required secrets
The Python test framework automatically uses these environment variables:
- Falls back to
test_config.ymlif environment variables are not set - Supports both file-based and environment-based configuration
- CI workflows pass secrets as environment variables to test processes
- ✅ Never commit credentials to source code
- ✅ Use repository secrets for sensitive data
- ✅ Limit secret access to necessary workflows only
- ✅ Rotate credentials regularly
- ✅ Use organization secrets for shared credentials across repositories