Mayil-AI / bugbug-21dec23

Mozilla Public License 2.0
0 stars 0 forks source link

Use the value of `regresed_by` in crafting the training classes for the RegressionRange model (hashtag3759) #20

Open vikramsubramanian opened 6 months ago

vikramsubramanian commented 6 months ago

Currently, we use the regressionwindow-wanted keyword and the value of the cf_has_regression_range field to determine whether there is a regression range:

We should also use the value of the regresed_by field. If there is a value in the field, we should consider it as "has regression range".

)

mayil-ai[bot] commented 6 months ago

Possible Solution

class RegressionRangeModel(BugModel):
    # ... [existing code] ...

    def get_labels(self):
        classes = {}

        for bug_data in bugzilla.get_bugs():
            if "regression" not in bug_data["keywords"]:
                continue

            bug_id = int(bug_data["id"])
            # Check if 'regressionwindow-wanted' is in keywords or 'cf_has_regression_range' is 'yes'
            # or 'regresed_by' field is not empty.
            if ("regressionwindow-wanted" in bug_data["keywords"] or
                bug_data.get("cf_has_regression_range") == "yes" or
                bug_data.get("regresed_by")):
                classes[bug_id] = 1
            else:
                classes[bug_id] = 0

        # ... [existing logging code] ...

        return classes, [0, 1]

Code snippets to check

bugbug → models → regressionrange.py This snippet contains the logic for determining whether a bug has a regression range based on keywords and the 'cf_has_regression_range' field, which is directly related to the issue. https://github.com/Mayil-AI/bugbug-21dec23/blob/0acd00da46afbb37bd047c0bce06ce7cfad21568/bugbug/models/regressionrange.py#L22-L102