aquariumbio / pfish

Scripts for pulling/pushing protocols/libraries to/from Aquarium.
2 stars 1 forks source link

Pushing libraries creates library if doesn't exist, but doesn't push code. #59

Open dvnstrcklnd opened 3 years ago

dvnstrcklnd commented 3 years ago
Devins-MBP:protocol-base devin$ pfish push -c 'Standard Libs' -l TestFixtures
INFO:root:Checking whether Definition File is for a Library.
INFO:AqHTTP@http://localhost:REQUEST: (t=0.02618s)  POST http://localhost/json
INFO:AqHTTP@http://localhost:REQUEST: (t=0.007617s)  POST http://localhost/json
INFO:AqHTTP@http://localhost:REQUEST: (t=0.106076s)  POST http://localhost/libraries.json
INFO:AqHTTP@http://localhost:REQUEST: (t=0.012769s)  POST http://localhost/json
Devins-MBP:protocol-base devin$ pfish push -c 'Standard Libs' -l TestFixtures
INFO:root:Checking whether Definition File is for a Library.
INFO:AqHTTP@http://localhost:REQUEST: (t=0.009406s)  POST http://localhost/json
INFO:AqHTTP@http://localhost:REQUEST: (t=0.007726s)  POST http://localhost/json
INFO:root:writing file TestFixtures
INFO:AqHTTP@http://localhost:REQUEST: (t=0.024983s)  POST http://localhost/libraries/code

It works fine if you do push twice, but I feel like it should either fail loudly the first time or just do create then push automatically.

dvnstrcklnd commented 3 years ago

I now get this:

Devins-MBP:protocol-base devin$ pfish push -c 'Standard Libs' -l 'TestFixtures'
Traceback (most recent call last):
  File "/script/pyfish.py", line 326, in <module>
    main()
  File "/script/pyfish.py", line 33, in main
    args.func(args)
  File "/script/pyfish.py", line 249, in do_push
    library.push(
TypeError: push() got an unexpected keyword argument 'force'
cashmonger commented 3 years ago

This should be fixed now if you run pFish update.

dvnstrcklnd commented 3 years ago

The second bug with the TypeError is fixed, but it still requires calling push twice to actually get the code in there. Is there a rationale for this?

cashmonger commented 3 years ago

It is creating the library with the code and pushing the code, but somehow it is not being linked together correctly. I am unclear as to why (the code is in the database, with the correct parent_id, and I can see it in the instance -- but if you pull it, it's blank) but am working on figuring it out.