Skip to content

Conversation

@rpappalax
Copy link
Collaborator

@rpappalax rpappalax commented Oct 21, 2025

Purpose

The purpose of this PR is to add a TestRail Milestone CLOSED trigger. i.e. When someone closes a Milestone, some follow on actions would be performed.

Follow-on Actions

  • Update Confluence wiki (will be sending to a sandbox page first)
  • Send notification to #qa-coordination slack channel (will be sending to a sandbox channel first)

Notes

  • TestRail doesn't have webhooks so a polling every 15/min workflow is being introduced (see notes on that below).

ChatGPT

  • polling every 15 minutes from GitHub Actions is totally fine.
  • GitHub Actions scheduled workflows support runs as often as every 5 minutes, so a 15-minute cron is well within the platform’s intent. Schedules can be a bit delayed under heavy load, but that’s normal.
  • TestRail Cloud’s API rate limits are 180 requests/min (Professional) or 300/min (Enterprise) per instance. Hitting it 4 times an hour (every 15 min) is negligible. If you ever do bursty calls, they send 429 with Retry-After.

__main__.py Outdated
handle_bitrise_builds,
)

"""
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commenting this out for now only because its throwing an error locally

__main__.py Outdated
'bugzilla-meta-bugs': handle_bugzilla_meta_bugs,
'bugzilla-qe-verify': handle_bugzilla_qe_verify,
'bugzilla-query-by-keyword': handle_bugzilla_query_by_keyword,
#'bugzilla-desktop-bugs': handle_bugzilla_desktop_bugs,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

pl.extract_build_version
)

import sys
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DIAGNOSTIC only



def handle_testrail_milestones_closed(args):
milestone_validate_closed = True
Copy link
Collaborator Author

@rpappalax rpappalax Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doing it this way, we don't have to make the COMMAND_MAP more complex with additional input params. We simply use a different function name and pass in an optional variable which will trigger an alternate path for the report module we already have in place for milestones

# ===================================================================

def report_milestones_insert(projects_id, payload):
def _db_upsert(projects_id, payload):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upsert is a stand name for an insert / update / upload operation.

# ===================================================================

def testrail_milestones(project):
def run(project, milestone_validate_closed: bool = False):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is only 1 entry point to this module (and all report modules). Standard practice in this case is to use an entry function called: run.

Other new standards here are using: _fetch for fetching external API data
and _upsert for remote update / upload / insert operations

@@ -0,0 +1,88 @@
name: Testops - TestRail Milestone CLOSED - polling
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

introducing a new workflow environment: demo for PRs
Once the PR has passed review, demo can change to either staging or production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants