Skip to content

Conversation

@niechen
Copy link
Contributor

@niechen niechen commented Apr 16, 2025

No description provided.

Copilot AI review requested due to automatic review settings April 16, 2025 13:26
@github-actions
Copy link
Contributor

Semantic Version Check

⚠️ No semantic version changes detected.

Please ensure your commits follow the Conventional Commits format:

  • feat: new feature (triggers MINOR version bump)
  • fix: bug fix (triggers PATCH version bump)
  • BREAKING CHANGE: description (triggers MAJOR version bump)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the handling of missing optional arguments by replacing their placeholders with empty strings. Key changes include:

  • Updating test assertions to expect empty strings instead of placeholders.
  • Modifying the environment filtering logic to include empty values.
  • Refactoring the variable replacement logic to directly use empty strings when variables are missing.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/test_add.py Updated tests to check for empty string replacement.
src/mcpm/schemas/server_config.py Altered filtering logic to include empty environment values.
src/mcpm/commands/server_operations/add.py Removed prompting logic and replaced missing variables with empty strings.
Comments suppressed due to low confidence (3)

src/mcpm/commands/server_operations/add.py:352

  • [nitpick] Consider renaming 'env_var_name' to a clearer identifier like 'environmentVariableName' for better readability.
processed_env[key] = processed_variables.get(env_var_name, "")

src/mcpm/commands/server_operations/add.py:364

  • Using an empty string as a fallback for missing variables might have unintended side effects; please double-check that this behavior is desired in all cases.
replaced_arg = arg.replace(original, processed_variables.get(key, ""))

src/mcpm/schemas/server_config.py:48

  • The updated environment filtering logic now includes empty strings; ensure that this adjustment doesn't introduce issues where non-empty values are required.
filtered_env[key] = env_value

@github-actions
Copy link
Contributor

Semantic Version Check

⚠️ No semantic version changes detected.

Please ensure your commits follow the Conventional Commits format:

  • feat: new feature (triggers MINOR version bump)
  • fix: bug fix (triggers PATCH version bump)
  • BREAKING CHANGE: description (triggers MAJOR version bump)

@github-actions
Copy link
Contributor

Semantic Version Check

⚠️ No semantic version changes detected.

Please ensure your commits follow the Conventional Commits format:

  • feat: new feature (triggers MINOR version bump)
  • fix: bug fix (triggers PATCH version bump)
  • BREAKING CHANGE: description (triggers MAJOR version bump)

@niechen niechen merged commit 9181610 into main Apr 17, 2025
10 checks passed
@niechen niechen deleted the cnie/fix-add-bug branch April 17, 2025 04:41
mcpm-semantic-release bot pushed a commit that referenced this pull request Apr 17, 2025
## [1.1.2](v1.1.1...v1.1.2) (2025-04-17)

### Bug Fixes

* add should remove optional argument placeholder ([#62](#62)) ([9181610](9181610))
* update the default user-agent for web-fetch ([#70](#70)) ([15df122](15df122))
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