Skip to content

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Jul 20, 2025

Summary

Fixes cargo fmt formatting issues detected in CI workflows.

Changes

  • Applied standard Rust formatting to test functions in
  • Resolves formatting check failures in Quick PR Validation workflow

Background

The CI detected formatting inconsistencies in storage test functions that were causing the Quick PR Validation to fail. This PR applies the standard formatting to resolve these issues.

Test Plan

  • Local passes
  • CI formatting checks pass (pending PR validation)

The CI detected formatting issues in the storage.rs test functions.
This commit applies the standard Rust formatting to resolve the
failures in the Quick PR Validation workflow.
@github-actions
Copy link

github-actions bot commented Jul 20, 2025

PR Validation Results

Quick Validation: ❌

  • Format check
  • Clippy lints
  • Unit tests
  • Documentation

Validation Framework: ✅

  • Framework tests
  • Property-based tests
  • CLI tools

Compatibility Check: ✅

  • Protocol compliance
  • Server compatibility

Summary: ❌ Some checks failed

@github-actions
Copy link

github-actions bot commented Jul 20, 2025

Code Coverage Report 📊

Local Coverage: 23.97%
Validation: Handled by Codecov

Note: Coverage validation is now performed by Codecov to ensure consistency across all platforms.

Coverage Details
Filename                                                  Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
integration-tests/src/auth_server_integration.rs              125                26    79.20%          34                13    61.76%         473                75    84.14%           0                 0         -
integration-tests/src/cli_server_integration.rs               140                16    88.57%          43                 7    83.72%         580                25    95.69%           0                 0         -
integration-tests/src/end_to_end_scenarios.rs                 243                50    79.42%          48                 9    81.25%         910                97    89.34%           0                 0         -
integration-tests/src/lib.rs                                   11                 8    27.27%           5                 2    60.00%          45                18    60.00%           0                 0         -
integration-tests/src/monitoring_integration.rs               158                29    81.65%          36                12    66.67%         603                87    85.57%           0                 0         -
integration-tests/src/transport_server_integration.rs         169                37    78.11%          39                17    56.41%         602               135    77.57%           0                 0         -
mcp-auth/src/audit.rs                                         169               109    35.50%          27                17    37.04%         293               189    35.49%           0                 0         -
mcp-auth/src/config.rs                                         21                19     9.52%          11                10     9.09%          91                71    21.98%           0                 0         -
mcp-auth/src/consent.rs                                        48                48     0.00%          12                12     0.00%          98                98     0.00%           0                 0         -
mcp-auth/src/consent/manager.rs                               255               255     0.00%          44                44     0.00%         439               439     0.00%           0                 0         -
mcp-auth/src/crypto/encryption.rs                              31                31     0.00%           9                 9     0.00%          53                53     0.00%           0                 0         -
mcp-auth/src/crypto/hashing.rs                                 23                23     0.00%          10                10     0.00%          61                61     0.00%           0                 0         -
mcp-auth/src/crypto/keys.rs                                    39                39     0.00%           8                 8     0.00%          88                88     0.00%           0                 0         -
mcp-auth/src/crypto/mod.rs                                      7                 7     0.00%           2                 2     0.00%          15                15     0.00%           0                 0         -
mcp-auth/src/jwt.rs                                           122               112     8.20%          30                28     6.67%         278               248    10.79%           0                 0         -
mcp-auth/src/lib.rs                                             8                 7    12.50%           6                 5    16.67%          14                11    21.43%           0                 0         -
mcp-auth/src/manager.rs                                       604               560     7.28%         116               101    12.93%        1031               889    13.77%           0                 0         -
mcp-auth/src/manager_vault.rs                                 171               171     0.00%          23                23     0.00%         194               194     0.00%           0                 0         -
mcp-auth/src/middleware/mcp_auth.rs                           120               120     0.00%          26                26     0.00%         218               218     0.00%           0                 0         -
mcp-auth/src/middleware/session_middleware.rs                 221               221     0.00%          41                41     0.00%         374               374     0.00%           0                 0         -
mcp-auth/src/models.rs                                         75                75     0.00%          19                19     0.00%         169               169     0.00%           0                 0         -
mcp-auth/src/monitoring/dashboard_server.rs                   110               110     0.00%          28                28     0.00%         454               454     0.00%           0                 0         -
mcp-auth/src/monitoring/security_monitor.rs                   292               292     0.00%          71                71     0.00%         560               560     0.00%           0                 0         -
mcp-auth/src/performance.rs                                   221               221     0.00%          40                40     0.00%         462               462     0.00%           0                 0         -
mcp-auth/src/permissions/mcp_permissions.rs                   230               230     0.00%          33                33     0.00%         331               331     0.00%           0                 0         -
mcp-auth/src/security/request_security.rs                     266               266     0.00%          49                49     0.00%         668               668     0.00%           0                 0         -
mcp-auth/src/session/session_manager.rs                       261               261     0.00%          57                57     0.00%         388               388     0.00%           0                 0         -
mcp-auth/src/setup/mod.rs                                      63                63     0.00%          21                21     0.00%         172               172     0.00%           0                 0         -
mcp-auth/src/setup/validator.rs                                77                77     0.00%          11                11     0.00%         138               138     0.00%           0                 0         -
mcp-auth/src/storage.rs                                       403               391     2.98%          62                57     8.06%         460               441     4.13%           0                 0         -
mcp-auth/src/transport/auth_extractors.rs                      54                54     0.00%          28                28     0.00%         149               149     0.00%           0                 0         -
mcp-auth/src/transport/http_auth.rs                           147               147     0.00%          23                23     0.00%         236               236     0.00%           0                 0         -
mcp-auth/src/transport/stdio_auth.rs                          157               157     0.00%          24                24     0.00%         210               210     0.00%           0                 0         -
mcp-auth/src/transport/websocket_auth.rs                      199               199     0.00%          25                25     0.00%         273               273     0.00%           0                 0         -
mcp-auth/src/validation.rs                                     85                85     0.00%          13                13     0.00%         104               104     0.00%           0                 0         -
mcp-auth/src/vault/infisical.rs                               348               348     0.00%          61                61     0.00%         545               545     0.00%           0                 0         -
mcp-auth/src/vault/mod.rs                                      68                68     0.00%          17                17     0.00%          98                98     0.00%           0                 0         -
mcp-cli-derive/src/lib.rs                                     178               178     0.00%          22                22     0.00%         623               623     0.00%           0                 0         -
mcp-cli/src/config.rs                                          34                29    14.71%          13                10    23.08%          77                64    16.88%           0                 0         -
mcp-cli/src/lib.rs                                              5                 5     0.00%           5                 5     0.00%          15                15     0.00%           0                 0         -
mcp-cli/src/server.rs                                          60                60     0.00%          34                34     0.00%         217               217     0.00%           0                 0         -
mcp-cli/src/utils.rs                                           62                62     0.00%          13                13     0.00%          74                74     0.00%           0                 0         -
mcp-logging/src/aggregation.rs                                144               144     0.00%          28                28     0.00%         253               253     0.00%           0                 0         -
mcp-logging/src/alerting.rs                                   251               188    25.10%          39                17    56.41%         453               240    47.02%           0                 0         -
mcp-logging/src/correlation.rs                                189               189     0.00%          34                34     0.00%         317               317     0.00%           0                 0         -
mcp-logging/src/dashboard.rs                                  152               120    21.05%          21                15    28.57%         415               197    52.53%           0                 0         -
mcp-logging/src/metrics.rs                                    146                83    43.15%          36                19    47.22%         347               128    63.11%           0                 0         -
mcp-logging/src/persistence.rs                                231               231     0.00%          28                28     0.00%         217               217     0.00%           0                 0         -
mcp-logging/src/profiling.rs                                  210               209     0.48%          37                36     2.70%         451               407     9.76%           0                 0         -
mcp-logging/src/sanitization.rs                               117               116     0.85%          22                21     4.55%         209               201     3.83%           0                 0         -
mcp-logging/src/structured.rs                                  86                85     1.16%          24                23     4.17%         256               253     1.17%           0                 0         -
mcp-logging/src/telemetry.rs                                   43                25    41.86%          12                 5    58.33%         106                42    60.38%           0                 0         -
mcp-monitoring/src/collector.rs                                72                36    50.00%          19                 8    57.89%         141                58    58.87%           0                 0         -
mcp-monitoring/src/config.rs                                    1                 0   100.00%           1                 0   100.00%           8                 0   100.00%           0                 0         -
mcp-monitoring/src/lib.rs                                       1                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
mcp-monitoring/src/metrics.rs                                   1                 1     0.00%           1                 1     0.00%          11                11     0.00%           0                 0         -
mcp-protocol/src/error.rs                                      62                42    32.26%          25                16    36.00%         131                97    25.95%           0                 0         -
mcp-protocol/src/errors.rs                                     30                30     0.00%          12                12     0.00%          41                41     0.00%           0                 0         -
mcp-protocol/src/lib.rs                                         5                 5     0.00%           2                 2     0.00%          11                11     0.00%           0                 0         -
mcp-protocol/src/model.rs                                      43                42     2.33%          30                29     3.33%         177               170     3.95%           0                 0         -
mcp-protocol/src/validation.rs                                141               141     0.00%          23                23     0.00%         167               167     0.00%           0                 0         -
mcp-security/src/config.rs                                      1                 0   100.00%           1                 0   100.00%           9                 0   100.00%           0                 0         -
mcp-security/src/lib.rs                                         1                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
mcp-security/src/middleware.rs                                 11                 3    72.73%           3                 0   100.00%          27                 3    88.89%           0                 0         -
mcp-security/src/validation.rs                                  6                 6     0.00%           1                 1     0.00%          14                14     0.00%           0                 0         -
mcp-server/src/alerting_endpoint.rs                            48                48     0.00%          15                15     0.00%         112               112     0.00%           0                 0         -
mcp-server/src/backend.rs                                      90                77    14.44%          45                38    15.56%         120               104    13.33%           0                 0         -
mcp-server/src/context.rs                                      10                 3    70.00%          10                 3    70.00%          46                16    65.22%           0                 0         -
mcp-server/src/dashboard_endpoint.rs                           36                36     0.00%          12                12     0.00%          81                81     0.00%           0                 0         -
mcp-server/src/handler.rs                                     189               120    36.51%          51                29    43.14%         215               123    42.79%           0                 0         -
mcp-server/src/health_endpoint.rs                              38                38     0.00%           6                 6     0.00%          96                96     0.00%           0                 0         -
mcp-server/src/metrics_endpoint.rs                             57                57     0.00%           7                 7     0.00%          94                94     0.00%           0                 0         -
mcp-server/src/middleware.rs                                   81                27    66.67%          13                 5    61.54%         108                17    84.26%           0                 0         -
mcp-server/src/server.rs                                      155                63    59.35%          38                19    50.00%         253                76    69.96%           0                 0         -
mcp-transport/src/batch.rs                                    127               127     0.00%          14                14     0.00%         134               134     0.00%           0                 0         -
mcp-transport/src/config.rs                                     5                 4    20.00%           5                 4    20.00%          15                12    20.00%           0                 0         -
mcp-transport/src/http.rs                                     355               348     1.97%          45                41     8.89%         521               489     6.14%           0                 0         -
mcp-transport/src/lib.rs                                        6                 1    83.33%           1                 0   100.00%          12                 3    75.00%           0                 0         -
mcp-transport/src/stdio.rs                                    120                94    21.67%          20                12    40.00%         184               136    26.09%           0                 0         -
mcp-transport/src/streamable_http.rs                          116               116     0.00%          22                22     0.00%         176               176     0.00%           0                 0         -
mcp-transport/src/validation.rs                               122               122     0.00%          14                14     0.00%         151               151     0.00%           0                 0         -
mcp-transport/src/websocket.rs                                 14                 9    35.71%           8                 5    37.50%          20                13    35.00%           0                 0         -
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                        9593              8252    13.98%        1966              1621    17.55%       18988             14436    23.97%           0                 0         -

📋 Full Report: View on Codecov

@codecov
Copy link

codecov bot commented Jul 20, 2025

Codecov Report

❌ Patch coverage is 62.50000% with 36 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mcp-protocol/src/errors.rs 55.35% 25 Missing ⚠️
mcp-protocol/src/error.rs 0.00% 11 Missing ⚠️

📢 Thoughts on this report? Let us know!

avrabe added 20 commits July 20, 2025 07:40
Fixed clippy warnings about holding MutexGuard across await points by
properly scoping the mutex locks to drop before async calls. This
ensures the locks are released before any await operations.
- Add new errors.rs module with standardized error types and prelude
- Introduce McpResult type alias for consistent error handling
- Add mcp_error\! macro for simplified error creation with context
- Enhance error module with validation, internal, and custom error constructors
- Add re-exports in protocol lib.rs for improved ergonomics
- Add error handling support in logging module

This change creates a unified error handling approach across the entire
MCP framework, reducing boilerplate and improving developer experience.
The new system provides consistent error types while maintaining
backward compatibility with existing error handling patterns.
- Add new mcp-macros crate with complete macro implementations
- Implement #[mcp_server] macro for automatic server generation
- Add #[mcp_tools] macro for tool integration (currently passthrough)
- Include #[mcp_tool] and #[mcp_backend] macro foundations
- Add comprehensive utility functions for macro processing
- Implement 57 comprehensive tests covering all macro scenarios

Key features:
- Automatic server configuration and builder pattern generation
- Server capability detection and metadata extraction
- Error validation with proper compile-time checks
- Support for async/sync tools, complex parameter patterns
- Comprehensive edge case handling including Unicode and generics
- Integration with harmonized error system

The macro system reduces boilerplate by ~90% and provides a streamlined
developer experience for creating MCP servers and tools.
…new features

- Add hello-world-simplified example showing basic MCP server usage
- Add hello-world-macros example demonstrating procedural macro usage
- Add error-harmonization-demo showcasing unified error handling

These examples provide:
- Step-by-step progression from basic to advanced MCP usage
- Practical demonstrations of macro system capabilities
- Error handling best practices with harmonized error system
- Real-world patterns for server and tool implementation

The examples serve as both documentation and validation of the
framework's ease of use and developer experience improvements.
- Add mcp-macros crate to workspace members
- Include new example applications in workspace
- Update memory-only-auth example to use harmonized error system
- Update Cargo.lock with new dependencies for macro system

Changes include:
- Integration of procedural macro dependencies (syn, quote, darling)
- Addition of schemars for JSON schema generation in macros
- Updates to support comprehensive macro testing infrastructure
- Migration of existing examples to use new error handling patterns

This completes the integration of the macro system into the
workspace structure and ensures all components work together.
- Remove unused functions in mcp-macros (dead_code warnings)
- Fix derivable impl in mcp_server.rs and test files
- Add #[allow] attributes for test-only code
- Fix format string warnings (uninlined_format_args)
- Remove useless type conversions in examples
- Add Default implementations to avoid new_without_default warnings

All clippy warnings resolved while maintaining functionality.
Tests continue to pass (377 total).
- Introduce new mcp-macros crate with procedural macro system
- Add comprehensive example applications
- Implement #[mcp_server], #[mcp_tools] macros
- Follows semantic versioning for new feature addition

This version properly reflects the introduction of the new
procedural macro system and expanded example suite.
- Remove 11 unused functions from mcp_tool.rs causing dead_code warnings
- Use #[derive(Default)] instead of manual Default implementations
- Fix format strings to use inline arguments (uninlined_format_args)
- Remove unnecessary .into() conversions (useless_conversion)
- Add #[allow(dead_code)] to test code and examples
- Run cargo fmt to fix all formatting issues
- Update version to 0.6.0 to reflect new mcp-macros crate
…CI failures

- Add rust-toolchain.toml to pin Rust 1.82 across all environments
- Update workspace rust-version from 1.79 to 1.82 for consistency
- Update Docker validation to use exact toolchain version with version logging
- Fix cache contamination by including toolchain in cache keys
- Add cargo clean steps for procedural macro artifacts
- Add comprehensive environment logging to CI workflows
- Fix unknown lint issue in mcp-external-validation for Rust 1.82 compatibility

This resolves environment-specific CI failures caused by different Rust versions
having different clippy rules across local dev, CI, and Docker environments.
… stable

The previous approach using dtolnay/rust-toolchain@stable was installing
Rust 1.88.0 then being overridden by rust-toolchain.toml to 1.82, causing
version conflicts and clippy inconsistencies.

Changes:
- Update all CI workflows to use dtolnay/[email protected] explicitly
- This ensures consistent Rust 1.82 usage across all environments
- Eliminates the version mismatch that caused clippy rule differences

This should resolve the remaining CI failures by ensuring true version
consistency between local development, CI, and Docker environments.
…test coverage

- Use --release builds across all CI workflows (94% size reduction)
- Add strategic cargo clean between build phases
- Optimize Docker build with artifact cleanup
- Update cache keys for release builds
- Keep all tests, features, and packages intact
- Add missing mcp-macros directory to Dockerfile.validation
- Update Security validation to use nightly Rust for edition2024 support
- Handle cargo audit edition2024 issue with fallback
- Convert all builds to --release mode for disk space optimization
- Update security lints to use release builds
- Update rust-toolchain.toml from 1.82 to 1.85
- Update all CI workflows to use dtolnay/[email protected]
- Update Cargo.toml workspace rust-version to 1.85
- Update Docker image to rust:1.85-slim
- Update cache keys to match new version
- Remove nightly requirement for security validation

This resolves cargo audit edition2024 feature requirement issues.
- Fix test_file_storage_persistence decryption error
- Hold test mutex for entire test duration instead of scoped blocks
- Ensure thread-safe environment variable handling
- Compatible with Rust 1.85+ stricter environment variable safety
Fix formatting issue where the #[allow(clippy::await_holding_lock)] attribute
had a literal \n character instead of proper line break.
Fix clippy::await_holding_lock warnings in test_file_storage_cleanup_backups
and test_file_storage_atomic_operations by adding the allow attribute and
restructuring lock usage for thread-safe environment variable handling.
Fix version conflict where External Validation was using stable Rust 1.88
while rust-toolchain.toml specifies 1.85, causing CI failures.
- Add write_mutex to FileStorage struct to serialize file operations
- Update save_key, delete_key, and save_all_keys to use mutex
- Extract save_all_keys_internal as private method for unlocked operations
- Fixes test_file_storage_atomic_operations serialization failures
…lation

- Add AuthConfig::for_application() and ::with_custom_path() methods
- Support PULSEENGINE_MCP_APP_NAME environment variable override
- Add application-specific master key env vars (PULSEENGINE_MCP_MASTER_KEY_{APP_NAME})
- Add public for_application() function to auth crate
- Maintains backward compatibility with existing configurations

Storage paths now follow pattern: ~/.pulseengine/{app_name}/mcp-auth/keys.enc
@avrabe avrabe closed this Jul 27, 2025
@avrabe avrabe deleted the fix/formatting-issues branch July 27, 2025 01:10
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.

2 participants