knowledge-repo icon indicating copy to clipboard operation
knowledge-repo copied to clipboard

Publish/edit webposts directly via web server?

Open harrdb12 opened this issue 7 years ago • 6 comments

Auto-reviewers: @NiharikaRay @matthewwardrop @earthmancash @danfrankj

Hi there. I currently have a knowledge repo server running, and am looking to expand its usage, especially among those who aren't using Python (or simply don't want to download the package and learn how to interface via the tooling). Obviously, in order to do this, I am looking to make the web server and as user-friendly as possible.

To that end, I'd like to 1) be able to allow users to publish directly to the web server and 2) allow users to edit their posts. I know there are reasons why these behaviors are not the default, but for myself (and I think for many) it would help with getting more usage among teams, so it would be nice if it were possible to easily enable them.

Regarding 1), the current behavior I've seen is that trying to create a webpost creates a branch for that post, and approving that post simply submits that branch to the knowledge repo repository. The web server itself doesn't publish the post until it has been merged with GitHub, which requires manually merging with git. Does anybody know where in the source code I can modify this default behavior? I would like web posting to be akin to using knowledge_repo add --branch master ... so that when the post is submitted to GitHub the web server will automatically update.

I have seen a pull request regarding this in #162, but having made those changes I still see the default behavior of 'save draft' being creating a new branch, meaning somebody has to manually merge that branch to master.

Regarding 2), it seems that in #192, there was at one point a way to edit webposts after they have been published. However, my knowledge repo version, which I believe is fairly recent (0.7.6), I do not see the files referenced by this pull request, and so no way of doing it on my deployed web server. Was the feature to edit published webposts removed at some point? If so, is there any easy way to reimplement it?

harrdb12 avatar Jan 15 '18 15:01 harrdb12

Hi @harrdb12 ,

Thanks for reaching out about this. We at Airbnb also found it useful to allow users to directly edit posts outside of the context of a Python/Jupyter/R session, and so we added the notion of "web posts". Currently, though, we have only thoroughly tested webposts using a database backend, rather than a git backend. Since the API is (mostly) the same, I suspect posts are mostly created, but not fully integrated into the system. At Airbnb, security policies make two-way integration with our git knowledge repository problematic, and so we haven't had the opportunity to test it out. [Patches welcome].

If you experience the same issue with the database backend, let us know, but we have been using it without issues for about a year now.

matthewwardrop avatar Jan 21 '18 22:01 matthewwardrop

Hi @matthewwardrop,

Thanks for replying. Can you elaborate a little? It's unclear to me what you mean by database backend. I'm currently deploying the server using "--engine flask --dburi sqlite: . . .", so in my mind I'm using a database, but I'm also doing that from within a Git directory. Is this messing things up?

On Jan 21, 2018 5:19 PM, "Matthew Wardrop" [email protected] wrote:

Hi @harrdb12 https://github.com/harrdb12 ,

Thanks for reaching out about this. We at Airbnb also found it useful to allow users to directly edit posts outside of the context of a Python/Jupyter/R session, and so we added the notion of "web posts". Currently, though, we have only thoroughly tested webposts using a database backend, rather than a git backend. Since the API is (mostly) the same, I suspect posts are mostly created, but not fully integrated into the system. At Airbnb, security policies make two-way integration with our git knowledge repository problematic, and so we haven't had the opportunity to test it out. [Patches welcome].

If you experience the same issue with the database backend, let us know, but we have been using it without issues for about a year now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/airbnb/knowledge-repo/issues/373#issuecomment-359286444, or mute the thread https://github.com/notifications/unsubscribe-auth/AZUN_Rj1RcCdRUxKDYAVfFz49J32E4qtks5tM7gCgaJpZM4RemAA .

harrdb12 avatar Jan 22 '18 16:01 harrdb12

Hi @matthewwardrop,

After playing around a bit, I am fairly certain there's no quick way to implement what I want. While it's possible to publish webposts directly via the website via the database backend, this doesn't create an actual knowledge post; it's only saved to the database. Also, it requires the rather inconvenient method of having to name webposts with only certain paths.

I think I will stick to the method I've been using and just use a Cron job to automatically push and merge webposts. You can go ahead and close this issue; possibly mark it as a feature request, esp. for more support of the Git backend, and being able to publish/edit webposts/knowledge posts directly via the web interface.

harrdb12 avatar Jan 23 '18 17:01 harrdb12

@harrdb12 Per the README, you can deploy the server with more than one KnowledgeRepo backend. I think this is what you might be looking for.

alecraso avatar Jan 25 '18 17:01 alecraso

@aaronbiller Yes I have tried that but it doesn't produce the behavior I desired/expected. See my post above.

harrdb12 avatar Jan 26 '18 13:01 harrdb12

Not sure if this is what this is asking, but I'd like to send a jupyter notebook directly from a running JupyterLab to a running Knowledge-repo instance to "publish" it. Looks like I can just markdownify and hit this ?

timkpaine avatar Feb 26 '18 22:02 timkpaine