Skip to content

Ci#23

Merged
N6REJ merged 2 commits intomainfrom
ci
Nov 24, 2025
Merged

Ci#23
N6REJ merged 2 commits intomainfrom
ci

Conversation

@N6REJ
Copy link
Collaborator

@N6REJ N6REJ commented Nov 24, 2025

PR Type

Enhancement, Tests


Description

  • Add comprehensive CI/CD workflow for automated MariaDB testing

    • Intelligent version detection based on PR changes or manual input
    • Two-phase testing: installation validation and basic functionality
    • Parallel execution across multiple MariaDB versions
  • Create extensive documentation for CI/CD testing workflow

    • Detailed test phases and error handling procedures
    • Troubleshooting guide and maintenance instructions
    • Best practices and performance considerations
  • Remove Eclipse IDE launch configuration file

    • Cleanup of IDE-specific build artifacts

Diagram Walkthrough

flowchart LR
  PR["Pull Request<br/>or Manual Trigger"]
  VER["Detect Versions<br/>to Test"]
  TEST["Test MariaDB<br/>Multi-Version"]
  PHASE1["Phase 1:<br/>Installation"]
  PHASE2["Phase 2:<br/>Functionality"]
  REPORT["Report Results<br/>& PR Comment"]
  
  PR --> VER
  VER --> TEST
  TEST --> PHASE1
  PHASE1 --> PHASE2
  PHASE2 --> REPORT
Loading

File Walkthrough

Relevant files
Enhancement
mariadb-test.yml
MariaDB automated testing workflow with multi-version support

.github/workflows/mariadb-test.yml

  • Created comprehensive GitHub Actions workflow for MariaDB testing
  • Implements intelligent version detection from releases.properties
    based on PR changes or manual input
  • Phase 1: Downloads, extracts, and verifies MariaDB executables on
    Windows runner
  • Phase 2: Tests basic functionality by running version commands on all
    executables
  • Generates PR comments with test results, badges, and troubleshooting
    information
  • Supports parallel matrix testing across multiple versions with
    fail-safe error handling
+700/-0 
Documentation
CI-CD-TESTING.md
Complete CI/CD testing workflow documentation and guide   

docs/CI-CD-TESTING.md

  • Comprehensive documentation for the MariaDB CI/CD testing workflow
  • Detailed descriptions of workflow triggers, test phases, and error
    handling
  • Troubleshooting guide with common issues and debugging steps
  • Maintenance instructions for adding tests and modifying version
    selection
  • Best practices, performance considerations, and version naming
    conventions
  • Future enhancement suggestions and contribution guidelines
+479/-0 
README.md
Documentation directory index and overview                             

docs/README.md

  • Created documentation index for MariaDB module
  • Links to CI/CD testing documentation and workflow files
  • Contributing guidelines and support information
  • Quick reference to key project files and repositories
+36/-0   
Miscellaneous
module-mariadb.RELEASE.launch
Remove Eclipse IDE launch configuration                                   

module-mariadb.RELEASE.launch

  • Removed Eclipse IDE launch configuration file
  • Cleanup of IDE-specific build artifacts not needed for CI/CD
+0/-19   

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Nov 24, 2025

🦭 MariaDB Module Tests - Results

Test Date: 2025-11-24 02:23:59 UTC
Status: ✅ All tests passed

📊 Test Results by Version

MariaDB 12.1.2
MariaDB 12.0.2
MariaDB 11.8.5
MariaDB 11.8.3
MariaDB 11.8.2

Results: 5 of 5 versions tested

All tests passed successfully! ✨


📋 Test Phases

Each version is tested through the following phases:

  • Phase 1: Installation Validation (Download, Extract, Verify Executables)
  • Phase 2: Basic Functionality (Test Executable Versions)

Check artifacts for detailed logs.

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Correctly detect and report skipped tests

Update the condition for reporting skipped tests to also check if
needs.detect-versions.outputs.has-changes is false, ensuring that the PR comment
accurately reflects a "skipped" status when no tests are run.

.github/workflows/mariadb-test.yml [543-556]

-if [ "$TEST_STATUS" = "skipped" ] || [ "$VERSIONS" = "[]" ]; then
+HAS_CHANGES='${{ needs.detect-versions.outputs.has-changes }}'
+
+if [ "$TEST_STATUS" = "skipped" ] || [ "$VERSIONS" = "[]" ] || [ "$HAS_CHANGES" = "false" ]; then
   echo "**Status:** ⏭️ Tests skipped - no versions to test" >> comment.md
   echo "" >> comment.md
   echo "ℹ️ **Why were tests skipped?**" >> comment.md
   echo "" >> comment.md
   echo "Tests are only run when:" >> comment.md
   echo "- \`releases.properties\` is modified with new/updated versions, OR" >> comment.md
   echo "- PR title contains version numbers (e.g., \"11.4.8\", \"10.11.14\") that exist in \`releases.properties\`" >> comment.md
   echo "" >> comment.md
   echo "**To trigger tests:**" >> comment.md
   echo "1. Add version numbers to your PR title (e.g., \"Update docs for MariaDB 11.4.8\")" >> comment.md
   echo "2. Or modify \`releases.properties\` to add/update versions" >> comment.md
   echo "3. Or manually trigger the workflow from the Actions tab" >> comment.md
 elif [ "$TEST_STATUS" = "success" ]; then
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: This suggestion fixes a significant bug in the reporting logic where a skipped test run would be incorrectly reported as successful, providing misleading feedback in the PR comment.

High
Fix incorrect step success reporting

Remove the exit 1 command from the "Verify MariaDB Installation" step to prevent
the step from being marked as failed when executables are missing, as the
success=false output is sufficient for downstream logic.

.github/workflows/mariadb-test.yml [352-360]

 $verifyResults | ConvertTo-Json -Depth 10 | Out-File "test-results/verify.json"
 
 if ($allFound) {
   echo "success=true" >> $env:GITHUB_OUTPUT
   echo "bin-path=$binPath" >> $env:GITHUB_OUTPUT
 } else {
   echo "success=false" >> $env:GITHUB_OUTPUT
-  exit 1
 }
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that exit 1 combined with continue-on-error: true causes the step to be marked as failed, which contradicts the workflow's design of using output variables to control logic and reporting. Removing exit 1 aligns the step's behavior with the overall workflow design, ensuring accurate status reporting in the final summary.

Medium
Use flexible regex for version validation

Update the grep command in the version validation check to use a more flexible
regular expression (-qE "^${VERSION}\s
=") that accommodates variable spacing
in the releases.properties file.
*

.github/workflows/mariadb-test.yml [67-76]

-if grep -q "^${VERSION} =" releases.properties; then
+if grep -qE "^${VERSION}\s*=" releases.properties; then
   VERSIONS="[\"${VERSION}\"]"
   HAS_CHANGES="true"
   echo "✅ Version $VERSION found in releases.properties"
 else
   echo "❌ ERROR: Version $VERSION not found in releases.properties"
   echo "Available versions:"
   get_all_versions | head -10
   exit 1
 fi
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies that the grep check is too strict and improves robustness by allowing flexible spacing, making the script less prone to formatting-related errors.

Low
Improve version validation from PR title

Modify the grep command used for validating versions from the PR title to use a
more flexible regex (-qE "^${ver}\s
="), ensuring it can handle variable
spacing in the releases.properties file.
*

.github/workflows/mariadb-test.yml [125-132]

 for ver in $PR_VERSIONS; do
-  if grep -q "^${ver} =" releases.properties; then
+  if grep -qE "^${ver}\s*=" releases.properties; then
     echo "✅ Version $ver found in releases.properties"
     VALID_VERSIONS="${VALID_VERSIONS}${ver}\n"
   else
     echo "⚠️  Version $ver not found in releases.properties"
   fi
 done
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: This suggestion correctly points out a strict grep check for versions from the PR title and improves its robustness by allowing flexible spacing, which prevents valid versions from being missed.

Low
High-level
Refactor the monolithic workflow file

The monolithic 700-line workflow file should be refactored. Extract the large,
complex inline shell and PowerShell scripts into separate files to improve
modularity, readability, and maintainability.

Examples:

.github/workflows/mariadb-test.yml [177-309]
      - name: Phase 1.1 - Download and Extract MariaDB
        id: download-mariadb
        continue-on-error: true
        run: |
          $ErrorActionPreference = "Stop"
          $version = "${{ matrix.version }}"
          
          Write-Host "=== Phase 1.1: Download and Extract MariaDB $version ==="
          
          # Read releases.properties

 ... (clipped 123 lines)
.github/workflows/mariadb-test.yml [39-156]
        run: |
          set -e
          
          echo "=== Detecting MariaDB Versions to Test ==="
          
          # Function to get versions from releases.properties
          get_all_versions() {
            grep -E "^[0-9]" releases.properties | cut -d'=' -f1 | tr -d ' ' | sort -V -r
          }
          

 ... (clipped 108 lines)

Solution Walkthrough:

Before:

# .github/workflows/mariadb-test.yml
jobs:
  test-mariadb:
    steps:
      - name: Phase 1.1 - Download and Extract MariaDB
        id: download-mariadb
        run: |
          $ErrorActionPreference = "Stop"
          $version = "${{ matrix.version }}"
          Write-Host "=== Phase 1.1: Download and Extract MariaDB $version ==="
          
          # ... (100+ lines of inline PowerShell script) ...
          
          Invoke-WebRequest -Uri $downloadUrl -OutFile $downloadPath
          
          # ... (more logic) ...
          
          echo "success=true" >> $env:GITHUB_OUTPUT

After:

# .github/workflows/mariadb-test.yml
jobs:
  test-mariadb:
    steps:
      - name: Phase 1.1 - Download and Extract MariaDB
        id: download-mariadb
        run: ./.github/scripts/download-extract.ps1 -Version "${{ matrix.version }}"
        shell: pwsh

# .github/scripts/download-extract.ps1
param(
  [string]$Version
)
$ErrorActionPreference = "Stop"
Write-Host "=== Phase 1.1: Download and Extract MariaDB $Version ==="
# ... (100+ lines of PowerShell script logic) ...
Invoke-WebRequest -Uri $downloadUrl -OutFile $downloadPath
# ... (more logic) ...
echo "success=true" >> $env:GITHUB_OUTPUT
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a major maintainability issue in the 700-line mariadb-test.yml file and proposes a standard best practice to extract complex inline scripts, which would significantly improve the workflow's structure and readability.

Medium
  • More

@N6REJ N6REJ merged commit ab1bbe3 into main Nov 24, 2025
15 checks passed
@N6REJ N6REJ deleted the ci branch November 24, 2025 02: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