Page MenuHomePhabricator

[components-api] Create endpoint to get tools based on a set config
Closed, ResolvedPublic

Description

Proposal:

  • Add a public endpoint to components-api to get the list of tools that have certain configuration settings set
  • Make the tool configuration retrieval endpoint public

For the endpoint it could be:

/components/v1/config/search
With parameters:

  • matches: dict[str, Any], for example {"matches": {"path.to.config.key": "value"}}

We can extend that capability at some point if we want, but for now and by default, it can just match the full value.

So a call to get all the tools with a feature flag enabled, would be something like:

curl http://<path.to.api>/components/v1/config/search \
    --json '{"matches": {"global.network.enable_scrape_control": true}}'

And that should give you something like:

{
    "messages": {"info": [], "warning": [], "error": []},
    "data": {
        "matching_tools": ["tool1", "tool2"]
    }
}

This endpoint would enable the use cases described on T432864 and T433397

Details

Other Assignee
fnegri

Event Timeline

aputhin triaged this task as High priority.Aug 4 2026, 10:11 AM
dcaro changed the task status from Open to In Progress.Aug 25 2026, 11:02 AM
dcaro claimed this task.
dcaro moved this task from Todos to In progress on the tools-platform-team board.

group_203_bot_3c0afd0d9fd9529f3b7bc7e69a4a3bce opened https://gitlab.wikimedia.org/repos/cloud/toolforge/toolforge-deploy/-/merge_requests/1413

components-api: bump to 0.0.213-20260907152616-34306785

Example request:

dcaro@acme$ curl https://api.svc.toolforge.org/components/v1/config/search --json '{"matches": {"components.webservice.build.ref": "main"}}' | jq
  % Total    % Received % Xferd  Average Speed  Time    Time    Time   Current
                                 Dload  Upload  Total   Spent   Left   Speed
100    261 100    205 100     56    562    153                              0
{
  "data": {
    "matching_tools": [
      "cloud-glab-bot",
      "echo",
      "sample-php-buildpack-app",
      "sample-ruby-rails-buildpack-app"
    ]
  },
  "messages": {
    "info": [],
    "warning": [
      "You are using a beta feature of Toolforge."
    ],
    "error": []
  }
}
dcaro moved this task from Ready for Review to Done on the tools-platform-team board.