Skip to content

Make project search paths configurable via ConfigManager and API#78

Open
miethe wants to merge 1 commit intomainfrom
configurable-project-search-paths-17018136616428496921
Open

Make project search paths configurable via ConfigManager and API#78
miethe wants to merge 1 commit intomainfrom
configurable-project-search-paths-17018136616428496921

Conversation

@miethe
Copy link
Owner

@miethe miethe commented Feb 10, 2026

This change makes the project search paths configurable, allowing users to specify custom directories for project discovery via the configuration file or the settings API. It modifies ConfigManager to handle the new setting, adds corresponding API endpoints, and updates the project discovery logic in both projects.py and project_registry.py to respect the configured paths. Default paths are used as a fallback.


PR created automatically by Jules for task 17018136616428496921 started by @miethe

- Add methods to `ConfigManager` in `skillmeat/config.py` to get/set `project-search-paths`.
- Add `ProjectSearchPathsRequest` and `ProjectSearchPathsResponse` schemas in `skillmeat/api/schemas/settings.py`.
- Add endpoints `GET /settings/project-search-paths`, `POST /settings/project-search-paths`, `POST /settings/project-search-paths/add`, and `POST /settings/project-search-paths/remove` in `skillmeat/api/routers/settings.py`.
- Update `discover_projects` in `skillmeat/api/routers/projects.py` to use configured paths.
- Update `_get_search_paths` in `skillmeat/api/project_registry.py` to use configured paths.
- Add `tests/test_config_settings.py` to verify the new functionality.

Co-authored-by: miethe <6800980+miethe@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

paths = config.get_project_search_paths()
if paths:
return [Path(p) for p in paths]
except Exception:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.

Copilot Autofix

AI 16 days ago

In general, empty except blocks over broad exception types should either be removed, narrowed to specific expected exceptions, or augmented to at least log or otherwise record the error, and ideally include a comment explaining why suppression is safe. Here we want to keep the behavior of falling back to default search paths when configuration lookup fails, but avoid completely silent failure.

The best fix without changing functionality is to replace the bare except Exception: pass with an except Exception as e: block that logs the failure (including exception details) and adds a short explanatory comment. The function will still proceed to the default paths that follow the try/except, so external behavior (using defaults on failure) remains the same, but operators and developers will now see why config-based paths were not used. No new imports are necessary because logging and logger already exist in the module.

Concretely, in skillmeat/api/project_registry.py, in the _get_search_paths method around lines 117–125, change:

        try:
            from skillmeat.config import ConfigManager

            config = ConfigManager()
            paths = config.get_project_search_paths()
            if paths:
                return [Path(p) for p in paths]
        except Exception:
            pass

to something like:

        try:
            from skillmeat.config import ConfigManager

            config = ConfigManager()
            paths = config.get_project_search_paths()
            if paths:
                return [Path(p) for p in paths]
        except Exception as exc:
            # Best-effort config loading; fall back to default search paths on any failure.
            logger.debug("Failed to load project search paths from config: %s", exc)

This keeps existing behavior but eliminates the empty except and adds traceability.

Suggested changeset 1
skillmeat/api/project_registry.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/skillmeat/api/project_registry.py b/skillmeat/api/project_registry.py
--- a/skillmeat/api/project_registry.py
+++ b/skillmeat/api/project_registry.py
@@ -122,8 +122,9 @@
             paths = config.get_project_search_paths()
             if paths:
                 return [Path(p) for p in paths]
-        except Exception:
-            pass
+        except Exception as exc:
+            # Best-effort config loading; on failure, fall back to default search paths.
+            logger.debug("Failed to load project search paths from config: %s", exc)
 
         home = Path.home()
         return [
EOF
@@ -122,8 +122,9 @@
paths = config.get_project_search_paths()
if paths:
return [Path(p) for p in paths]
except Exception:
pass
except Exception as exc:
# Best-effort config loading; on failure, fall back to default search paths.
logger.debug("Failed to load project search paths from config: %s", exc)

home = Path.home()
return [
Copilot is powered by AI and may make mistakes. Always verify output.
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