Project

General

Profile

Actions

Bug #26976

open

Rudder webapp migration create table ScoreDetails with message constraint

Added by Nicolas CHARLES 25 days ago. Updated 9 days ago.

Status:
Pending release
Priority:
1 (highest)
Category:
Web - Maintenance
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No

Description

the webapp creates the table with the following code

    val sql2 = sql"""CREATE TABLE IF NOT EXISTS ScoreDetails (
      nodeId  text
    , scoreId text
    , score   score NOT NULL
    , message text NOT NULL CHECK (message <> '')
    , details jsonb NOT NULL
    , PRIMARY KEY (nodeId, scoreId)
    );""" 

the constraint on message breaks the creation of benchmark, and it should not include it. The sql for creation is

Create table scoreDetails (
  nodeId  text NOT NULL
, scoreId text NOT NULL
, score   score NOT NULL
, message text NOT NULL
, details jsonb NOT NULL
, PRIMARY KEY (nodeId, scoreId)
);

Actions #1

Updated by Vincent MEMBRÉ 17 days ago

  • Target version changed from 8.2.7 to 8.2.8
Actions #2

Updated by François ARMAND 17 days ago

  • Assignee set to François ARMAND
  • Priority changed from To review to 1 (highest)

We need to understand why there is constraint in half of the cases, and if the constraint is valid, why benchmarks don't follow it.

Actions #3

Updated by François ARMAND 9 days ago

  • Status changed from New to In progress
Actions #4

Updated by François ARMAND 9 days ago

I think that the constraint is correct and that the problem lays in security benchmark

Actions #5

Updated by François ARMAND 9 days ago

  • Subject changed from Rudder webapp create table ScoreDetails with an invalid constraint to Rudder webapp create table ScoreDetails without message constraint

So, the constraint should be there, and it's an inconsistency. Just add it (without migration, because we are going to remove it in 9.0, and the one coming from a previous version will have the constraint)

Actions #6

Updated by François ARMAND 9 days ago

  • Subject changed from Rudder webapp create table ScoreDetails without message constraint to Rudder webapp migration create table ScoreDetails with message constraint

OK, so with more thinking, and know that we want to remove message column in 9.0, we are going to :

- remove the constraint in the existing migration
- add a migration to remove the constraint in an existing DB.

Actions #7

Updated by François ARMAND 9 days 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/6451
Actions #8

Updated by Anonymous 9 days ago

  • Status changed from Pending technical review to Pending release
Actions

Also available in: Atom PDF