forked from spack/spackbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to allow spackbot to rebuild everything (spack#67)
Support spackbot rebuilding all specs from source with `spackbot rebuild everything`.
- Loading branch information
1 parent
9cf6873
commit 7accb04
Showing
10 changed files
with
220 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
aiohttp | ||
boto3 | ||
gidgethub | ||
python_dotenv | ||
rq | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,13 +27,18 @@ | |
spack_upstream = "[email protected]:spack/spack" | ||
|
||
# Spack has project ID 2 | ||
gitlab_spack_project_url = "https://gitlab.spack.io/api/v4/projects/2" | ||
gitlab_spack_project_url = os.environ.get( | ||
"GITLAB_SPACK_PROJECT_URL", "https://gitlab.spack.io/api/v4/projects/2" | ||
) | ||
|
||
package_path = r"^var/spack/repos/builtin/packages/(\w[\w-]*)/package.py$" | ||
|
||
# Bot name can be modified in the environment | ||
botname = os.environ.get("SPACKBOT_NAME", "@spackbot") | ||
|
||
# Bucket where pr binary mirrors live | ||
pr_mirror_bucket = "spack-binaries-prs" | ||
|
||
# Aliases for spackbot so spackbot doesn't respond to himself | ||
aliases = ["spack-bot", "spackbot", "spack-bot-develop", botname] | ||
alias_regex = "(%s)" % "|".join(aliases) | ||
|
@@ -167,6 +172,16 @@ async def found(coroutine): | |
raise | ||
|
||
|
||
async def post(url, headers): | ||
""" | ||
Convenience method to create a new session and make a one-off | ||
post request, given a url and headers to include in the request. | ||
""" | ||
async with aiohttp.ClientSession() as session: | ||
async with session.post(url, headers=headers) as response: | ||
return await response.json() | ||
|
||
|
||
def synchronous_http_request(url, data=None, token=None): | ||
""" | ||
Makes synchronous http request to the provided url, using the token for | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.