WHOIGit / ooicgsn-roundabout

CGSN Roundabout Asset Tracking system
Other
4 stars 4 forks source link

Export Calibrations with Configurations and Constants results in error file #402

Closed joannekoch closed 2 years ago

joannekoch commented 3 years ago

1) Bulk Download Tool->Export Calibrations with Configurations and Constants results in the error file below. Error: MODE: "part has calibs ONLY" is not true. The part has constants defined.

2) Bulk Download Tool->Export Calibrations returns a set of valid calibration data.

3) Bulk Download Tool->Export Configurations & Constants returns a set of valid config & constants data.

In 1), I think the user is expecting to see an export of both Calibrations and Configurations & Constants: the same result as if you ran the two exports 2) and 3) separately.

CalibrationEvents_withConfigs (2).zip

Tested on v1.7.0.

sbatchelder commented 3 years ago

@joannekoch I don't think this is necessarily an error. Export Calibrations with Configurations and Constants is a very specific CI use-case where only certain Configs&Constants ought be bundled with Calibrations. Specifically, only Configs&Constants which have had their "Export with Calibrations" flag set to true. This is probably why you see Part confconst fields (REQUIRED): {} and MODE: "part has calibs ONLY" statement (it's not an error message).

Also that file is more of a logfile for debugging than an error-file. The file is always generated and shows successful exports as well as the "failed" ones. I think the last time this came up was for #312

What is the "Export with Calibrations" status of Constant you were expecting to see?

image

joannekoch commented 3 years ago

@sbatchelder - Thanks for the explanation!

So if "Export Calibrations with Configurations and Constants" is a very specific CI use-case, should the export be named, "Export Calibrations with Configurations and Constants (CI)" to give the user a clue that this is a very special export function?

To answer your question, you are correct, my Export with Calibrations flag above was set to false. I set them all to true for 3601-00050-00001-20001, 1232-20001, and 3604-00131-00001-20004. I get the result below.

Like issue #401 there are no calibration or constant values in the result. Is this correct?

No csv files are exported. Is this correct?

Inv: 3601-00050-00001-20002 (id=7) resides in the trash. Should this be included?


Inv calibs: <QuerySet [<CalibrationEvent: 05/20/2021>]>
Inv confconst {5: <QuerySet [<ConfigEvent: 05/24/2021>]>}
Part: SOUTHERN OCEAN SURFACE BUOY ASSEMBLY (id=1)
Part calib fields     (REQUIRED): {'cal1'}
Part confconst fields (REQUIRED): {'cc1', 'cc2'}
MODE: "part has confconsts"
  Deployment: "1 - Coastal Pioneer" (id=5, to-field=2021-05-17)
    conf/consts approved:  FAIL. Approvals={<ConfigEvent: 05/24/2021>: False}
    conf/const validation: FAIL. Present={'cc1'} Missing={'cc2'}
    calib selected: <CalibrationEvent: 05/20/2021>
    calib approved:   FAIL
    calib validation: PASS

Inv: 3601-00050-00001-20002 (id=7)
Inv calibs: <QuerySet [<CalibrationEvent: 05/20/2021>]>
Inv confconst {None: <QuerySet [<ConfigEvent: 05/20/2021>]>}
FAIL: 3601-00050-00001-20002 does not have an associated assembly_part!

Inv: 1232-20001 (id=8)
Inv calibs: <QuerySet [<CalibrationEvent: 05/20/2021>]>
Inv confconst {7: <QuerySet [<ConfigEvent: 05/20/2021>, <ConfigEvent: 05/20/2021>]>}
Part: Sewing Template (id=6)
Part calib fields     (REQUIRED): {'scalib2', 'scalib1'}
Part confconst fields (REQUIRED): {'scnst12', 'scnst1', 'sconf12', 'sconf1'}
MODE: "part has confconsts"
  Deployment: "7 - Test" (id=7, to-field=2021-05-18)
    conf/consts approved:  FAIL. Approvals={<ConfigEvent: 05/20/2021>: False, <ConfigEvent: 05/20/2021>: False}
    conf/const validation: PASS
    calib selected: <CalibrationEvent: 05/20/2021>
    calib approved:   FAIL
    calib validation: PASS

Inv: 3604-00131-00001-20004 (id=10)
Inv calibs: <QuerySet [<CalibrationEvent: 05/10/2016>]>
Inv confconst {5: <QuerySet [<ConfigEvent: 05/17/2021>, <ConfigEvent: 05/17/2021>]>}
Part: Pin Template (id=8)
Part calib fields     (REQUIRED): {'scalib2', 'scalib1'}
Part confconst fields (REQUIRED): {'scnst1', 'scnst12', 'sconf12', 'sconf1'}
MODE: "part has confconsts"
  Deployment: "1 - Coastal Pioneer" (id=5, to-field=2021-05-17)
    conf/consts approved:  FAIL. Approvals={<ConfigEvent: 05/17/2021>: False, <ConfigEvent: 05/17/2021>: False}
    conf/const validation: PASS
    calib selected: <CalibrationEvent: 05/10/2016>
    calib approved:   FAIL
    calib validation: PASS

Inv: 456-654-321 (id=11)
Inv calibs: None
Inv confconst {1: <QuerySet [<ConfigEvent: 05/17/2021>]>}
FAIL: 456-654-321 does not have an associated assembly_part!
sbatchelder commented 3 years ago

@joannekoch Looking at this debug file it looks like each paragraph has at least one "FAIL" status. For a csv to be created they must all PASS. We don't see any csv's because all of these have failed in one way or another.

The most common failure mode i'm seeing is that CCC's are not passing their Approval checks. To be approved they must be reviewed/approved by at least two users (not necessarily every user on the reviewer list, but a minimum of two. Even if there's only one name on the reviewer list and that one user approves it, the item is still not approved. This is a CI requirement I think. @cahearn can you weigh in on that? it's counter-intuitive to non-ci users).

The other failure mode i'm seeing is conf/const validation: FAIL. Present={'cc1'} Missing={'cc2'} which means that cc2 from the part was expected and found missing on the inventory item.

Finally the trashed inventory item should probably not be included and I can make that change, along with a label change to add "CI" to the button.

joannekoch commented 3 years ago

@sbatchelder Thanks so much for the info above! I will be putting this detail into the RDB User Guide.

Thanks for doing this: Finally the trashed inventory item should probably not be included and I can make that change, along with a label change to add "CI" to the button. I won't be able to fully test this and get csv files until the trash failure goes away.

I still can't get rid of these errors (and I can't figure out what it's looking for):

Inv: 3601-00050-00001-20001 (id=1)
Inv calibs: <QuerySet [<CalibrationEvent: 05/25/2021>]>
Inv confconst {5: <QuerySet [<ConfigEvent: 05/24/2021>, <ConfigEvent: 05/24/2021>]>}
Part: SOUTHERN OCEAN SURFACE BUOY ASSEMBLY (id=1)
Part calib fields     (REQUIRED): {'cal1'}
Part confconst fields (REQUIRED): {'cc1', 'cc2'}
MODE: "part has confconsts"
  Deployment: "1 - Coastal Pioneer" (id=5, to-field=2021-05-17)
    conf/consts approved:  FAIL. Approvals={<ConfigEvent: 05/24/2021>: False, <ConfigEvent: 05/24/2021>: False}
    conf/const validation: PASS
    calib selected: FAIL - None available

Here's my setup for calib: cal1 and I don't know why it's failing: calib selected: FAIL - None available Capture

conf/consts approved: FAIL. Approvals={<ConfigEvent: 05/24/2021>: False, <ConfigEvent: 05/24/2021>: False} There's two issues here: 1) I don't know why it's looking at an event dated yesterday. 2) There's a bug approving 2 users with constants & configs only. When I login as "tech" and approve, and then login as "admin" and approve, the tech approval goes away. Have you seen this? Is this a bug for mario?

Capture

sbatchelder commented 3 years ago

re: calib selected: FAIL - None available, when MODE= "part has confconsts", for each Config event, the Calibration event immediately preceding the Config is selected. In the above example the Calibration is dated as after the Config Event, which is why it's not being selected and it fails.

re: conf/consts approved: FAIL. Approvals={<ConfigEvent: 05/24/2021>: False, <ConfigEvent: 05/24/2021>: False} 1) well, it's going to look at all events not just the ones from today. Are the ConfigEvent's event date really set to 05/24/2021 ? If so then that's expected behavior. @sbatchelder, Yes, see screen shot above. I set the CalibrationEvent date to 5/24 and it passed! :) 2) yeah that seems like a bug and we should pull @MarioCarloni into it.

Hey @MarioCarloni, might this have something to do with the new event model's approval approval system? And @joannekoch , does this multi-user approval issue happen just with ConfigEvents or also with CalibrationEvents? @sbatchelder, the multi-user approval issue happens when trying to approve Constants & Configs, but not CalibrationEvents.

@sbatchelder, Thanks for all you help on this!

joannekoch commented 3 years ago

@sbatchelder, @cahearn , Bulk Export Calibrations and Export Configurations & Constants (non-CI) currently export CCC items that are in the Trash. Would the User want to include Trashed items in the export?

joannekoch commented 3 years ago

Adequate testing of this issue requires issue #403 be fixed first.

joannekoch commented 3 years ago

Now that #403 has been fixed, Exporting Calibrations with Configs and Constants works like a charm.