Skip to content

Commit

Permalink
intermittents commenter: fetch variants only once from source control
Browse files Browse the repository at this point in the history
  • Loading branch information
Archaeopteryx committed Dec 17, 2024
1 parent f8cce16 commit 4816daf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions treeherder/intermittents_commenter/commenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Commenter:
and priority status as need; if in dry_run, comments will be output
to stdout rather than submitting to bugzilla."""

test_variants = None

def __init__(self, weekly_mode, dry_run=False):
self.weekly_mode = weekly_mode
self.dry_run = dry_run
Expand Down Expand Up @@ -329,10 +331,13 @@ def fetch_test_variants(self):
mozilla_central_url = "https://hg.mozilla.org/mozilla-central"
variant_file_url = f"{mozilla_central_url}/raw-file/tip/taskcluster/kinds/test/variants.yml"
response = requests.get(variant_file_url, headers={"User-agent": "mach-test-info/1.0"})
return yaml.safe_load(response.text)
self.test_variants = yaml.safe_load(response.text)
return self.test_variants

def get_test_variant(self, test_suite):
test_variants = self.fetch_test_variants()
test_variants = (
self.fetch_test_variants() if self.test_variants is None else self.test_variants
)
# iterate through variants, allow for Base-[variant_list]
variant_symbols = sorted(
[
Expand Down

0 comments on commit 4816daf

Please sign in to comment.