-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable Gatsby functions in preview deploys #4919
Conversation
Gatsby Cloud Build Reportethereum-org-website-dev 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 6m PerformanceLighthouse report
|
85d5705
to
3237e62
Compare
|
69b4269
to
3237e62
Compare
@pettinarip the URL you've provided to test is re-directing to Gatsby cloud dashboard On the deploy preview, the StatsBox is working 🎉🎉 The Roadmap isn't for me :( (returns a 500) |
Homepage stats are working on Translations endpoint is failing (500) for me on: Roadmap endpoint is failing (500) for me on: |
src/api/etherscan.js
Outdated
@@ -0,0 +1,8 @@ | |||
import { handler as lambda } from "../lambda/etherscan" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to see we can re-use the code 😄
@samajammin It may be the cache functionality... it doesn't refetch every time you reload... Also... {"msg":"Request failed with status code 404"} And on the {"msg": "Request failed with status code 401"} |
Hey sorry about that @samajammin and @wackerow. I forgot to add some env vars in my netlify account. Now everything should be working.
@samajammin you might need to test what Paul said. I see them in my browser 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks close!
Everything I tested on https://pettinarip-eth-org.netlify.app/ appears to be working 👍
The roadmap endpoint on https://ethereumorgwebsitedev01-pettinaripethereumorgwebsitefu.gtsb.io/en/about isn't working for me:
Any idea why the 500 error? This response from the endpoint is:
{"msg":"Request failed with status code 401"}
@pettinarip the translations endpoint on https://ethereumorgwebsitedev01-pettinaripethereumorgwebsitefu.gtsb.io/en/contributing/translation-program/ is also still failing for me: The response from the endpoint is:
|
@samajammin yes, probably this is a bit tricky to test because we are using just 1 Gatsby Cloud site to test 2 different envs. So, right now the GC site ( If you want to test the preview deploys (GC context), you need to update the This idea requires 2 GC sites.
We won't have a GC site that works with both hosting envs. Let me know if this doesn't make sense to you and we can discuss it on a call. |
Makes sense, so can't we set up this PR preview deploy to be the GC preview test (ethereum-org-website-dev)? I suppose that was my assumption:
|
3237e62
to
5b72e28
Compare
IIRC, some ENV variables are not working in Gatsby Cloud. This isn't a bug on our end - we're still waiting on Gatsby Cloud support for resolution here, correct @pettinarip? If so, could you please update this PR to a draft? |
Marking as blocked - still waiting on a response from Gatsby Cloud. |
6dea794
to
6543f9b
Compare
PR unblocked. Functions working in both envs now. |
@pettinarip all functions are giving me a 500 on https://pettinarip-eth-org.netlify.app/en/ - they're working for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working now!
Description
Currently we have the Netlify functions working in the Netlify context/server. On the other hand, in our preview deploys context (Gatsby Cloud) they are not working. We need to integrate them. This PR addresses this issue.
api
folder to enable functions in gatsby cloud.GATSBY_FUNCTIONS_PATH
to determine the path of the functions in each environment./.netlify/functions
/api
HOW TO TEST IT:
pettinarip-ethereum-org-website-dev
GATSBY_FUNCTIONS_PATH
env var to/api
=> wait the build to finish => test the preview deployGATSBY_FUNCTIONS_PATH
env var to/.netlify/functions
=> wait the build to finish => test the netlify deploy (netlify url https://pettinarip-eth-org.netlify.app)PROD IMPLEMENTATION:
GATSBY_FUNCTIONS_PATH=/.netlify/functions
GATSBY_FUNCTIONS_PATH=/api