Loomio
Mon 26 Oct 2015 1:38PM

Help porting Loomio to Sandstorm

ND Nolan Darilek Public Seen by 886

Hello. For the past several days, I've been working on a port of Loomio to the Sandstorm app platform. I think it's going well, and my hope is to have v0.15.0 on the Sandstorm app market sometime this week or next. I'd also like to push the Sandstorm-specific changes upstream for inclusion into Loomio if possible. I built a function that determines whether Loomio is running as a Sandstorm grain, and am selectively disabling/tweaking functionality when that variable is set.

But I'm encountering an odd issue, and I can't seem to find anything in the tech manual. When I delete the initial discussion from new groups, the discussion vanishes but the "plan a trip to the moon" proposal sticks around. When I click on it, I get a "not found" page.

Digging through the code, I see that @discussion.delayed.destroy is called. This leads me to believe that I need to start scripts/delayed_job, but I see nothing about this in the manual. Also, starting it doesn't seem to make the proposal vanish either, so I'm wondering if perhaps it's crashing and not logging its failure on stdout. That's something I'll be investigating next.

But do I in fact need to start scripts/delayed_job, and if so, is there any setup work I need to do first? (I.e. initializing the delayed_job database tables)

I haven't done Rails in quite a while. Can delayed_job periodically run tasks like the automatic closing of proposals? Since the app isn't constantly running, cron isn't an option. Having the tasks run immediately on startup and every 15 minutes or so would be acceptable.

Thanks.

GC

Greg Cassel Fri 22 Jan 2016 6:31AM

Hi @nolandarilek hey do you have any quick updates on this? I know you were poking at it in your spare time. If there's anything even remotely resembling an ETA for Loomio in the Sandstorm App Market, some people would be really excited! :)

S

Sam Tue 2 Feb 2016 10:20AM

Logged in to say I'm excited by this. Thanks for your effort.

ND

Nolan Darilek Tue 2 Feb 2016 3:43PM

Haven't poked at this since my last update, but I'm still stumped by the PATCH issue. In short, Sandstorm's HTTP server for apps supports a mostly complete HTTP subset that just happens to not include support for PATCH, which some of the client-side code relies on. I've filed an issue with Sandstorm but thus far it hasn't been resolved. Maybe chiming in there might help:

https://github.com/sandstorm-io/sandstorm/issues/1218

Not sure what to do in lieu of that. I've made lots of patches to Loomio to make it run within Sandstorm, but changing the API is something I want to avoid. I'd also eventually like to merge the Sandstorm patches upstream, because this work definitely has value but I unfortunately don't have time to be the sole maintainer.

Thanks for your continued interest, I definitely still want to see this happen.

JK

James Kiesel Wed 3 Feb 2016 1:49AM

Thanks for your work on this, @nolandarilek ; really great stuff that's very high value; the exact sort of projects we love to see get started.

It seems to me like removing PATCH support is something which could happen, but is unlikely to land on the core dev roadmap in the immediate future. I wonder if someone like Connor Turland, who's been doing some interoperability work around Loomio, might be interested in this project, which seems to have a tonne of overlap with the Collaborative Technology Alliance stuff we've been discussing recently.

I'm also worried that our recent overhaul of the build system may
a) make a sandstorm port much easier, and / or
b) clash some with the existing work.

Do you have an up-to-date repository for this work? I'd love to have another peek at it sometime, and the link provided above appears to 521 at the moment.

JK

James Kiesel Wed 3 Feb 2016 7:39PM

@nolandarilek I'm going to add PUT support for those client-side PATCH endpoints today.

JK

James Kiesel Wed 3 Feb 2016 8:08PM

I've added PUT endpoints for our current PATCHy actions here: https://github.com/loomio/loomio/pull/2910

Let me know if there's additional work ya need here.

ND

Nolan Darilek Wed 3 Feb 2016 8:22PM

I think I'd rather push Sandstorm to add PATCH, than add more if(isInSandstorm()) { ... } conditionals. Honestly this whole thing is getting a bit overwhelming, and I see all of those conditionals as a place where things might break in the future. :)

I'm working on pushing my current code to Github. The commit history is a bit messy because lots of these changes don't add value on their own, but do when combined with 6-7 others. :) I still need to make a few more tweaks because Sandstorm's own development build processes have changed since I last worked on this. I'll post later today or tomorrow with the updated repo.

JK

James Kiesel Wed 3 Feb 2016 8:57PM

Sounds good to me. I'd love to see the code on github; some of our recent interoperability talks have got me thinking that Sandstorm might be a very strategic piece for Loomio going forward.

I think where this wants to end up eventually is a loomio_sandstorm plugin, the architecture for which is next up on the roadmap (you could check out out the README for creating plugins here: https://github.com/loomio/loomio/tree/plugins-effyeah/plugins)

GC

Greg Cassel Thu 4 Feb 2016 1:33AM

I'm a big fan of the Sandstorm connection and of Loomio being enabled as a plug-in; thanks for sharing the github doc James! Just within the context of current Sandstorm apps such as Etherpad and Wekan, a Loomio plug-in could be a big game-changer.

SP

Steve Phillips / @elimisteve Wed 3 Feb 2016 9:26PM

I'd like to ask the meta-question: what's a good way to ensure that Sandstorm and Loomio don't become subtly incompatible over time as they change? Having both projects use strict SemVer for at least certain APIs?

How stable are the relevant Sandstorm APIs?

I don't understand the connection points between Loomio and Sandstorm, so I don't know what can change/break nor how likely those changes/breakages are, but I'm trying to think of a way that no one has to repeat some version of what @nolandarilek has been doing for every release!

Load More