Skip to content

fix: complete interactive release script fixes and improvements#84

Merged
fxstein merged 25 commits intodevelopfrom
feat/enhancement-improve-multichannel-release-process-20250630-132444
Jun 30, 2025
Merged

fix: complete interactive release script fixes and improvements#84
fxstein merged 25 commits intodevelopfrom
feat/enhancement-improve-multichannel-release-process-20250630-132444

Conversation

@fxstein
Copy link
Owner

@fxstein fxstein commented Jun 30, 2025

Summary

This PR implements comprehensive fixes and improvements to the interactive release script (scripts/release/release.zsh), resolving critical issues with interactive prompts, logger integration, and version format handling.

Requirements

  • Fix interactive prompt detection and user input capture
  • Resolve logger output interference with command substitution
  • Standardize logger usage across the release script
  • Fix version format validation and handling
  • Ensure shell compatibility across different environments
  • Complete the full interactive workflow with proper validation

Motivation

The interactive release script was experiencing several critical issues:

  1. Interactive Detection Failure: The script incorrectly detected non-interactive environments due to checking both stdin and stdout terminals
  2. Logger Interference: Logger output was being captured by command substitution, mixing log messages with user input
  3. Inconsistent Logging: Mixed usage of direct logger calls and custom logging functions
  4. Version Format Issues: Git tags with "v" prefix were not being handled correctly by version validation
  5. Shell Compatibility: Use of ${var,,} syntax caused "bad substitution" errors in some environments

These issues prevented the interactive release script from functioning properly and providing a smooth user experience.

Changes

Interactive Prompt System

  • Fixed Interactive Detection: Modified is_interactive() to check only stdin (-t 0) instead of both stdin and stdout
  • Resolved Logger Interference: Redirected all logger output to stderr (>&2) to prevent capture by command substitution
  • Enhanced User Input Handling: Improved safe_prompt() and safe_confirm() functions for reliable input capture

Logger Integration

  • Standardized Logger Usage: Replaced all log_* calls with safe_log * wrapper for consistency
  • Added Safe Logger Wrapper: Implemented safe_log() function to prevent logger errors from causing script exits
  • Consistent Error Handling: Ensured all logging follows project standards and design principles

Version Format Handling

  • Automatic Prefix Stripping: Added logic to strip "v" prefix from git tags before version validation
  • Improved Validation: Enhanced version format validation to work with both prefixed and unprefixed versions
  • Better Default Values: Improved suggested version handling in interactive prompts

Shell Compatibility

  • Fixed Case Conversion: Replaced ${var,,} syntax with explicit case checking for better compatibility
  • Robust Error Handling: Enhanced error handling to work across different shell environments
  • Consistent Syntax: Ensured all zsh-specific features are used correctly

Interactive Workflow Completion

  • Full Workflow Support: Completed the entire interactive workflow from release type selection to final confirmation
  • Proper Validation: Added comprehensive validation at each step of the interactive process
  • User-Friendly Prompts: Enhanced prompt messages and default value suggestions

Acceptance Criteria

  • Interactive release script detects interactive environment correctly
  • User input is captured without logger interference
  • All prompts work correctly and provide appropriate default values
  • Version format validation handles both prefixed and unprefixed versions
  • Logger integration is consistent and follows project standards
  • Shell compatibility issues are resolved
  • Full interactive workflow completes successfully
  • All changes follow project design principles and coding standards

Testing

The interactive release script has been thoroughly tested:

  • ✅ Interactive environment detection
  • ✅ Release type selection (1-4)
  • ✅ Previous version input with validation
  • ✅ Version bump type selection (major/minor/patch)
  • ✅ Next version input with validation
  • ✅ Monitor workflow option
  • ✅ Final confirmation prompt
  • ✅ Complete workflow execution

Related Issues

Impact

This PR significantly improves the user experience for interactive releases by:

  • Providing a reliable and intuitive interactive interface
  • Ensuring consistent behavior across different environments
  • Following project design principles and coding standards
  • Maintaining proper logging and error handling throughout the process

The interactive release script is now fully functional and ready for production use.

fxstein added 19 commits June 30, 2025 13:29
…tch modes (refs #20)

- Add release.zsh as unified entry point for all release types
- Support interactive mode with sensible defaults and prompts
- Support batch mode for AI/automation with all parameters required
- Support official, beta, dev, and dry-run release types
- Add comprehensive documentation in docs/RELEASE_SYSTEM.md
- Integrate with existing full-release.zsh and gitflow-release.zsh
- Include version validation, branch requirements, and error handling
- Test with successful dry-run validation
#20)

- Update Release Script Automation section to use ./release.zsh
- Add examples for AI/automation batch mode usage
- Add reference to docs/RELEASE_SYSTEM.md in mandatory reading
- Clarify legacy script usage for troubleshooting only
- Ensure AI uses batch mode for automation and interactive mode for developers
…#20)

- Remove test-config*.txt files that were accidentally committed
- These were transient test artifacts that should be in output/ directory
- Follows AI instructions requirement for output file placement
- Remove test-beta-version-generation.zsh (temporary test artifact)
- Remove test-homebrew-update.zsh (temporary test artifact)
- These were used during Homebrew multi-channel development
- Functionality is now properly tested in scripts/testing/ suites
- Follows AI instructions requirement for output file placement
…efs #20)

- Move load-env.zsh from repo root to scripts/core/ directory
- Update usage comments with proper relative path examples
- Add load-env.zsh source to update-homebrew-channel.zsh for HOMEBREW_TOKEN loading
- Follows proper script organization and relative path conventions
- Maintains functionality while improving project structure
…, and fix firmware summary script paths (refs #72 #73)
- Add design principle for minimal environment variable usage
- Update interactive mode principle to require command-line arguments only
- Remove environment variable support from safe prompt utility
- Update main goprox script to use local variables for interactive flags
- Update test frameworks and documentation to clarify new standard
- Add comprehensive test suite for safe prompt functionality

This change establishes that environment variables should only be used for:
- Tokens and credentials (GITHUB_TOKEN, HOMEBREW_TOKEN)
- Basic project-wide settings (GOPROX_ROOT, GOPROX_CONFIG)
- System integration variables (CI/CD platform variables)

Interactive control (--non-interactive, --auto-confirm, --default-yes) must
be provided via command-line arguments to avoid persistence and scope issues.
…70)

- Source logger utility in safe prompt test suite
- Ensure all safe prompt tests run with correct logger output
- Remove all environment variable usage for interactive control in tests
- Validate new command-line argument standard for safe prompt and test framework

All tests now pass and logger output is correctly integrated in test results.
…#72)

- Fix is_interactive function to only check stdin (-t 0) instead of both stdin and stdout
- Redirect logger output to stderr to prevent interference with command substitution
- Add proper logger integration to release script using project logger
- Add safe_log wrapper function to handle logger errors gracefully
- Add debug logging throughout main function to track execution flow
- Fix script initialization order to set SCRIPT_DIR before sourcing logger

This resolves the issue where interactive prompts were not working due to:
1. Incorrect interactive environment detection
2. Logger output interfering with command substitution return values
3. Missing logger integration causing silent exits

The release script now properly detects interactive environments and handles
user input without logger interference.
@fxstein fxstein added enhancement New feature or request workflow Developer, testing and release related workflow release Release management and version tracking labels Jun 30, 2025
@fxstein fxstein self-assigned this Jun 30, 2025
@github-actions
Copy link

🧪 Test Results

All tests passed

Test Suites Executed:

  • Unit Tests:
    • Logger Tests
    • Firmware Summary Tests
  • Integration Tests:
    • Configuration Tests
    • Parameter Processing Tests
    • Storage Validation Tests
    • Integration Tests

📊 Test Reports: Available in workflow artifacts
🔍 Test Logs: Available in workflow artifacts


Generated by GoProX Comprehensive Testing Framework

@github-actions
Copy link

🧪 Test Results

All tests passed

Test Suites Executed:

  • Unit Tests:
    • Logger Tests
    • Firmware Summary Tests
  • Integration Tests:
    • Configuration Tests
    • Parameter Processing Tests
    • Storage Validation Tests
    • Integration Tests

📊 Test Reports: Available in workflow artifacts
🔍 Test Logs: Available in workflow artifacts


Generated by GoProX Comprehensive Testing Framework

@github-actions
Copy link

🧪 Test Results

All tests passed

Test Suites Executed:

  • Unit Tests:
    • Logger Tests
    • Firmware Summary Tests
  • Integration Tests:
    • Configuration Tests
    • Parameter Processing Tests
    • Storage Validation Tests
    • Integration Tests

📊 Test Reports: Available in workflow artifacts
🔍 Test Logs: Available in workflow artifacts


Generated by GoProX Comprehensive Testing Framework

@github-actions
Copy link

🧪 Test Results

All tests passed

Test Suites Executed:

  • Unit Tests:
    • Logger Tests
    • Firmware Summary Tests
  • Integration Tests:
    • Configuration Tests
    • Parameter Processing Tests
    • Storage Validation Tests
    • Integration Tests

📊 Test Reports: Available in workflow artifacts
🔍 Test Logs: Available in workflow artifacts


Generated by GoProX Comprehensive Testing Framework

@github-actions
Copy link

🧪 Test Results

All tests passed

Test Suites Executed:

  • Unit Tests:
    • Logger Tests
    • Firmware Summary Tests
  • Integration Tests:
    • Configuration Tests
    • Parameter Processing Tests
    • Storage Validation Tests
    • Integration Tests

📊 Test Reports: Available in workflow artifacts
🔍 Test Logs: Available in workflow artifacts


Generated by GoProX Comprehensive Testing Framework

@github-actions
Copy link

🧪 Test Results

All tests passed

Test Suites Executed:

  • Unit Tests:
    • Logger Tests
    • Firmware Summary Tests
  • Integration Tests:
    • Configuration Tests
    • Parameter Processing Tests
    • Storage Validation Tests
    • Integration Tests

📊 Test Reports: Available in workflow artifacts
🔍 Test Logs: Available in workflow artifacts


Generated by GoProX Comprehensive Testing Framework

- Fixes CI environment validation failures in GitHub Actions
- Adds --force-clean flag to run-unit-tests.zsh and run-tests.zsh calls
- Ensures tests run in isolated environments when needed
- Addresses GitHub Actions environment variables (GITHUB_ACTIONS, GITHUB_TOKEN, etc.)

Fixes GitHub Actions CI failures where environment validation was blocking tests
due to CI-specific environment variables being set.
@github-actions
Copy link

🧪 Test Results

All tests passed

Test Suites Executed:

  • Unit Tests:
    • Logger Tests
    • Firmware Summary Tests
  • Integration Tests:
    • Configuration Tests
    • Parameter Processing Tests
    • Storage Validation Tests
    • Integration Tests

📊 Test Reports: Available in workflow artifacts
🔍 Test Logs: Available in workflow artifacts


Generated by GoProX Comprehensive Testing Framework

@fxstein fxstein merged commit b1c63b4 into develop Jun 30, 2025
7 checks passed
@fxstein fxstein deleted the feat/enhancement-improve-multichannel-release-process-20250630-132444 branch June 30, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request release Release management and version tracking workflow Developer, testing and release related workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant