Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for user to add technical debt to individual violations #3332

Closed
Sebastiaan127001 opened this issue Jan 27, 2022 · 1 comment · Fixed by #3397
Closed

Allow for user to add technical debt to individual violations #3332

Sebastiaan127001 opened this issue Jan 27, 2022 · 1 comment · Fixed by #3397
Assignees
Labels
Feature New, enhanced, or removed feature

Comments

@Sebastiaan127001
Copy link
Contributor

For instance, when there are unmerged branches and the team promised to fix it in two weeks, it would be useful to add technical debt to a specific branch. This can only be done for metrics with violations that can be isolated and identified.

image

@Sebastiaan127001 Sebastiaan127001 added the Feature New, enhanced, or removed feature label Jan 27, 2022
@fniessink
Copy link
Member

fniessink commented Feb 2, 2022

Rename the status "Resolve as fixed" to "Resolve as will be fixed" and change the description from "This [entity] has been fixed and will disappear shortly" to "This will be fixed and should disappear shortly."

Add an end date attribute to the entity that can be entered regardless of what the entity status is. Label: "[Entity] status end date". Help popup: "Consider the status of this entity to be "Unconfirmed" after the selected date."

The measurement entities get an extra attribute "status_end_date", e.g.:

{
  "entity_user_data": {
      "AXellfukmoRlpKCRHShW": {
          "status": "fixed",
          "status_end_date": "2022-02-28T00:00"
      }
  }
}

To update the status and measurement value of the metric we use the same mechanism as used for technical debt end date. Change this function in components/server/src/shared/model/source.py:

    def _entities_to_ignore(self) -> Sequence[dict[str, str]]:
        """Return the entities to ignore."""
        statuses_to_ignore = ("fixed", "false_positive", "wont_fix")
        user_data = self.get("entity_user_data", {})
        entities = self.get("entities", [])
        return [entity for entity in entities if user_data.get(entity["key"], {}).get("status") in statuses_to_ignore]

to also look at the status_end_date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New, enhanced, or removed feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants