Skip to content

Commit

Permalink
[B] Troubleshooting failing request in dev deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Mason committed Aug 21, 2023
1 parent f00a16e commit a9a2f62
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/dev-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ jobs:
docker build \
-t "gcr.io/${{ secrets.SV_PROJ_NAME }}/rubin-obs-client:${{ github.sha }}" \
--build-arg NEXT_PUBLIC_API_URL=https://api-dev.rubinobs.com/api \
--build-arg EDC_LOGGER_API_URL=https://us-central1-skyviewer.cloudfunctions.net/edc-logger \
--build-arg NEXT_PUBLIC_DEBUG_LOGGING=false \
--build-arg CLOUD_ENV=DEV \
--build-arg NEXT_PUBLIC_BASE_URL=https://dev.rubinobs.com \
--build-arg NEXT_PUBLIC_GOOGLE_APP_ID=688095955960-t0fpaj4ec3gh5vsr9lhg8govapk2oeo9.apps.googleusercontent.com \
--build-arg NEXT_PUBLIC_EFD_URL=https://us-west1-skyviewer.cloudfunctions.net/redis-client/summit-status \
--build-arg NEXT_PUBLIC_RELEASE_URL=`https://noirlab.edu/public/api/v2/releases/{{ID}}/?lang={{SITE}}&translation_mode=fallback` \
--build-arg NEXT_PUBLIC_CONTACT_FORM_POST_URL=https://api-dev.rubinobs.com/actions/contact-form/send \
--build-arg NEXT_PUBLIC_GOOGLE_APP_ID=688095955960-t0fpaj4ec3gh5vsr9lhg8govapk2oeo9.apps.googleusercontent.com \
--build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN= \
--build-arg NEXT_PUBLIC_DEBUG_LOGGING=false \
--build-arg EDC_LOGGER_API_URL=https://us-central1-skyviewer.cloudfunctions.net/edc-logger \
--build-arg CLOUD_ENV=DEV \
--build-arg NEXT_PREVIEW_SLUG=preview-in-craft-cms \
--build-arg NEXT_PUBLIC_EFD_URL=https://us-west1-skyviewer.cloudfunctions.net/redis-client/summit-status \
.
- name: Configure Docker Auth
Expand Down
19 changes: 16 additions & 3 deletions lib/api/efd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,27 @@ const fetcher = (url) =>
method: "GET",
headers: { "Content-Type": "application/json" },
}).then((res) => {
// eslint-disable-next-line no-console
console.log("raw", res);
return res.json();
});

export default function useEfd() {
const url = process.env.NEXT_PUBLIC_EFD_URL;

const { data, error } = useSWR(url, fetcher);
// eslint-disable-next-line no-console
console.log(
"env vars",
process.env.NEXT_PUBLIC_BASE_URL,
process.env.NEXT_PUBLIC_API_URL,
process.env.NEXT_PUBLIC_GOOGLE_APP_ID,
process.env.NEXT_PUBLIC_CONTACT_FORM_POST_URL,
process.env.NEXT_PUBLIC_DEBUG_LOGGING,
process.env.NEXT_PUBLIC_EFD_URL,
process.env.NEXT_PUBLIC_RELEASE_URL
);

const { data, error } = useSWR(process.env.NEXT_PUBLIC_EFD_URL, fetcher);
// eslint-disable-next-line no-console
console.log("response:", { data, isLoading: !error && !data, error });
return {
data,
isLoading: !error && !data,
Expand Down

0 comments on commit a9a2f62

Please sign in to comment.