GithubHelp home page GithubHelp logo

Comments (7)

benbalter avatar benbalter commented on May 29, 2024

I can break these into 3 different issues; the first one is the only one I'm sure needs to be addressed.

That'd be great.

Also, would the GitHub endpoint support us pushing multiple files in a single call, or do we have to make an individual call for each file?

Right now we're using the CRUD API, which is one file per request. We could do a Git-clone, and work with the file system, or use some of the lower-level APIs, I believe. It's a trade off of speed for complexity as we move away from the abstractions.

if two different people are exporting, they can do so at the same time, regardless of whether the post_lock is set.

I'm not sure that's a big risk, but may be missing the use case.

from wordpress-github-sync.

mAAdhaTTah avatar mAAdhaTTah commented on May 29, 2024

Ok, I think trying to make wordpress play with git is more trouble than its worth. I think git would have to be installed on the server. With another plugin where I had to do something similar, I managed everything in js: get a list of ids from the server and go through them one by one.

Another option would be to export like 50 or 100 wen you click the link and defer the rest to WP_Cron. That should keep things spaced out enough so it doesn't error out.

I'm not sure that's a big risk, but may be missing the use case.

I misunderstood its purpose, nevermind.

from wordpress-github-sync.

mAAdhaTTah avatar mAAdhaTTah commented on May 29, 2024

I'm working on the second option (using wp_cron), but I keep getting this error when continuing from the cron:

WordPress <--> GitHub sync error: refs/heads/master expected to be at [sha]

Is that sha we're looking for here tied to the post or the repo itself? If it's the repo, I think I'd cache that as an option rather than post_meta, though I'm still not sure what this error is about.

from wordpress-github-sync.

benbalter avatar benbalter commented on May 29, 2024

I believe that's the blob sha, so post-specific. When you update a post, you need to specify the base sha that you're updating, which I suspect here might be stale (or just flat wrong).

from wordpress-github-sync.

mAAdhaTTah avatar mAAdhaTTah commented on May 29, 2024

It's weird because we're pushing a post for the first time, so I'm not really sure why it even has a sha to begin with... I'll have to keep investigating.

from wordpress-github-sync.

benbalter avatar benbalter commented on May 29, 2024

It's weird because we're pushing a post for the first time, so I'm not really sure why it even has a sha to begin with... I'll have to keep investigating.

Huh. It could be trying to update a post, when it should be creating it. IIRC they are different endpoints.

from wordpress-github-sync.

mAAdhaTTah avatar mAAdhaTTah commented on May 29, 2024

Yeah, that could be it. It looks like the same endpoint, but the create API doesn't require the sha. But that wouldn't explain why it's expecting a sha... And we should be sending a blank sha if none is saved. Maybe it's somehow doing the same ones more than once?

from wordpress-github-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.