tasks

Celery Tasks doing the actual work

Tasks

get_latest_pr_commit(issue_number, ghapi)

Returns last commit

create_check_run(head_sha, ghapi[, recreate])

Creates a check_run on GitHub

bump(issue_number, ghapi)

Bump the build number in each recipe in PR

lint_check(check_run_number, ref, ghapi)

Execute linter

check_circle_artifacts(pr_number, ghapi)

Checks for packages and images uploaded to CircleCI artifacts

trigger_circle_rebuild(pr_number, ghapi)

Triggers a rebuild of the latest commit for a PR on CircleCI

merge_pr(pr_number, comment_id, ghapi)

Merges a PR

post_result(result, pr_number, _comment_id, …)

Proxy that evaluates object once.

create_welcome_post(pr_number, ghapi)

Post welcome message for first timers

run_autobump(package_names, ghapi, *_args)

Runs autobump on packages

Classes

Checkout(ghapi[, ref, issue_number, branch_name])

Async context manager checking out git repo

Image(url, name, tag)

Create new instance of Image(url, name, tag)

Package(arch, fname, url, repodata_md)

Create new instance of Package(arch, fname, url, repodata_md)

Documentation

class bioconda_utils.bot.tasks.Checkout(ghapi, ref=None, issue_number=None, branch_name='master')[source]

Bases: object

Async context manager checking out git repo

Parameters
  • ref – optional sha checksum to checkout (only if issue_number not given)

  • issue_number – optional issue number to checkout (only of ref not given)

Returns None if the checkout failed, otherwise the TempGitHandler object

>>> with Checkout(ghapi, issue_number) as git:
>>>   if git is None:
>>>      print("checkout failed")
>>>   else:
>>>      for filename in git.list_changed_files():
class bioconda_utils.bot.tasks.Image(url, name, tag)

Bases: tuple

Create new instance of Image(url, name, tag)

property name

Alias for field number 1

property tag

Alias for field number 2

property url

Alias for field number 0

class bioconda_utils.bot.tasks.Package(arch, fname, url, repodata_md)

Bases: tuple

Create new instance of Package(arch, fname, url, repodata_md)

property arch

Alias for field number 0

property fname

Alias for field number 1

property repodata_md

Alias for field number 3

property url

Alias for field number 2

(task)bioconda_utils.bot.tasks.bump(issue_number, ghapi)

Bump the build number in each recipe in PR

Parameters

issue_number (int) – Number of PR to bump recipes in

(task)bioconda_utils.bot.tasks.check_circle_artifacts(pr_number, ghapi)

Checks for packages and images uploaded to CircleCI artifacts

Parameters

pr_number (int) – Number of PR to check

(task)bioconda_utils.bot.tasks.create_check_run(head_sha, ghapi, recreate=True)

Creates a check_run on GitHub

Parameters
  • head_sha (str) – SHA of commit for which check_run will be created

  • recreate – If true, a new check_run will be created even if one already exists

(task)bioconda_utils.bot.tasks.create_welcome_post(pr_number, ghapi)

Post welcome message for first timers

(task)bioconda_utils.bot.tasks.get_latest_pr_commit(issue_number, ghapi)

Returns last commit

(task)bioconda_utils.bot.tasks.lint_check(check_run_number, ref, ghapi)

Execute linter

Parameters
  • check_run_number (int) – ID of GitHub check_run

  • ref (str) – SHA of commit to check

(task)bioconda_utils.bot.tasks.lint_fix(head_branch, head_sha, ghapi)

Execute linter in fix mode

Parameters
  • check_run_number – ID of GitHub check_run

  • ref – SHA of commit to check

(task)bioconda_utils.bot.tasks.merge_pr(pr_number, comment_id, ghapi)

Merges a PR

  • Downloads artifacts from CircleCI

  • Uploads Docker images to Quay.io

  • Uploads package to Anaconda.org

  • Collects co-authors

  • Merges with co-author trailer lines

Parameters
  • pr_number (int) – number of PR to merge

  • comment_id (int) – ID of comment in PR to use for posting progress

Return type

Tuple[bool, str]

(task)bioconda_utils.bot.tasks.post_result(result, pr_number, _comment_id, prefix, user, ghapi)

Proxy that evaluates object once.

Proxy will evaluate the object each time, while the promise will only evaluate it once.

Return type

None

(task)bioconda_utils.bot.tasks.run_autobump(package_names, ghapi, *_args)

Runs autobump on packages

Parameters

package_names – List of package names to check for version updates

(task)bioconda_utils.bot.tasks.trigger_circle_rebuild(pr_number, ghapi)

Triggers a rebuild of the latest commit for a PR on CircleCI

Parameters

pr_number (int) – Number of Github PR

(task)bioconda_utils.bot.tasks.update_pr_project_columns(issue_number, ghapi, *_args)

Updates project columns for PR according to labels