Code Monkey home page Code Monkey logo

Comments (16)

chmelevskij avatar chmelevskij commented on July 17, 2024 3

@prestonlimlianjie as specified in the issue description, it works just fine with Github, but fails with Gitlab.

from open-api.

prestonlimlianjie avatar prestonlimlianjie commented on July 17, 2024 1

@bcomnes Any updates on this?

from open-api.

prestonlimlianjie avatar prestonlimlianjie commented on July 17, 2024 1

Actually I just gave it a shot @chmelevskij and it works. Here are the steps I took (I'm using GitHub as my provider).

  1. Obtain GitHub repo ID
  2. Create a Netlify deploy key
  3. Add the Netlify deploy key (public key) to the GitHub repo
  4. Call the createSite API

from open-api.

ehmicky avatar ehmicky commented on July 17, 2024 1

Hi @mojavelinux @chmelevskij @prestonlimlianjie @peabnuts123. First of all, sorry for the late response.

The repositories webhooks cannot be enabled from the Netlify API. The best way to enable them is either to:

  • use the Netlify web app
  • use the Netlify CLI (this is done as part of the CLI command npm init)

We understand being able to setup repositories webhooks via the Netlify API would be very useful. Unfortunately we cannot provide this feature at the moment for security reasons. The incoming webhooks are setup by the Netlify web app using the GitHub/GitLab/Bitbucket API under the hood. This requires credentials that are obtained from your browser and would be more problematic to do via the Netlify API while maintaining security compliance.

We understand though that this is suboptimal if you're trying to programmatically create Sites. So I've created a request that you can follow here to allow performing this action via our JavaScript client. Would this work for you?

from open-api.

ehmicky avatar ehmicky commented on July 17, 2024 1

@peabnuts123 we might have a bug there that shows the GitHub connection as setup in the UI even though it is not. However as far as I understand it the GitHub connection is not supposed to be setup when following those steps.

from open-api.

chmelevskij avatar chmelevskij commented on July 17, 2024 1

But it even works with terraform github 😆 Where it doesn't for gitlab.

from open-api.

mojavelinux avatar mojavelinux commented on July 17, 2024

I also find it questionable that all the docs for using createSite with a repo all say "it's a bit complicated to create a repo object, please contact support". Come on. This operation is central to the API and automation. Please document it properly. And it's not that complicated, as my example above reveals. We just need it to actually work.

from open-api.

bcomnes avatar bcomnes commented on July 17, 2024

We have improvements coming to the repos/hooks setup process that have been recently launched that need to be documented. I'll give this a deeper read during the week.

from open-api.

mojavelinux avatar mojavelinux commented on July 17, 2024

That's great to hear, Bret. I'm ready to help test. Just call on me. 🙋‍♂️

from open-api.

bcomnes avatar bcomnes commented on July 17, 2024

@mojavelinux I have not forgotten about this, but I haven't addressed it yet. Sorry for the wait.

from open-api.

mojavelinux avatar mojavelinux commented on July 17, 2024

Thanks for the update, Bret!

from open-api.

chmelevskij avatar chmelevskij commented on July 17, 2024

Is there any updates on this or ways how to help?

from open-api.

peabnuts123 avatar peabnuts123 commented on July 17, 2024

I am seeing this behaviour with GitHub as far as I can tell. I am using Terraform so maybe there's something in there / user-error, but it seems to be as-described. The project sets up and runs a deployment at-first, but then changes to the upstream repository are not picked up by netlify and subsequent deployments are not triggered.

from open-api.

chmelevskij avatar chmelevskij commented on July 17, 2024

I think most of the people end up on this issue following the terraform provider hashicorp/terraform-provider-netlify#14

It's quite interesting that it does work for github but not gitlab.

Wouldn't js client use the createSite operation as well then and have the same issue?

from open-api.

ehmicky avatar ehmicky commented on July 17, 2024

At the moment our CLI is opening a browser window to ask for the OAuth credentials for GitHub. I believe for GitLab and Bitbucket this requires some manual setup though at the moment. That being said, we do want to decrease as much setup as possible for any Git providers in the future, to make it as developer-friendly as possible.

from open-api.

peabnuts123 avatar peabnuts123 commented on July 17, 2024

The reason I come to this issue is mostly that the behaviour seems bugged, rather than unimplemented. Note that I am still using the Terraform provider, so there is still some room for error in that fact.
Upon creating a site, a connection to GitHub is made and added to the site, and a build is triggered (and succeeds), however, no further upstream changes trigger that build. However, visiting the website in a browser looks like the connection is set up and working correctly. If I manually remove the connection and re-add it using the browser, the resultant config looks the same, however, upstream changes are correctly registered subsequently.
I could understand if the Netlify provider in Terraform was not actually able to set up the connection to GitHub, and then I had to log in manually and set that up myself, but seems like the application is created in a strange, bugged state.

from open-api.

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.