API to list all enabled projects ( not just followed )
J
Joseph Copenhaver
When I have a secret specified in environment variables I would like to iterate through all projects that are configured to run on circle and update the secret value.
There is currently no way for me to get a list of all projects configured to run on circle programmatically, I had to build it using the website and some regular expression foo.
The API only returns the projects that my user is a following, this does not meet my needs as I do not watch all projects and making it so my user automatically follows all new projects looks unadvised.Please provide a way to iterate through all enabled projects so I can leverage the per-project API more effectively.
CCI-I-671
W
Will Yardley
CCI-I-689 is also similar
W
Will Yardley
W
Will Yardley
I wrote a long response about this, but it got eaten. I also threw up a rant about it on a discussion board thread.
BTW, I dealt with this problem (sort of) the following way:
- Get a list of all org repos from the GH API
- Get a list of "followed" (by current user) repos from Circle's "get_projects" API endpoint.
- You can't just "follow" repos directly without checking first, because that will start them building, so next, for any repos not already followed or archived in GH, run "get_project" on each one; if no data, it's not being built. However, if the project was built in the past and you did stop building, you will still get some data back here.
It would be much better if you could list repos under a given slug, or that the current user has permissions to _see_ in GH, with status about whether Circle is building them or not, vs. having get projects only show you "followed" projects.
W
Will Yardley
Agree. Have complained about this before as well
threw up my little rant about this https://discuss.circleci.com/t/circleci-api-follow-a-new-project/46410
Maybe it's partly hard for Circle because users can be members of multiple orgs? But ideally, you could search by slug.
FWIW, what (sort of) works:
* load a list of all org repos from the _GitHub_ API
* ignore archived repos or repos already in the list of "followed" repos from
get_projects
* for remaining APIs, hit the
get_project
endpoint. Usually there is no data if the project has never been setup for Circle(optionally, you can then follow the projects), but don't try following a project that isn't setup, because doing so will set it up 🙃)