-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic build group membership via file #1099
Comments
We actually have something kinda like this in CDash already. Our API (which needs better documentation) accepts a list of dynamic builds via PUT. Here's an example of how to use it in python: #!/usr/bin/env python
import requests
import sys
if __name__ == "__main__":
headers = {"Authorization": "Bearer <token goes here>"}
url = "https://<cdash-url>/api/v1/buildgroup.php"
payload = {
"projectid": 1,
"buildgroupid": 7,
"dynamiclist": [
{ "match": 'foo', "parentgroupid": 15, "siteid": 22, },
{ "match": 'bar', "parentgroupid": 15, "siteid": 22, },
{ "match": 'baz', "parentgroupid": 15, "siteid": 22, },
]
}
r = requests.put(url, json=payload, headers=headers)
if not r.ok:
print("Problem: {0} / {1}\n".format(r.status_code, r.text))
sys.exit(1)
else:
print "success" It's a little fiddly since you need to know numeric ids for your project, source group, and destination group. Nonetheless, let me know if this would serve for your use case, or if you had something else in mind. |
Nifty :) . If we could programmatically grab the id numbers, this could be made into a script that we run instead of having CDash fetch it for us. Are there endpoints for that? |
Yes. For ParaView specifically, this one should give you everything you need: https://open.cdash.org/api/v1/manageBuildGroup.php?projectid=9 Please let us know if anything is missing. |
Hmm, that just gives |
Ah, I think I found this which is probably a decent starting point: https://www.paraview.org/Wiki/CDash:API |
Yup, you found it. Particularly the "auth token" section. If you're doing this from a script you'll need to provide that as a Bearer Token in the header, as I demonstrated above. |
I made a token on open.cdash.org, but it is still saying 'requirelogin: 1 |
It's a 401 HTTP error if that helps. |
Thanks for giving it a shot, I'll take a closer look & let you know what I find. |
Hey Ben, Thanks for pointing this out. It turns out that we weren't consistently checking for bearer tokens across all our API endpoints. This is fixed now. Let us know if you run into any more trouble setting this up. |
There is now this script which can use files which look like this. |
Dynamic build groups are great, but maintaining them is a pain. It'd be nice if it were possible to host a file containing the list of expected builds in a repository and have CDash fetch it periodically (daily seems reasonable).
Something like:
Syntax can be bikeshed (JSON vs. YAML; no idea which is easier for CDash). If an update is invalid, an email should be sent to administrator(s) of the project and the last-valid state should be used instead (verifying that it is valid upon initial submission of the URL).
Each dynamic group should be able to use its own URL (e.g., ParaView's CDash gets info from
paraview/paraview
andparaview/paraview-superbuild
and has a dynamic group for each).The text was updated successfully, but these errors were encountered: