Skip to content

strip whitespace from comma-separated service names#205

Open
AnshulPatil2005 wants to merge 1 commit into
sugar-org:mainfrom
AnshulPatil2005:servicespace
Open

strip whitespace from comma-separated service names#205
AnshulPatil2005 wants to merge 1 commit into
sugar-org:mainfrom
AnshulPatil2005:servicespace

Conversation

@AnshulPatil2005

@AnshulPatil2005 AnshulPatil2005 commented Feb 17, 2026

Copy link
Copy Markdown

Pull Request description

Fixes a bug where passing service names with spaces after commas (e.g. --services "service1, service2") would silently fail to match services. The space was being included as part of the service name, causing mismatches.

Root cause: _arg_services.split(',') in _get_services_names did not strip whitespace from each element.
Fix: Changed to [s.strip() for s in _arg_services.split(',')] in src/sugar/extensions/base.py.

solve #204

How to test these changes

run test

  • pytest tests/test_ext_compose.py::test_cmd_build_services_with_spaces

Pull Request checklists

This PR is a:

  • bug-fix
  • new feature
  • maintenance

About this PR:

  • it includes tests.
  • the tests are executed on CI.
  • the tests generate log file(s) (path).
  • pre-commit hooks were executed locally.
  • this PR requires a project documentation update.

Author's checklist:

  • I have reviewed the changes and it contains no misspelling.
  • The code is well commented, especially in the parts that contain more
    complexity.
  • New and old tests passed locally.

Additional information

Before fix: "service1, service2".split(',')['service1', ' service2'] — the leading space on service2 causes a lookup failure.

After fix: [s.strip() for s in "service1, service2".split(',')]['service1', 'service2'] — correct.

Changed file: src/sugar/extensions/base.py line 436.
Test added: tests/test_ext_compose.py::test_cmd_build_services_with_spaces.

@AnshulPatil2005

AnshulPatil2005 commented Feb 19, 2026

Copy link
Copy Markdown
Author

@sanjay7178 @xmnlab Could you please review this PR when you get a chance.

Thanks.

@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale because it has been
inactive for more than 30 days. Please update this pull request
or it will be automatically closed soon.

@github-actions github-actions Bot added the stale label Mar 27, 2026

@xmnlab xmnlab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a small issue with the claude code
Other than that it is ready to go

@@ -0,0 +1,10 @@
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please don't push claude files

@github-actions github-actions Bot removed the stale label Mar 28, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale because it has been
inactive for more than 30 days. Please update this pull request
or it will be automatically closed soon.

@github-actions github-actions Bot added the stale label Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants