posit-dev / publisher

MIT License
3 stars 0 forks source link

Recursive deployments API #1928

Closed mmarchetti closed 3 days ago

mmarchetti commented 3 days ago

Intent

This PR implements a recursive option to the GET /api/deployments endpoint.

Part of https://github.com/posit-dev/publisher/issues/1850

Type of Change

Approach

Walk the tree looking for .posit directories; when one is found, list configurations from the parent directory. The built-in exclusions are applied to avoid excess directory traversals.

Automated Tests

Added tests for the recursive flag.

Directions for Reviewers

$(just executable-path) ui -vv --listen=localhost:9001 &
curl -s localhost:9001/api/deployments?recursive=true | jq
curl -s 'localhost:9001/api/deployments?recursive=true&dir=test/sample-content/fastapi-simple' | jq
curl -s 'localhost:9001/api/deployments?recursive=true&dir=test&entrypoint=simple.py' | jq