Closed macumber closed 3 years ago
@macumber, I think group by org sounds great! Can you resolve the conflicts? I can merge to develop. As soon as this is merged to the main branch, the repo will be added to the BCL. Any release you make after you configure the webhook as described in step3 of this page: https://bcl2.nrel.gov/contribute will be added to the BCL automatically. You can check the status of the releases on the dashboard page. Let me know if you have any questions.
@kflemin I fixed the merge conflicts. @jmarrec I avoided making my repo depend on openstudio-extension-gem
because that repo's gemspec specifies Ruby 2.7.0. It's a bit confusing because the measure's themselves can specify an OpenStudio version but putting that in the gemspec would prevent you from using it in a gem based project (e.g. URBANopt) with an older version of OpenStudio. I'm not sure which parts of the extension gem are really required for the BCL. The BCL doesn't run any rake tasks when it imports measures right? It just takes the measure files directly? Long story short, I can make changes if needed but I'm not sure any changes are needed?
@macumber, thanks! Last thing missing is that each measure in lib/measures need a LICENSE file. And, just FYI, for our URBANopt measure gems, we did make them dependent on openstudio-extension-gem and are tying them to a specific Ruby version. So we can't use a newer version of a gem in an older version of URBANopt. We are going by our particular compatibility matrix b/c we can't ensure that everything work with everything else. You are right that BCL doesn't run rake tasks, but for the NREL gems we do run the extension gem "test_with_openstudio" rake task before making a release. :)
@macumber I've merged this PR to main. Your repo will be automatically added to the BCL overnight, and once you configure the webhook (step3 on this page: https://bcl2.nrel.gov/contribute), the next time you make a release the measures will be automatically added.
@kflemin I tried releasing https://github.com/automaticmagic/automaticmagic-measures/releases/tag/v0.1.0.
It looks like the webhook ran but I got a 400 error back: {"detail":"Bad Request. Missing release information"}
Am I missing something in my release? Also, out of curiousity, will BCL2 listen to release delete events if someone wants to pull a release?
I can post the details of the request or response if you want them. Also let me know if you want me to report this somewhere else.
Here are the details
Request
Headers
Request URL: https://bcl2.nrel.gov/release
Request method: POST
Accept: */*
content-type: application/json
User-Agent: GitHub-Hookshot/8d33975
X-GitHub-Delivery: 45b97bd0-0837-11ec-9743-666781974d28
X-GitHub-Event: release
X-GitHub-Hook-ID: 310428455
X-GitHub-Hook-Installation-Target-ID: 380107374
X-GitHub-Hook-Installation-Target-Type: repository
Payload
{
"action": "published",
"release": {
"url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/releases/48619050",
"assets_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/releases/48619050/assets",
"upload_url": "https://uploads.github.com/repos/automaticmagic/automaticmagic-measures/releases/48619050/assets{?name,label}",
"html_url": "https://github.com/automaticmagic/automaticmagic-measures/releases/tag/v0.1.0",
"id": 48619050,
"author": {
"login": "macumber",
"id": 1327850,
"node_id": "MDQ6VXNlcjEzMjc4NTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1327850?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/macumber",
"html_url": "https://github.com/macumber",
"followers_url": "https://api.github.com/users/macumber/followers",
"following_url": "https://api.github.com/users/macumber/following{/other_user}",
"gists_url": "https://api.github.com/users/macumber/gists{/gist_id}",
"starred_url": "https://api.github.com/users/macumber/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/macumber/subscriptions",
"organizations_url": "https://api.github.com/users/macumber/orgs",
"repos_url": "https://api.github.com/users/macumber/repos",
"events_url": "https://api.github.com/users/macumber/events{/privacy}",
"received_events_url": "https://api.github.com/users/macumber/received_events",
"type": "User",
"site_admin": false
},
"node_id": "MDc6UmVsZWFzZTQ4NjE5MDUw",
"tag_name": "v0.1.0",
"target_commitish": "main",
"name": "v0.1.0",
"draft": false,
"prerelease": false,
"created_at": "2021-08-28T19:28:32Z",
"published_at": "2021-08-28T19:36:42Z",
"assets": [
],
"tarball_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/tarball/v0.1.0",
"zipball_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/zipball/v0.1.0",
"body": "Initial release"
},
"repository": {
"id": 380107374,
"node_id": "MDEwOlJlcG9zaXRvcnkzODAxMDczNzQ=",
"name": "automaticmagic-measures",
"full_name": "automaticmagic/automaticmagic-measures",
"private": false,
"owner": {
"login": "automaticmagic",
"id": 24538042,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjI0NTM4MDQy",
"avatar_url": "https://avatars.githubusercontent.com/u/24538042?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/automaticmagic",
"html_url": "https://github.com/automaticmagic",
"followers_url": "https://api.github.com/users/automaticmagic/followers",
"following_url": "https://api.github.com/users/automaticmagic/following{/other_user}",
"gists_url": "https://api.github.com/users/automaticmagic/gists{/gist_id}",
"starred_url": "https://api.github.com/users/automaticmagic/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/automaticmagic/subscriptions",
"organizations_url": "https://api.github.com/users/automaticmagic/orgs",
"repos_url": "https://api.github.com/users/automaticmagic/repos",
"events_url": "https://api.github.com/users/automaticmagic/events{/privacy}",
"received_events_url": "https://api.github.com/users/automaticmagic/received_events",
"type": "Organization",
"site_admin": false
},
"html_url": "https://github.com/automaticmagic/automaticmagic-measures",
"description": null,
"fork": false,
"url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures",
"forks_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/forks",
"keys_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/teams",
"hooks_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/hooks",
"issue_events_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/issues/events{/number}",
"events_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/events",
"assignees_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/assignees{/user}",
"branches_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/branches{/branch}",
"tags_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/tags",
"blobs_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/statuses/{sha}",
"languages_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/languages",
"stargazers_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/stargazers",
"contributors_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/contributors",
"subscribers_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/subscribers",
"subscription_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/subscription",
"commits_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/contents/{+path}",
"compare_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/merges",
"archive_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/downloads",
"issues_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/issues{/number}",
"pulls_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/pulls{/number}",
"milestones_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/milestones{/number}",
"notifications_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/labels{/name}",
"releases_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/releases{/id}",
"deployments_url": "https://api.github.com/repos/automaticmagic/automaticmagic-measures/deployments",
"created_at": "2021-06-25T02:54:27Z",
"updated_at": "2021-08-28T19:28:35Z",
"pushed_at": "2021-08-28T19:36:42Z",
"git_url": "git://github.com/automaticmagic/automaticmagic-measures.git",
"ssh_url": "git@github.com:automaticmagic/automaticmagic-measures.git",
"clone_url": "https://github.com/automaticmagic/automaticmagic-measures.git",
"svn_url": "https://github.com/automaticmagic/automaticmagic-measures",
"homepage": null,
"size": 25,
"stargazers_count": 0,
"watchers_count": 0,
"language": "Ruby",
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": {
"key": "mit",
"name": "MIT License",
"spdx_id": "MIT",
"url": "https://api.github.com/licenses/mit",
"node_id": "MDc6TGljZW5zZTEz"
},
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "main"
},
"organization": {
"login": "automaticmagic",
"id": 24538042,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjI0NTM4MDQy",
"url": "https://api.github.com/orgs/automaticmagic",
"repos_url": "https://api.github.com/orgs/automaticmagic/repos",
"events_url": "https://api.github.com/orgs/automaticmagic/events",
"hooks_url": "https://api.github.com/orgs/automaticmagic/hooks",
"issues_url": "https://api.github.com/orgs/automaticmagic/issues",
"members_url": "https://api.github.com/orgs/automaticmagic/members{/member}",
"public_members_url": "https://api.github.com/orgs/automaticmagic/public_members{/member}",
"avatar_url": "https://avatars.githubusercontent.com/u/24538042?v=4",
"description": null
},
"sender": {
"login": "macumber",
"id": 1327850,
"node_id": "MDQ6VXNlcjEzMjc4NTA=",
"avatar_url": "https://avatars.githubusercontent.com/u/1327850?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/macumber",
"html_url": "https://github.com/macumber",
"followers_url": "https://api.github.com/users/macumber/followers",
"following_url": "https://api.github.com/users/macumber/following{/other_user}",
"gists_url": "https://api.github.com/users/macumber/gists{/gist_id}",
"starred_url": "https://api.github.com/users/macumber/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/macumber/subscriptions",
"organizations_url": "https://api.github.com/users/macumber/orgs",
"repos_url": "https://api.github.com/users/macumber/repos",
"events_url": "https://api.github.com/users/macumber/events{/privacy}",
"received_events_url": "https://api.github.com/users/macumber/received_events",
"type": "User",
"site_admin": false
}
}
Response
Headers
Access-Control-Allow-Origin: domain
Cache-Control: no-cache, no-store, must-revalidate, max-age=0, s-maxage=0
Content-Length: 53
Content-Type: application/json
Date: Sat, 28 Aug 2021 19:40:37 GMT
Public-Key-Pins: pin-sha256="X3pGTSOuJeEVw989IJ/cEtXUEmy52zs1TZQrU06KUKg=" max-age=15552000; includeSubDomains
Strict-Transport-Security: max-age=31622400
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
Body
{"detail":"Bad Request. Missing release information"}
Hi @macumber! That is strange that you got a 400. Looks like both of your releases made it to the BCL just fine:
The content also showed up in the searches: the first URL returns the latest version of all matching content, the 2nd one would return all versions:
https://bcl2.nrel.gov/api/search/idf_to_osm https://bcl2.nrel.gov/api/search/idf_to_osm?&all_content_versions=1
Thanks Kat, I was thinking there was an issue after looking at the recent deliveries of the webhook:
Maybe the BCL service is taking the payload correctly but returning the wrong value? Maybe this is just happening for me?
yeah that does look weird. My test repo has 200 statuses and a green checkmark next to them. @jmarrec, what do you see on your repo?
Similar to Dan I guess:
If I click the most recent, I see it timed out
How are you going to want to organize these? Add to the end? Alphabetize? Might want to group by org?