Project

General

Profile

Bug #6840

Editing a rule category remove it from Git - rule categories disapear! (Ranärok ensues)

Added by François ARMAND over 5 years ago. Updated over 5 years ago.

Status:
Released
Priority:
1
Category:
Web - Config management
Target version:
Severity:
User visibility:
Effort required:
Priority:

Description

When we edit a rule category with the little pen that appears on mouse over the category name, then the category XML file on /var/rudder/configuration-repository/ruleCategories is removed.

The corresponding commit message is:

  Move archive of node group category with ID 'aaab98ef-8d7d-4948-9213-13ed93df8ebf'

Of course, it's the first silent move that leads to Ragnärok and a chess mate in one move: from that point, if the user use the archive -> restore [rules] -> from last commit; then the category disapear, and any rule that uses it will have a wonderfull "ERROR" as a category name.

This is bad, developpers !

It was reproduce in 2.10 and 3.0.

Procedure to restaure rule categories deleted during a restore:

$ cd /var/rudder/configuration-repository
# find candidate rule categories (deleted with a "move" message)
$ git log --diff-filter='D*' --grep="Move archive" --format=format:%H ruleCategories > /tmp/possible_categories.txt
# find rule really moved and not deleted due to the bug
$ git log --diff-filter='A' --grep="Move archive" --format=format:%H ruleCategories > /tmp/real_move.txt
# restore rule categories on the fs
$ for i in $(grep -v -f /tmp/real_move.txt /tmp/possible_categories.txt); do git show --no-color $i | patch -p1 -R; done
# add them back in git
$ git add ruleCategories/
$ git commit -m "restore categories from bug" 

And then, go to utilities -> archive, and "restore rules" from "latest git commit" in the dropdown list.


Subtasks

Bug #7027: Fix compilation issue due to function removal in 6840ReleasedFrançois ARMAND2015-07-23Actions
#1

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 2.10.15 to 2.10.16
#2

Updated by François ARMAND over 5 years ago

  • Status changed from New to In progress
  • Assignee set to François ARMAND
#3

Updated by François ARMAND over 5 years ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from François ARMAND to Vincent MEMBRÉ
  • Pull Request set to https://github.com/Normation/rudder/pull/894
#4

Updated by François ARMAND over 5 years ago

The correction also add the same guard against move in the same category that were missing in other move.

#5

Updated by François ARMAND over 5 years ago

  • Subject changed from Editing a rule category remove is from Git (Ranärok ensues) to Editing a rule category remove it from Git - rule categories disapear! (Ranärok ensues)
#6

Updated by François ARMAND over 5 years ago

  • Description updated (diff)
#7

Updated by François ARMAND over 5 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
#9

Updated by François ARMAND over 5 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.10.16, 2.11.13, 3.0.8 and 3.1.1 which were released today.

Also available in: Atom PDF