denoland / deploy_feedback

For reporting issues with Deno Deploy
https://deno.com/deploy
74 stars 5 forks source link

Deno Deploy stuck building #627

Open JorensM opened 7 months ago

JorensM commented 7 months ago

Version: Whichever verson Deno Deploy is using.

So my Deno Deploy is stuck building. Here is a screenshot:

deno-deploy-stuck

Here is my code:

//@ts-nocheck
// @deno-types="npm:@types/express@4.17.15"
import express, { Request, Response } from "npm:express@4.18.2";

import * as base64 from "https://deno.land/std@0.217.0/encoding/base64.ts";

const app = express();

const EBAY_CLIENT_ID = Deno.env.get('EBAY_CLIENT_ID');
const EBAY_CLIENT_SECRET = Deno.env.get('EBAY_CLIENT_SECRET');
const EBAY_REDIRECT_URI = Deno.env.get('EBAY_REDIRECT_URI');

async function getEbayAccessToken(auth_code: string) {

  const encoded_auth = base64.encodeBase64(`${EBAY_CLIENT_ID}:${EBAY_CLIENT_SECRET}`);//"<client_id>:<client_secret>"

  const res = await fetch('https://api.ebay.com/identity/v1/oauth2/token', {
    method: "POST",
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': 'Basic ' + encoded_auth
    },
    body: JSON.stringify({
      grant_type: 'authorization_code',
      redirect_uri: EBAY_REDIRECT_URI,
      code: auth_code
    })
  })
  const data = await res.json();

  return data;
}

app.get("/", (req, res) => {
  res.send("Welcome to the inventory-manager API!");
});

app.get('/auth/ebay/confirm', async (req: Request, res: Response) => {

  const params = req.query;

  const token = await getEbayAccessToken(params.code);

  res.send('Your ebay account has been authorized' + JSON.stringify(token));
})

app.listen(8000);
JorensM commented 7 months ago

Still stuck after a few additional pushes. As you can see some of the builds did succeed but most got stuck. As a side note I think it would be nice to be able to cancel pending deployments and also redeploy a commit for cases like this one.

deno-deploy-stuck-2