Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions apis/taskcluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from collections import defaultdict
from urllib.parse import quote_plus

from components.utilities import retry, Struct, merge_dictionaries, PUSH_HEALTH_IGNORED_DICTS, PUSH_HEALTH_IGNORED_KEYS
from components.utilities import retry, Struct
from components.logging import logEntryExit, logEntryExitNoArgs, LogLevel
from components.providerbase import BaseProvider, INeedsCommandProvider, INeedsLoggingProvider

Expand Down Expand Up @@ -149,27 +149,21 @@ def _vcs_setup(self):

@logEntryExit
@retry
def submit_to_try(self, library, platform_filter, recursed=0):
def submit_to_try(self, library, recursed=0):
self._vcs_setup()
if not platform_filter:
platform_filter_args = []
elif platform_filter[0] == "!":
platform_filter_args = ["--tasks-regex-exclude", platform_filter[1:]]
else:
platform_filter_args = ["--tasks-regex", platform_filter]

if library.try_preset:
try_arguments = ["./mach", "try", "--update", "--push-to-vcs", "--preset", library.try_preset]
elif library.fuzzy_query or library.fuzzy_paths:
try_arguments = ["./mach", "try", "fuzzy", "--push-to-vcs", "--update"]
if library.fuzzy_query:
try_arguments += ["--query", library.fuzzy_query + " " + (platform_filter or "")]
try_arguments += ["--query", library.fuzzy_query + " "]
else: # If you don't give a --query it goes into interactive mode
try_arguments += ["--query", " " + (platform_filter or "")]
try_arguments += ["--query", " "]
if library.fuzzy_paths:
try_arguments += library.fuzzy_paths
else:
try_arguments = ["./mach", "try", "auto", "--push-to-vcs"] + platform_filter_args
try_arguments = ["./mach", "try", "auto", "--push-to-vcs"]

ret = self.run(try_arguments, clean_return=True)
output = ret.stdout.decode()
Expand Down Expand Up @@ -368,10 +362,6 @@ def get_job_details(self, revision):

return new_job_list

@logEntryExitNoArgs
def combine_job_lists(self, job_list_1, job_list_2):
return job_list_1 + job_list_2

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

Expand All @@ -392,13 +382,6 @@ def get_push_health(self, revision):

return push_health

@logEntryExitNoArgs
def combine_push_healths(self, push_health_1, push_health_2):
combined = merge_dictionaries(push_health_1, push_health_2,
ignored_dicts=PUSH_HEALTH_IGNORED_DICTS,
ignored_keys=PUSH_HEALTH_IGNORED_KEYS)
return combined

# =================================================================
# =================================================================
@logEntryExitNoArgs
Expand Down
3 changes: 0 additions & 3 deletions automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ def run(self, library_filter=""):
else:
self.logger.log("Staying in current directory '%s'" % (os.getcwd()), level=LogLevel.Info)

if 'separate-platforms' not in self.config_dictionary['General']:
self.config_dictionary['General']['separate-platforms'] = False

libraries = self.libraryProvider.get_libraries(self.config_dictionary['General']['gecko-path'])
for lib in libraries:
if library_filter and library_filter not in lib.name:
Expand Down
4 changes: 2 additions & 2 deletions components/bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ def COMMENT_REJECTED(log_url):
return s

@staticmethod
def TRY_RUN_SUBMITTED(revision, another=False):
return "I've submitted a" + ("nother" if another else "") + " try run for this commit: https://treeherder.mozilla.org/jobs?repo=try&revision=" + revision
def TRY_RUN_SUBMITTED(revision):
return "I've submitted a try run for this commit: https://treeherder.mozilla.org/jobs?repo=try&revision=" + revision

@staticmethod
def BUG_SUPERSEDED():
Expand Down
33 changes: 15 additions & 18 deletions components/dbmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,23 @@
from enum import unique, IntEnum


# If not separate-platforms,
# goes straight to
# SECOND_PLATFORMS
# ┌──────────────── CREATED ────────────────────┐ Skips to DONE on error
# │ │ │
# │ ▼ │
# │ AWAITING_INITIAL_PLATFORM_TRY_RESULTS ────|
# │ │ │
# │ ▼ │
# └─► AWAITING_SECOND_PLATFORMS_TRY_RESULTS ────|
# │ │
# │ │
# ▼ │
# AWAITING_RETRIGGER_RESULTS |
# │ │
# ▼ │
# DONE ◄────────────────────┘
# │ │
# ▼ │
# AWAITING_SECOND_PLATFORMS_TRY_RESULTS ───────────|
# │ │
# ▼ │
# AWAITING_RETRIGGER_RESULTS ──────────────────────|
# │ │
# ▼ │
# DONE ◄─────────────────────────────────────────┘
#
# AWAITING_SECOND_PLATFORMS_TRY_RESULTS is named for when try runs were split
# into an initial platform and then the rest; it now means the (only) try run.
# The enum names are also stored in the status_types table, so they're kept.
@unique
class JOBSTATUS(IntEnum):
AWAITING_INITIAL_PLATFORM_TRY_RESULTS = 1
AWAITING_INITIAL_PLATFORM_TRY_RESULTS = 1 # No longer used, but may still be in the database
AWAITING_SECOND_PLATFORMS_TRY_RESULTS = 2
AWAITING_RETRIGGER_RESULTS = 3
DONE = 4
Expand All @@ -49,7 +46,7 @@ class JOBOUTCOME(IntEnum):
COULD_NOT_COMMIT_PATCHES = 11
COULD_NOT_SUBMIT_TO_TRY = 12
COULD_NOT_SUBMIT_TO_PHAB = 13
COULD_NOT_REVENDOR = 14
COULD_NOT_REVENDOR = 14 # No longer used, but may still be in the database
COULD_NOT_SET_PHAB_REVIEWER = 15
COULD_NOT_ABANDON = 16
SPURIOUS_UPDATE = 17
Expand Down
44 changes: 0 additions & 44 deletions components/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import os
import copy
import inspect
import pickle
import functools
Expand Down Expand Up @@ -53,10 +52,6 @@ def __getattr__(self, *args, **kwargs):
raise Exception("No methods on this class should be called")


PUSH_HEALTH_IGNORED_DICTS = ["commitHistory", 'jobCounts', 'status']
PUSH_HEALTH_IGNORED_KEYS = ['next', 'previous', 'revision', 'id', 'result', 'push_timestamp']


def AssertFalse(*args, **kwargs):
assert False, "We should not have called this function."

Expand All @@ -76,45 +71,6 @@ def string_date_to_uniform_string_date(s):
return d.strftime('%Y-%m-%d %H:%M:%S')


def merge_dictionaries(a, b, ignored_dicts=[], ignored_keys=[]):
c = copy.deepcopy(b)

for key, value in a.items():
if isinstance(value, dict):
if key in ignored_dicts:
pass
else:
# get node or create one
node = c.setdefault(key, {})
c[key] = merge_dictionaries(value, node, ignored_dicts, ignored_keys)
elif isinstance(value, list):
if key in c:
assert isinstance(c[key], list)
c[key] += value

# Not everything will sort.
# This feels like the type of extremey subtle behavior that could
# find its way into a security vulnerability.
try:
c[key] = sorted(c[key])
except Exception:
pass
else:
c[key] = value
else:
if key == 'count':
c[key] = a[key] + b[key]
elif key in ignored_keys:
pass
elif key in c and a[key] == b[key]:
pass
else:
assert key not in c, "We already had the key '%s' in the dictionary. Values: '%s', '%s'" % (key, a[key], b[key])
c[key] = value

return c


# MemoizeImpl is a class that can memoize complex arguments using pickle
# It is meant to be used on Class members and excludes the first (self) argument
class MemoizeImpl:
Expand Down
79 changes: 0 additions & 79 deletions docs/existing_job.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ graph TD
classDef c_job_is_completed_without_build_failures fill:#033;

classDef c_process_job_details_for_awaiting_second_platform_results stroke-width:10px,stroke:#000;
classDef c_process_job_details_for_awaiting_initial_platform_results stroke-width:10px,stroke:#000;


A{What is the job's status?}
A --> |Created|HandleCreated
A --> |Done|AssertOpen
A ------> |Awaiting Initial Platform Results|AssertCorrectNumberOfTryRun
A ==> |Awaiting Second Platform Results|AssertCorrectNumberOfTryRun
A -.-> |Awaiting Retrigger Results|AssertCorrectNumberOfTryRun
A --> |AnythingElse|RaiseException --> Done
Expand All @@ -47,86 +45,9 @@ graph TD
CheckFFVersion --> |No|MarkAffected[Mark the job as<br />affecting the current FF<br />version in bugzilla and DB] --> Done

AssertCorrectNumberOfTryRun[Assert we have the<br /> correct number of try runs]
AssertCorrectNumberOfTryRun -->JobsAllDone1
AssertCorrectNumberOfTryRun -.-> JobsAllDone22
AssertCorrectNumberOfTryRun ==>JobsAllDone33


%% ====================================================================================================================
subgraph _process_job_details_for_awaiting_initial_platform_results1[_process_job_details_for_awaiting_initial_platform_results]
subgraph _job_is_completed_without_build_failures1[_job_is_completed_without_build_failures]

JobsAllDone1{Are all the jobs <br />in the try run completed?}
JobsAllDone1 --> |Yes|AnyBuildFailures1
class JobsAllDone1 jobsCompleted;


AnyBuildFailures1{Were there any <br />build failures?}
AnyBuildFailures1 --> |Yes|HandlebuildFailures1
class AnyBuildFailures1 buildFailures;

HandlebuildFailures1[Comment on the bug<br />Abandon the patch<br />Set Job Status to 'Done']
end
class _job_is_completed_without_build_failures1 c_job_is_completed_without_build_failures;

AnyBuildFailures1 --> |No|BugOpen1

BugOpen1{Is the bug Open}
BugOpen1 --> |No|JobsAllDone11
BugOpen1 --> |Yes|ReVendor

ReVendor[Rerun ./mach vendor] --> ReCommit
ReCommit[Re-commit] -->HasPatches

HasPatches{Does the library <br />have local patches?}
HasPatches --> |No|SubmitToTry
HasPatches --> |Yes|Y1[Apply local patches] --> Y2[Commit patches] --> SubmitToTry

SubmitToTry[Submit to try <br />with the second set <br />of platforms]

subgraph _process_job_details_for_awaiting_retrigger_results1[_process_job_details_for_awaiting_retrigger_results]
subgraph _get_comments_on_push1[_get_comments_on_push]
subgraph _job_is_completed_without_build_failures11[_job_is_completed_without_build_failures]
JobsAllDone11{Are all the jobs <br />in the try run completed?}
JobsAllDone11 --> |Yes|AnyBuildFailures11

AnyBuildFailures11{Were there any <br />build failures?}
AnyBuildFailures11 --> |Yes|HandlebuildFailures11

HandlebuildFailures11[Comment on the bug<br />Abandon the patch<br />Set Job Status to 'Done']
end
class _job_is_completed_without_build_failures11 c_job_is_completed_without_build_failures;
end
class _get_comments_on_push1 c_get_comments_on_push;
AnyBuildFailures11 -->|No| WhatTypeOfResults11
subgraph _process_job_results1[_process_job_results]
WhatTypeOfResults11{What results were there?}

WhatTypeOfResults11 --> |Unclassified Failures|_process_unclassified_failures11
subgraph _process_unclassified_failures1
_process_unclassified_failures11[[Comment on bug <br />Set bug assignee and <br />needinfo if the bug is open]] --> X111[Set Job Status To Done]
end
class _process_unclassified_failures1 c_process_unclassified_failures;

WhatTypeOfResults11 --> |Classified Failures|_process_no_unclassified_failures
_process_no_unclassified_failures[Comment on the bug,<br /> set bug assignee if open<br />set phab revieer if open] --> _set_to_done

WhatTypeOfResults11 --> |Succeeded|_process_no_unclassified_failures

_set_to_done[Set job status to 'Done']
end
class _process_job_results1 c_process_job_results;
end
class _process_job_details_for_awaiting_retrigger_results1 c_process_job_details_for_awaiting_retrigger_results;
end
class _process_job_details_for_awaiting_initial_platform_results1 c_process_job_details_for_awaiting_initial_platform_results;
SubmitToTry --> Done
X111 --> Done

JobsAllDone1 --> |No|Wait --> Done
HandlebuildFailures1 --> Done
HandlebuildFailures11 --> Done
_set_to_done --> Done

%% ====================================================================================================================
subgraph _process_job_details_for_awaiting_second_platform_results3[_process_job_details_for_awaiting_second_platform_results]
Expand Down
Loading
Loading