Many people claim to have solved this problem in the following examples
https://github.com/nodegit/nodegit/issues/463
Nodegit: How to modify a file and push the changes?
However after testing these solutions out I'm given an error that claims the remote.setCallbacks(...) function is undefined. A quick check at the Nodegit API documentation
http://www.nodegit.org/api/remote/#push
confirms that the remote.setCallbacks(...) function is indeed undefined. I tried this example code found on the Nodegit page
https://github.com/nodegit/nodegit/blob/master/examples/push.js
But this code freezes at the remote.push(...) command. How have people managed to actually push code to a remote repository using Nodegit? Any help on the issue I've found thus far has been a disappointment!
Unfortunately I was shooting myself in the foot all day. The reason the example code found at
https://github.com/nodegit/nodegit/blob/master/examples/push.js
wasn't working was because the remote github repository wasn't created before running the code. I'm guessing execution froze at the remote.push(...) command because the push prompt would make a request for the repository and not get a valid response, at which point it would make another request but still not get a valid response. Over and over again this would continue. The nodegit promise chain needs to establish a connection with the remote repository before it can finish. Unfortunately the Nodegit API documentation lacks explanation for many offered functions. Oh well, the important thing is a solution was reached!
Related
I'm building an interaction with some smartcontracts via Javascript and following Uniswap Documentation as well as EtherJs, here is my code:
Gist Github
Via console it shows as the transaction was successful,
Console Logs
But the transaction gets reverted without a clear error message,
Transaction hash
Is there any way to track or find where my code is wrong?, I triple checked paths and all the stuff, as I'm still learning about smartcontracts interaction maybe there's something I'm missing out.
Thanks in advance,
Triple checked:
Smartcontracts addresses
Methods syntaxis (following Uniswap Documentations)
Contract ABIs
since the owner just closed my issue on GitHub and the people on the official discord server couldn't help me, I'm trying my luck here.
Since NestJS doesn't have interceptors or anything else for fastify (for file uploads), I wanted to use the fastify-multipart (now #fastify/multipart) package. I registered the middleware the normal way, but I'm using the attachFieldsToBody option, so I can properly use the validation pipeline which I've set to global. I have a very simple setup with a DTO for my post request. If you let the sandbox container run, you'll see the 500 error saying maximum call stack exceeded which happened in the validation pipeline.
GitHub Issue: https://github.com/nestjs/nest/issues/9683
Sandbox: https://codesandbox.io/s/nestjs-fastify-multipart-bug-17m5ls
The multipart middleware works fine (even though someone on Discord thought that was an issue, assuming that I didn't google for it). The only issue is the validation pipeline, but I can't track this down, I'm unsure why it causes an infinite loop. While I'm debugging and looking through the common package source code, if anyone ran into this issue or has an idea for a solution, please let me know.
Is it possible to somehow get information about whole repository using one request to github api or we have to recursively asking API for specific level?
According to this request: https://api.github.com/repos/microsoft/terminal/contents?ref=master
we are only getting one level.
You can get the tree recursively using :
/repos/:owner/:repo/git/trees/:tree_sha?recursive=1
In your case it would be :
https://api.github.com/repos/microsoft/terminal/git/trees/master?recursive=true
You can make a request to here to see details about your branch:
https://api.github.com/repos/{owner}/{repo}/branches/{default_branch}
In the response you will see "commit" field and inside of it there is "sha". Take that one put it in this request:
https://api.github.com/repos/{owner}/{repo}/git/trees/YOUR_SHA_GOES_HERE?recursive=1
You will receive every file under your repo like this.
Cheers!
I've been experimenting for a while with Firebase Cloud Functions, today I made a minor change to my index.json file (added a field to a document to be set), after deploying on the Firebase Console > Functions > Logs I've got this weird errors:
Auth error:Error: Could not refresh access token.
and:
Error: 16 UNAUTHENTICATED: Getting metadata from plugin failed with error: Could not refresh access token.
at new createStatusError (/user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:65:15)
at /user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:568:15
Here's a list of things I tried but did not work:
revert the change in index.json
deploy every function (made the problem worse, now none of my cloud functions is working)
generate a new keyFilename for #google-cloud/storage
npm update firebase-admin
(rebooting)
The last time I did a firebase deploy successfully was last night.
I'm on linux.
Thank you.
Thanks everyone for the reports, both here and especially also via our tech support channels - these really help.
We believe the issue to have been caused by a problem deep in our Node.js dependency chain, in particular for users of Firestore. We've just released https://www.npmjs.com/package/google-gax 0.14.5 to address the issue. Please:
Either wait for the npm caches to pick up the new version, or explicitly request google-gax 0.14.5 in your package.json.
Re-deploy your functions.
That should resolve things. If you're still having trouble, please let us know!
Our current suspicion is that a very nested dependency had a breaking change that didn't follow semver. We're investigating and hope to have a fix soon. When this fix rolls out, you'll only have to redeploy.
I am working on code for a webserver.
I am trying to use webhooks to do the following tasks, after each push to the repository:
update the code on the webserver.
restart the server to make my changes take effect.
I know how to make the revision control run the webhook.
Regardless of the specifics of which revision control etc. I am using, I would like to know what is the standard way to create a listener to the POST call from the webhook in LINUX.
I am not completely clueless - I know how to make a HTTP server in python and I can make it run the appropriate bash commands, but that seems so cumbersome. Is there a more straightforward way?
Setup a script to receive the POST request ( a PHP script would be enough )
Save the request into database and mark the request as "not yet finished"
Run a crontab and check the database for "not yet finished" tasks, and do whatever you want with the information you saved into database.
This is definately not the best solution but it works.
You could use IronWorker, http://www.iron.io, to ssh in and perform your tasks on every commit. And to kick off the IronWorker task you can use it's webhook support. Here's a blog post that shows you how to use IronWorker's webhooks functionality and the post already has half of what you want (it starts a task based on a github commit): http://blog.iron.io/2012/04/one-webhook-to-rule-them-all-one-url.html