Skip to content

docs: Reorganize scripts documentation with comprehensive guides#33

Merged
chadmf merged 7 commits into
mainfrom
scripts-update
Apr 3, 2026
Merged

docs: Reorganize scripts documentation with comprehensive guides#33
chadmf merged 7 commits into
mainfrom
scripts-update

Conversation

@chadmf

@chadmf chadmf commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refactored the scripts directory documentation to improve discoverability and provide detailed reference materials for all automation scripts, libraries, and CI/CD tooling.

Changes

Documentation Reorganization

  • Moved comprehensive guide from scripts/README.md to docs/scripts-guide.md
  • Created concise scripts/README.md as quick reference index
  • Added docs/scripts-library-reference.md with detailed API documentation
  • Added docs/scripts-hooks-and-cicd.md covering quality automation
  • Updated docs/INDEX.md to reference new documentation

New Documentation Files

1. scripts/README.md (Rewritten)

Quick reference organized by category:

  • AAP Cluster Management (OpenShift & RHEL)
  • Disaster Recovery Testing
  • EFM Integration
  • Testing & Quality Assurance
  • Git Hooks & Shared Libraries
  • Quick start examples and common workflows

2. docs/scripts-guide.md (Moved)

Comprehensive usage guide covering:

  • All scripts with detailed usage instructions
  • Installation procedures
  • Troubleshooting guides
  • EFM integration setup
  • DR testing workflows

3. docs/scripts-library-reference.md (NEW)

Complete library API documentation:

  • aap-scaling.sh functions:
    • validate_cluster_context - Cluster context validation
    • validate_database_primary - Split-brain prevention
    • scale_deployment - Idempotent scaling operations
    • wait_for_pods - Pod readiness monitoring
  • logging.sh functions:
    • setup_logging - Log initialization
    • log, log_error, log_warn, log_success - Structured logging
    • rotate_logs - Log rotation
  • Complete usage examples and best practices

4. docs/scripts-hooks-and-cicd.md (NEW)

Pre-commit hooks and CI/CD automation:

  • Pre-commit hooks setup and usage
  • check-script-permissions.sh documentation
  • validate-openshift-manifests.sh documentation
  • run-ci-checks-locally.sh comprehensive guide
  • GitHub Actions integration examples
  • Tool installation guide (shellcheck, kubeval, yamllint, pre-commit)
  • Troubleshooting common issues

Benefits

Improved discoverability - Quick reference in scripts/ with detailed docs in docs/
Better organization - Documentation organized by use case and audience
Complete API reference - Library functions fully documented with examples
CI/CD transparency - All quality checks documented and runnable locally
Consistent structure - Follows repository documentation patterns

Testing

  • Verified all documentation links are valid
  • Confirmed all code examples are accurate
  • Validated documentation organization in docs/INDEX.md
  • Reviewed for completeness and clarity

Related Documentation

🤖 Generated with Claude Code

chadmf and others added 7 commits April 2, 2026 11:25
Add comprehensive architectural decision record (ADR) for replacing
pgBouncer with HAProxy for AAP database connection routing due to
AAP/pgBouncer compatibility issues.

Changes:
- Add haproxy-pgbouncer-architectural-analysis.md: 500+ line ADR
  covering architecture comparison, design validation, implementation
  guidance, health check scripts, and trade-off analysis
- Update aap-containerized-enterprise-dr-architecture.md: Revise
  HAProxy configuration, network topology, and inventory files to
  reflect HAProxy database router pattern
- Update .gitignore: Add .pub pattern

Key architectural decision:
- HAProxy routes AAP containers to PostgreSQL VIP (EFM-managed)
- External health check validates writable node via pg_is_in_recovery()
- Clean separation: EFM handles DB failover, HAProxy handles routing
- Trade-off: Requires +67% max_connections (no pooling) but simpler ops

RTO/RPO impact: Failover detection ~25s (well within 5min target)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Change pattern from `.pub` (specific file) to `*.pub` (all .pub files)
to ensure SSH public keys and other .pub files are never committed.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add comprehensive replication test report (REPLICATION-TEST-REPORT-20260402.md)
- Document test results: streaming replication, failover, data consistency
- Include performance metrics: 0ms lag, 15s failover time
- Add PostgreSQL cluster configuration (3 instances: 1 primary + 2 replicas)
- Create reports directory structure with README

Tests performed:
- Streaming replication validation
- Automatic failover simulation
- Data consistency verification
- Read-only enforcement
- LSN synchronization checks
- Post-failover replication

All tests passed ✅

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Refactored the scripts directory documentation to improve
discoverability and provide detailed reference materials:

Changes:
- Moved comprehensive guide from scripts/README.md to docs/scripts-guide.md
- Created concise scripts/README.md as quick reference index
- Added docs/scripts-library-reference.md with detailed API docs
- Added docs/scripts-hooks-and-cicd.md covering quality automation
- Updated docs/INDEX.md to reference new documentation

New Documentation:
1. scripts/README.md - Quick reference organized by category
2. docs/scripts-guide.md - Complete usage guide (moved from scripts/)
3. docs/scripts-library-reference.md - Library functions API reference
4. docs/scripts-hooks-and-cicd.md - Pre-commit hooks and CI/CD guide

Library Reference includes:
- aap-scaling.sh functions (validate_cluster_context, scale_deployment, etc.)
- logging.sh functions (setup_logging, log levels, rotation)
- Complete usage examples and best practices

Hooks & CI/CD Guide covers:
- Pre-commit hooks setup and usage
- run-ci-checks-locally.sh comprehensive documentation
- GitHub Actions integration
- Tool installation guide (shellcheck, kubeval, yamllint)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed bash syntax error in deploy-aap-lab-external-pg.sh caused by
incorrect backslash escaping in regex pattern. Removed unnecessary
double-backslash escape that was causing parse error.

Error: [\'\"\;] → Fixed: [\'\"\;]

This fixes the CI Bash Syntax Validation failure.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed ShellCheck SC2168 errors by removing 'local' keyword
from variable declarations in main script body. The 'local'
keyword is only valid inside function definitions.

Changes:
- scripts/dr-failover-test.sh: Removed 'local' from retry logic vars
- scripts/measure-rto-rpo.sh: Removed 'local' from temp file vars

ShellCheck errors resolved:
- dr-failover-test.sh:272-274: 'local' only valid in functions
- measure-rto-rpo.sh:251,253: 'local' only valid in functions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@chadmf chadmf merged commit 739d2da into main Apr 3, 2026
@chadmf chadmf deleted the scripts-update branch April 3, 2026 21:24
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