< 062022-04-07⋎08 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
00:51*Noaht[m] has joined
00:51Noaht[m]The link in "More info on the farmOS 2.x api here" on this page (farmos.org/development/farmos-py/client_) is broken. Can someone send the correct link?
00:52paul121[m]Oops! Should be this: farmos.org/development/api/
00:53paul121[m]Thanks Noaht
01:20Noaht[m]What type of geometry is used for coordinate locations in the logs and how can I convert to that form from geojson?... (full message at libera.ems.host/_matrix/media/r0/downloa)
01:21Noaht[m] * What type of geometry is used for coordinate locations in the logs and how can I convert to that form from geojson?... (full message at libera.ems.host/_matrix/media/r0/downloa)
01:34paul121[m]That is WKT
01:35Noaht[m]Awesome thanks. I found a library for it
01:36paul121[m]Looking in our docs to see if we mention this... We should add if we don't already
01:36paul121[m]Yeah, I think I've used one before
01:36Noaht[m]I've read through the docs and never saw anything. Could have missed it, but if it's not there I'd recommend it cause I spent a couple hours trying to figure it out haha
01:42paul121[m]Sorry about that!! I opened an issue to add that: github.com/farmOS/farmOS/issues/520
01:42paul121[m]any feedback you have is valuable. fresh eyes see things that we will glance over
01:44Noaht[m]Is there any way to convert farmOS 1.x logs to farmOS 2.x logs? I wrote a log generator to generate harvest logs from a bunch of yield data I have, but I wrote it last Fall and it generates logs in the 1.x format.
01:45paul121[m]Ah. well if you only need to update your (python?) script that shouldn't be too hard
01:46paul121[m]Do you need to migrate existing logs from a 1.x server?
01:49*posted a file: (2KiB) < libera.ems.host/_matrix/media/r0/downloa >
01:49*posted a file: (20KiB) < libera.ems.host/_matrix/media/r0/downloa >
01:49Noaht[m]No I can regenerate them from my python script, that's not a problem. But the format seems to be quite different. Maybe I pulled them incorrectly from the API in the new farmOS. These are what I've been comparing between the two versions.
01:50paul121[m]Gotcha. Yes - the format looks quite different because we now use JSON:API
01:51paul121[m]If you didn't see already: farmos.org/development/api/changes/
01:51Noaht[m]Yeah I saw that and read into it a bit, but I'm not super familiar with JSON:API.
01:52paul121[m]The main thing to know is that your log/asset object will all have "attributes" (simple data like name, status, notes), and "relationships" which are relationships to other JSON:API resources
01:53paul121[m]relationships for a log may be the assigned user and assets
01:54paul121[m]this may be the most complete farmOS.py example included in the docs.. farmos.org/development/farmos-py/client_
01:57Noaht[m]I see. Yeah, I read through the new api documentation. I was generating the logs by starting with an empty skeleton harvest_log object and then populating the data manually rather than using the farmOS API.
01:57Noaht[m]Hence the reason I was hoping for a simple way to just convert the ones I have. But I think it'd be better if I just used your farmOS.py module to do it
01:58paul121[m]Oh are you wanting to build the log objects but not send them to a server?
02:00Noaht[m]Well yes and no haha. I did this initially because I wasn't planning on using a farmOS instance I just wanted the objects, but we decided to use the server anyways later on
02:01paul121[m]I suppose one could build a python script to convert the 1.x logs into 2.x but no one has done that that I know of :-)
02:02Noaht[m]Its cool. We have a server up and running now so I can just scrap my original one and use your API instead. Seems straightforward enough to implement
02:03paul121[m]Cool. Something you might actually be interested in is farmOS.js for this
02:04paul121[m]It has a dedicated set of helpers for just creating farmOS entity objects: farmos.org/development/farmos-js/entitie
02:05paul121[m]We've referred to it as the farmOS.js "model" API but I'm not sure I see that language in these docs..
02:05paul121[m]I'm less familiar with that
02:06paul121[m]but in theory you could do the same in Python - it's using the JSON schemas provided by the server to build & validate entity objects
02:07paul121[m]You already have a server up and running, but farmOS.js has the schemata saved here: github.com/farmOS/farmOS.js/tree/main/co
02:08paul121[m]* has the *core schemata saved
02:08Noaht[m]How does that differ from the api? They're both still essentially just sending objects back and forth between the server right?
02:09paul121[m]So this "model" piece of farmOS.js will actually build a log/asset object that looks 95% like JSON:API, before ever interacting with the API!
02:10paul121[m]That is used in farmOS Field Kit when creating data offline
02:10Noaht[m]Ohhh I see. That may be a better option. I'll look into it. Thanks for the info!
02:11paul121[m]Sure thing. Sorry I can't explain that better, and I've got to run, but hope it helps
02:11paul121[m]jgaehring would be the one task if you have more questions on farmOS.js :-)
02:12paul121[m]there is also a community dev call tomorrow at 9AM PT if you want to join & bring any questions!
02:51Noaht[m]I'm trying to setup a local instance of farmOS 2.x with docker. After running the docker-compose file I'm unable to access it. Here is the output for the farmos-www-1 container:... (full message at libera.ems.host/_matrix/media/r0/downloa)
02:51Noaht[m]Any ideas?
07:38*gvlx has joined
09:54*gvlx has quit (Ping timeout: 248 seconds)
11:18*gvlx has joined
12:40*gvlx has quit (Ping timeout: 272 seconds)
15:54mstenta[m]Hi all the weekly farmOS dev call is starting in about 5 minutes - all are welcome :-)
15:54mstenta[m]meet.jit.si/farmos-dev
15:54mstenta[m]Hi Noaht just saw your message - if you want to hop into the dev call I'd be happy to take a look with you.
15:54mstenta[m]paul121 symbioquine if you're around I can show some work I'm doing on the Docker image build process
15:55symbioquine[m]Yeah, I'll be there :)
16:08paul121[m]Omw!
17:18paul121[m]fun call today :-)
17:18mstenta[m]yea!
17:18mstenta[m]symbioquine: i found the existing issue for the gh-pages demo github.com/farmOS/farmOS-map/issues/74
17:18paul121[m]mstenta I think we are computing the centroid each time... here is the patch we sent to drupal/geofield: www.drupal.org/files/issues/2021-04-03/3
17:18paul121[m]maybe we should change that?
17:19paul121[m]to use the lat/long that is stored in the DB?
17:19paul121[m]it was this issue: www.drupal.org/project/geofield/issues/3
17:20mstenta[m]oh huh...
17:20mstenta[m]holy cow i have no memory of this hahaha
17:21mstenta[m]> maybe we should change that?
17:21mstenta[m]> to use the lat/long that is stored in the DB?
17:21mstenta[m]yea perhaps
17:22paul121[m]It does seem that the lat/lon saved in the db are truly the centroid: git.drupalcode.org/project/geofield/-/bl
17:22mstenta[m]right
17:22mstenta[m]yea it would make more sense to use that IMO
17:23paul121[m]that might speed things up a lot
17:23mstenta[m]yea i wonder
17:23mstenta[m]want to open a new issue in that module's queue?
17:24paul121[m]yeah. I'll do that today
17:24mstenta[m]heck i wonder if it will fix github.com/farmOS/farmOS-map/issues/157 !
17:25mstenta[m]don't see how... but the fact that it's calculating that on-the-fly each time makes me curious
17:25mstenta[m]although... you said the geojson IS being cached, correct? so maybe not
17:28paul121[m]mstenta[m]: I need to double check this. I should inspect the response when it is correct, I think that will give us the answer
17:28paul121[m]IIRC correctly the full geometry geojson layers are cached... but maybe cluster is not
17:28mstenta[m]oh yea curious about that... wouldn't it be funny if this was the cause?
17:28mstenta[m]ahh
17:29mstenta[m]the fact that it is inconsistent is still puzzling
17:29paul121[m]BTW it looks like platform.sh has bcmath by default, but adding geos will be a little more work: docs.platform.sh/languages/php/extension
17:33paul121[m]oh!! so the cluster geojson is always returning the "incorrect" value... which might very well be caused by not having geos
17:33paul121[m]thing is, sometimes the map will zoom to the clusters before the other vectors
17:33paul121[m]so the cluster is always in the wrong spot, it's just so far off that sometimes it isn't shown
17:34mstenta[m]ohhh
17:34mstenta[m]consistency! 🎉😄
17:34paul121[m]so tldr; this is prob largely a bug on my hosting config, but maybe there are various improvements we can make at all levels of this haha
17:35mstenta[m]mm yea - well i wonder too about the inaccuracy without geos
17:35mstenta[m]but dunno if we should officially support that
17:36mstenta[m](in v1 i tried to make sure that things would work as well as possible w/ and w/out geos, to support more folks)
17:36symbioquine[m]Does the reports page already warn if GEOS is missing?
17:36mstenta[m]that said... still waiting on a php8 compatible version of php-geos 😬
17:37mstenta[m](or wait... actually there might be a patch available iirc)
17:39paul121[m]I don't see anything about GEOS in admin/status/reports, maybe it should be mentioned
17:40paul121[m]I recently learned about `hook_requirements`, you can use the `runtime` phase to add to the status reports. Useful to see if an external API is up and running! github.com/paul121/farm_loocc/blob/cca8c
17:41mstenta[m]ah yea i thought there was a `hook_requirements` for `php-geos` but maybe not!
17:41paul121[m] * I recently learned about [`hook_requirements`](api.drupal.org/api/drupal/core%21lib%21D), you can use the `runtime` phase to add to the status reports. Useful to see if an external API is up and running! github.com/paul121/farm_loocc/blob/cca8c
17:42mstenta[m]ah! it's in the `geophp` module (which we no longer depend on)
17:42mstenta[m]git.drupalcode.org/project/geophp/-/blob
17:42mstenta[m]we could just replicate that logic in our own `hook_requirements()`
17:42symbioquine[m]ah, that explains it.
17:42symbioquine[m]I could have sworn I saw a warning about that in some testing a while back.
17:43mstenta[m]i could take a quick pass at adding that
17:45symbioquine[m]It seems kinda dangerous to support environments without GEOS if it's going to produce blatantly incorrect results.
17:47paul121[m]<mstenta[m]> "ah! it's in the `geophp` module..." <- huh, why is it that we no longer depend on this?
17:48paul121[m]I see `drupal\geofield` kinda handles it itself, is that why?
17:48mstenta[m]`geofield` used to - it doesn't anymore
17:48mstenta[m]with the move to composer - it became possible to just include `phayes/geophp` directly, rather than wrapping it in a drupal module
17:48mstenta[m]> It seems kinda dangerous to support environments without GEOS if it's going to produce blatantly incorrect results.
17:48mstenta[m]agreed
17:49mstenta[m]in farmos.org/hosting/install/ we currently state in the requirements:
17:49mstenta[m]> PHP BCMath extension and GEOS are recommended for more accurate geometric calculations.
17:49mstenta[m]i wonder if we should make that wording a bit stronger? :-)
17:50mstenta[m]?*highly* recommended"? :-)
17:50mstenta[m] * "_highly_ recommended" :-)
17:50mstenta[m]PR inbound...
17:52symbioquine[m]Or "PHP BCMath extension and GEOS are required for accurate geometric calculations."
17:53symbioquine[m]or "PHP BCMath extension and GEOS are required for accurate geometric calculations. farmOS can be installed without these, but production usage without them is strongly discouraged."
17:53mstenta[m]I like that
18:04symbioquine[m]Do we have an issue for the edit control location problem?
18:05mstenta[m]no i don't think so
18:05symbioquine[m]k
18:06mstenta[m]oh wait we do
18:06mstenta[m]kinda
18:06mstenta[m]github.com/farmOS/farmOS-map/issues/135
18:06mstenta[m]> There is an issue right now where the buttons overlap with the Snapping Grid control button. This is especially apparent when you select a feature with either the Move or Edit buttons, which then causes the Delete button to also appear.
18:06symbioquine[m]ah, yeah
18:06mstenta[m]that's where it was first described, although the proposed solution is intermingled
18:07mstenta[m]feel free to take that one over / rename / whatever
18:07symbioquine[m]Yeah, I think we should keep that open to track a more involved improvement/fix...
18:08symbioquine[m]I'll link them, but I'm not sure that should get closed in favor of this small CSS fix
18:08mstenta[m]ok
18:13symbioquine[m]github.com/farmOS/farmOS-map/pull/160
18:17mstenta[m]github.com/farmOS/farmOS/pull/521
18:18mstenta[m]wham bam!
18:20symbioquine[m]Maybe good to add a link to Paul's issue?
18:21symbioquine[m]or other past issues where folks have run into weird calculation problems?
18:21mstenta[m]just did 👍️
18:21symbioquine[m]:)
18:23symbioquine[m]I think I'm going to hop offline for now... happy Thursday!
18:24mstenta[m]cool see ya symbioquine !
18:24mstenta[m]thanks again for the help!
18:25mstenta[m]maybe we can plan on a farmOS-map release soon, before the next farmOS release
18:26symbioquine[m]Yeah, might need to check whether we've got the release process fully documented... I can't remember whether we're automatically pushing to NPM or not...
18:27symbioquine[m]Oh, I think we are :)
18:28mstenta[m]oh yea maybe something like this would be useful for farmOS-map too? farmos.discourse.group/t/2-x-release-pro
18:29paul121[m]yes we need this delete button fix soon :-)
18:33mstenta[m]paul121: do you remember how to make farmOS-map releases? feel free to if you want!
18:37paul121[m]I think we just push a tag?? github.com/farmOS/farmOS-map/blob/2.x/.g
18:39mstenta[m]i think we also need a commit
18:39mstenta[m]github.com/farmOS/farmOS-map/commit/6d25
18:40mstenta[m](i might add a comment to farmos.discourse.group/t/2-x-release-pro with farmOS-map instructions...)
18:43paul121[m]Cool. I gtg for a bit, but yeah checking the last release commit should explain it then
18:44mstenta[m]I might be able to package one right now...
18:44mstenta[m]I'm documenting the process anyway
18:45mstenta[m]farmos.discourse.group/t/2-x-release-pro
18:46mstenta[m]symbioquine: when you have a chance let me know if i missed anything there
18:56mstenta[m]github.com/farmOS/farmOS-map/releases/ta
18:58mstenta[m]github.com/mstenta/farmOS/commit/9bbd61c
19:01mstenta[m]paul121: I'm curious about updating Gin and Simple OAuth before tagging the next farmOS release
19:02mstenta[m]I'll check out the MR you created for Gin. Do you recall where we left off with Simple OAuth?
19:02mstenta[m]I believe I had tested it out a bit in a branch ahead of PHP 8 stuff... need to refresh. Just flagging it now so you're aware I'm thinking about it. :-)
19:02mstenta[m]Gotta run now too... ttyl
19:48mstenta[m]FYI symbioquine paul121 my github actions PR is ready for review if you want to take a look: github.com/farmOS/farmOS/pull/522
21:12paul121[m]<mstenta[m]> "I'll check out the MR you..." <- Looking at this now. So 5.x has EOL July 31, 2022 (see their project page) - that is our deadline :-)
21:14paul121[m]Here is the change record for 5.2.0: www.drupal.org/node/3255523
21:14paul121[m]* now. So *5., * 5.0.x has
21:21paul121[m]We are already patching the first issue identified in the change record so we can remove that from our composer.json (as well our patch for updating something to be protected in their tests`
21:23paul121[m]The second issue mentioned in that change record might have some implications for the farmOS-aggregator - I know it interacts with the returned OAuth scope, so we may need to make some simple changes there. We may need to support both `scope` and `scopes` in the meantime. www.drupal.org/project/simple_oauth/issu
21:24paul121[m]Other than that, we'll need to do some testing to make sure the first two patches we include for simple_oauth still apply & work as expected. Fortunately, we should have automated tests that cover all of those concerns
21:25paul121[m](we should link to this simple OAuth change record in our changelog whenever we upgrade to this version)
21:26paul121[m]for those reasons I think we should hold off on 5.2.0 for a later release of farmOS
23:35Noaht[m]<mstenta[m]> "Hi Noaht just saw your message -..." <- Hi mstenta . Sorry, I had a meeting at the same time this morning and couldnt make it to the call. Are the dev meetings weekly?
23:53mstenta[m]Noaht: yep! Thursdays at 12 pm noon Eastern time @ meet.jit.si/farmos-dev
23:55mstenta[m]<paul121[m]> "Other than that, we'll need to..." <- paul121: just remembering this branch I started github.com/farmOS/farmOS/compare/2.x...m

< 062022-04-07⋏08 >