ssec-jhu / evolver-ng

Next gen eVolver controller for bioreactor project - wip
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Bug in app update config #69

Closed jamienoss closed 2 months ago

jamienoss commented 3 months ago

The update endpoint expects input as EvolverConfig.

@app.post("/")
async def update_evolver(config: EvolverConfig):
    evolver.update_config(config)

This gets validated, but it must be a full/complete model. The existing model has defaults for all such that a partial config can be passed because the others get populated from defaults.

The bug is that update looks like it should only partially update the config, however, it clobbers the existing, which I don't think it should.

The test in this PR expresses this bug. Really, the test(s) should invoke an evolver with non-default config, and then test that config hasn't changed before and after the partial update, e.g., only changing the hardware list.

A solution is to not require a full model be passed to the update endpoint.

jamienoss commented 3 months ago

@amitschang FYI

jamienoss commented 2 months ago

Resolved by #71