Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtritt committed Mar 8, 2025
1 parent 940f1ac commit 99d600f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions common/t5common/jira/check_jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@


def format_query(config):
"""Build JQL query to get issues from Jira"""
return 'project = {project} AND status = "{new_status}"'.format(**config)


async def intiate_job(issue, project_config, config):
"""Start a job from an issue
Args:
issue: The Jira issue key
project_config: Information on the project to pull issues from
config: General information about this workflow runner
"""
logger.info(f"Initiating job for {issue}")
env, wd = get_job_env(issue, config)

Expand Down Expand Up @@ -70,6 +79,13 @@ async def intiate_job(issue, project_config, config):


async def check_jira(config):
"""Check Jira, and start a job for every issue returned
Args:
config: General information about this workflow runner. This should also contain
information about the projects to check and how to run jobs for those
projects
"""
# Connect to Jira
jc = JiraConnector(jira_host=config['host'],
jira_user=config['user'],
Expand Down
15 changes: 15 additions & 0 deletions common/t5common/jira/check_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@


async def publish_job(issue, project_config, config):
"""Publish results from a job
Args:
issue: The Jira issue key the job was run for
project_config: Information on the project, namely how to publish results
config: General information about this workflow runner
"""
logger.info(f"Publishing results for {issue}")
env, wd = get_job_env(issue, config)

Expand Down Expand Up @@ -55,6 +63,13 @@ async def publish_job(issue, project_config, config):


async def check_jobs(config):
"""Check for finished jobs and publish the results of finished jobs.
Args:
config: General information about this workflow runner. This should also contain
information about the projects to check and how to run jobs for those
projects
"""
database = config['database']
dbc = DBConnector(f"sqlite:///{database}")

Expand Down

0 comments on commit 99d600f

Please sign in to comment.