saltext.github.utils.gh.milestones

Operations on GitHub repository milestones.

saltext.github.utils.gh.milestones.get(conn, repo_name, number, *, owner=None)[source]

Return the raw data of a single milestone.

conn

GitHubConnection to use.

repo_name

Repository the milestone belongs to.

number

Milestone number to retrieve.

owner

Owner of the repository. Defaults to the connection’s owner.

saltext.github.utils.gh.milestones.list_all(conn, repo_name, *, state='open', sort='due_on', direction='asc', per_page=None, owner=None)[source]

Return the raw data of all milestones in a repository matching the search options.

conn

GitHubConnection to use.

repo_name

Repository whose milestones to list.

state

Filter milestones by their state. Either open, closed, or all. Default is open.

sort

Field to sort results by. Either due_on or completeness. Default is due_on.

direction

Sort direction. Either asc or desc. Default is asc.

per_page

Pagination size, maximum 100.

owner

Owner of the repository. Defaults to the connection’s owner.

saltext.github.utils.gh.milestones.find_by_title(conn, repo_name, title, *, owner=None)[source]

Return a milestone by its title. Since the GitHub API only addresses milestones by number, this searches the complete list.

conn

GitHubConnection to use.

repo_name

Name of the repository the milestone is part of.

title

Title of the milestone.

owner

Owner of the repository. Defaults to the connection’s owner.

Raises GitHubNotFoundError if no milestone carries the title.

saltext.github.utils.gh.milestones.format_milestone(milestone)[source]

Trim milestone data to the fields that are useful in (CLI) output.

milestone

Milestone to format.