Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045855Openbravo ERPA. Platformpublic2021-02-04 15:012021-07-21 16:27
shuehner 
shuehner 
normalminorhave not tried
closedfixed 
5
 
PR21Q2 
Core
No
0045855: ant package.module duplicates check run during export.database + depends on code planned to be removed
ant package.module tasks by default also runs validations for the module to be packaged (SystemValidationTask with type="module")

Part of this is running the checks implemented in DatabaseValidator.

The code in SystemValidationTask is using obsolete code inside dbsourcemanager planned to be removed (loadModelFromDatabase with prefix parameter used in past by update.database.mod)

The same checks from DatabaseValidator are also already running during export.database (by default, can be optionally disabled).

So running those checks again in package.module is conceptually duplicated.

There is one small behavior difference:
- from ExportDatabase 5 checks are classified as WARNing and do not stop the task
- from ant package.module those 5 checks are classified as ERROR and do stop the task

The 5 checks are same 'topic' for different areas:
- Table XX does have element YY which does not start with the database prefix of
the module.
- With is them implemented for: Primary Key, Foreign Key, Check Constraint, Unique Constraint, Index

So removing this duplicate checks changes behavior by allowing:
- Ignore WARN during update.database (intentionally or accidentally)
- And let default run of package.module continue instead of blocking it by default

Raising the WARN to ERROR inside ExportDatabase would stop task immediately when processing the module. As export.database is often called with multiple modules in development that is probably a bit harmful (i.e. in CI) by only showing first error (instead of all of them)

Note:
For Openbravo managed modules that should not have practical effect as our CI systems raises those WARNings which are expected to be fixed anyway.

Check DatabaseValidator being used in both ExportDatabase.java (dbsm repo) and SystemValidationTask (type=module) which is called via 'ant package.module task definition).
Behavior different above is via calling (or not) setDbsmExecution.
- Remove calling DatabaseValidator from SystemValidationTask (type module)
- Accept the behavior change that developers are expected to notice the WARNings anyway

Alternative solution to stop using the obsolete dbsourcemanager code-path (while keeping behavior):
- Replace deprecated loadModel (with prefix filter)
- By loading full model + filtering it afterwards (same as ExportDatabase already does)
- Check if PL-Standardization (which would run for the full model) can be switched of (if not needed by the validator) or pay the performance cost and make package.module slower
  - Probably not a good idea with mass-publishing modules during release cycle by development teams (calling package.module in a loop would multiply that time penalty)
No tags attached.
related to defect 0047414 closed alostale ant package.module -Dmodule not working in Oracle 
Issue History
2021-02-04 15:01shuehnerNew Issue
2021-02-04 15:01shuehnerAssigned To => platform
2021-02-04 15:01shuehnerModules => Core
2021-02-04 15:01shuehnerTriggers an Emergency Pack => No
2021-02-04 15:05shuehnerProposed Solution updated
2021-02-04 17:45hgbotNote Added: 0125989
2021-02-05 07:29hgbotNote Added: 0126000
2021-02-05 07:29hgbotResolutionopen => fixed
2021-02-05 07:29hgbotStatusnew => closed
2021-02-05 07:29hgbotFixed in Version => PR21Q2
2021-02-05 07:29hgbotNote Added: 0126005
2021-02-05 07:48alostaleAssigned Toplatform => shuehner
2021-07-21 09:12alostaleRelationship addedrelated to 0047414
2021-07-21 16:27hgbotNote Added: 0130671
2021-07-21 16:27hgbotNote Added: 0130673

Notes
(0125989)
hgbot   
2021-02-04 17:45   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/305 [^]
(0126000)
hgbot   
2021-02-05 07:29   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/305 [^]
(0126005)
hgbot   
2021-02-05 07:29   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 0526cf6fb41254b0cf3743c14d1c69bbf4e11030
Author: Stefan Huehner <stefan.huehner@openbravo.com>
Date: 2021-02-04T17:40:00+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/0526cf6fb41254b0cf3743c14d1c69bbf4e11030 [^]

Fixes ISSUE-45855. Remove calling DatabaseValidor from package.module

ant package.module runs validations for the module before creating the
obx file.
That has 2 parts:
a.) ModuleValidator
b.) DatabaseValidator

The DatabaseValidator checks are also run during export.database (for
the module being exported). So with the typical sequence of
export.database and then package.module same topics are checks twice.

As the code in this task for DatabaseValidator or blocking removal of
lots of otherwise obsolete code inside dbsourcemanager stop calling the
b.) from ant package.module and rely on people using the WARNings
already shown during export.database.

---
M src/org/openbravo/service/system/SystemValidationTask.java
---
(0130671)
hgbot   
2021-07-21 16:27   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: abeb37c0aa31c1f825839304bbd21a8bd40f4963
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-07-21T12:48:22+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/abeb37c0aa31c1f825839304bbd21a8bd40f4963 [^]

fixes BUG-47422, backports BUG-45855: can't package module in ORA

Packaging modules in Oracle failed during the model validation step,
this step was removed by BUG-45855. This commit backports that change.

---
M src/org/openbravo/service/system/SystemValidationTask.java
---
(0130673)
hgbot   
2021-07-21 16:27   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: abeb37c0aa31c1f825839304bbd21a8bd40f4963
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-07-21T12:48:22+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/abeb37c0aa31c1f825839304bbd21a8bd40f4963 [^]

fixes BUG-47422, backports BUG-45855: can't package module in ORA

Packaging modules in Oracle failed during the model validation step,
this step was removed by BUG-45855. This commit backports that change.

---
M src/org/openbravo/service/system/SystemValidationTask.java
---