Comments (16)
@prestonlimlianjie as specified in the issue description, it works just fine with Github, but fails with Gitlab.
from open-api.
@bcomnes Any updates on this?
from open-api.
Actually I just gave it a shot @chmelevskij and it works. Here are the steps I took (I'm using GitHub as my provider).
- Obtain GitHub repo ID
- Create a Netlify deploy key
- Add the Netlify deploy key (public key) to the GitHub repo
- Call the createSite API
from open-api.
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.
@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.
But it even works with terraform github 😆 Where it doesn't for gitlab.
from open-api.
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.
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.
That's great to hear, Bret. I'm ready to help test. Just call on me. 🙋♂️
from open-api.
@mojavelinux I have not forgotten about this, but I haven't addressed it yet. Sorry for the wait.
from open-api.
Thanks for the update, Bret!
from open-api.
Is there any updates on this or ways how to help?
from open-api.
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.
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.
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.
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)
- [security] Enforce Branch Protections
- `draft` property not being returned in `listSiteDeploys`
- Optimization
- Review docs for createSite endpoint - repo id type HOT 1
- Wrong response schema for createSite when there is an error HOT 1
- Add API endpoint to search for a specific deploy preview
- Sort operations alphabetically HOT 1
- Add operation/docs for changing an existing team member's role
- Document clear_cache in createSiteBuild HOT 2
- Document `clear_cache` query param on the createSiteBuild call HOT 1
- Remove gobin in makefile in favor of plain go HOT 1
- CloudQuery Source Plugin?
- Implement GA4 tag
- Don't retry file uploads with `422` responses HOT 2
- [ documentation ] For sites list
- d9021685bd8cc850f5eb17a13f3c7c746d4fe93d
- info:
- Fix Incorrect Return Response for go version 1.21.1 HOT 5
- authentication signup bug HOT 1
- Fix Incorrect DNS Zone API Specifications HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-api.