jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Sonar
  • SONAR-343

When a rule is removed from the repository, it should be remove from the DB as well

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.4
  • Fix Version/s: 2.3
  • Component/s: Rules
  • Labels:
    None

Description

There are several use cases for that.

1. Delete rules extensions which are removed from definition XML file
The server loads at startup /extensions/rules/checkstyle|pmd/*.xml files which define rules extensions. If a rule is removed from a XML, it should also be removed from the web interface.

2. When removing a plugin that has got a rule repository, the rules should be removed from the database. Otherwise it can have some whereas profiles will still display them in the total count of active rules for the profile

Issue Links

is duplicated by

Bug - A problem which impairs or prevents the functions of the product. SONAR-1124 Issue with importing Findbugs profile

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Improvement - An improvement or enhancement to an existing feature or task. SONAR-459 Coding rules are not deleted from database when they are removed from XML repositories

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Kevin Hooke added a comment - 03/Dec/09 2:00 PM

I think I have a similar issue to this: I added a new rule for a new Checkstyle check to the xml file, but the classname was wrong. It appears you cannot remove the invalid rule and it keeps giving ClassNotFoundExeptions looking for the wrong class (when running the mvn sonar:sonar target).

The modified rule with the correct class name is treated as a new rule, so now I have one rule pointing to a class that doesn't exist, and a different rule that points to the correct class. I don't have exact recreation steps at this point because we're trying to work out how we got to where we are and how to get back to a working config but if I find out more I'll post an update

Show
Kevin Hooke added a comment - 03/Dec/09 2:00 PM I think I have a similar issue to this: I added a new rule for a new Checkstyle check to the xml file, but the classname was wrong. It appears you cannot remove the invalid rule and it keeps giving ClassNotFoundExeptions looking for the wrong class (when running the mvn sonar:sonar target). The modified rule with the correct class name is treated as a new rule, so now I have one rule pointing to a class that doesn't exist, and a different rule that points to the correct class. I don't have exact recreation steps at this point because we're trying to work out how we got to where we are and how to get back to a working config but if I find out more I'll post an update
Hide
Permalink
Freddy Mallet added a comment - 04/Dec/09 4:24 AM

Hi Kevin, to correctly delete a rule from the Sonar repository, here is what must be done :

  • Retrieve the 'id' of this rule in the 'rules' table
  • Execute the following sql command :
    • delete from rules_parameters where rule_id = XXX
    • delete from active_rule_parameters where active_rule_id in (select active_rules.id from active_rules where rule_id = XXX)
    • delete from active_rules where rule_id = XXX
    • delete from rules where id = XXX

Freddy

Show
Freddy Mallet added a comment - 04/Dec/09 4:24 AM Hi Kevin, to correctly delete a rule from the Sonar repository, here is what must be done :
  • Retrieve the 'id' of this rule in the 'rules' table
  • Execute the following sql command :
    • delete from rules_parameters where rule_id = XXX
    • delete from active_rule_parameters where active_rule_id in (select active_rules.id from active_rules where rule_id = XXX)
    • delete from active_rules where rule_id = XXX
    • delete from rules where id = XXX
Freddy
Hide
Permalink
Kevin Hooke added a comment - 04/Dec/09 4:40 PM

Thanks Freddy - that worked great.

Kevin

Show
Kevin Hooke added a comment - 04/Dec/09 4:40 PM Thanks Freddy - that worked great. Kevin

People

  • Assignee:
    Simon Brandhof
    Reporter:
    Simon Brandhof
Vote (3)
Watch (2)

Dates

  • Created:
    13/Aug/08 3:56 AM
    Updated:
    10/Jan/12 3:13 PM
    Resolved:
    26/Aug/10 10:49 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.