Skip to content
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

Never finds preview URL #20

Closed
kylemh opened this issue Jun 7, 2021 · 5 comments
Closed

Never finds preview URL #20

kylemh opened this issue Jun 7, 2021 · 5 comments
Assignees

Comments

@kylemh
Copy link
Contributor

kylemh commented Jun 7, 2021

Despite the preview URL being available, the workflow never seems to hear a 200 response from the request.

Previews

Screen Shot 2021-06-07 at 11 38 46 AM

My workflow

name: CI

on: [pull_request]

jobs:
  Cypress:
    runs-on: ubuntu-latest
    strategy:
      # DO NOT cancel other containers on fail, because Cypress processes die leaving the Dashboard hanging ...
      # https://github.com/cypress-io/github-action/issues/48
      fail-fast: false
      matrix:
        containers: [1, 2, 3, 4]
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Read .nvmrc
        run: echo ::set-output name=NVMRC::$(cat .nvmrc)
        id: nvm

      - name: Use Node with version in .nvmrc
        uses: actions/setup-node@v2
        with:
          always-auth: true
          registry-url: https://registry.npmjs.org
          node-version: '${{ steps.nvm.outputs.NVMRC }}'

      - name: Install dependencies
        run: yarn --non-interactive --frozen-lockfile --silent
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

      - name: Wait for Preview Deployment
        uses: patrickedqvist/wait-for-vercel-preview@master
        id: waitForPreview
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          max_timeout: 360
          environment: Preview - website

      - run: echo ${{ steps.waitForPreview.outputs.url }}

      - name: Run Cypress
        uses: cypress-io/github-action@v2
        with:
          install: false
          command: 'yarn test:cy:record --config baseUrl=${{ steps.waitForPreview.outputs.url }}'
          parallel: true

Most recent response

Deployment unavailable or not successful, retrying...
RequestError [HttpError]: Not Found
    at /home/runner/work/_actions/patrickedqvist/wait-for-vercel-preview/master/node_modules/@octokit/request/dist-node/index.js:66:23
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async waitForStatus (/home/runner/work/_actions/patrickedqvist/wait-for-vercel-preview/master/index.js:26:30)
    at async run (/home/runner/work/_actions/patrickedqvist/wait-for-vercel-preview/master/index.js:110:24) {
  name: 'HttpError',
  status: 404,
  headers: {
    'access-control-allow-origin': '*',
    'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
    connection: 'close',
    'content-encoding': 'gzip',
    'content-security-policy': "default-src 'none'",
    'content-type': 'application/json; charset=utf-8',
    date: 'Mon, 07 Jun 2021 18:28:48 GMT',
    'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
    server: 'GitHub.com',
    'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
    'transfer-encoding': 'chunked',
    vary: 'Accept-Encoding, Accept, X-Requested-With',
    'x-content-type-options': 'nosniff',
    'x-frame-options': 'deny',
    'x-github-media-type': 'github.v3; format=json',
    'x-github-request-id': '0400:7AF3:2DC620D:56C894B:60BE6560',
    'x-ratelimit-limit': '1000',
    'x-ratelimit-remaining': '14',
    'x-ratelimit-reset': '1623093335',
    'x-ratelimit-resource': 'core',
    'x-ratelimit-used': '986',
    'x-xss-protection': '0'
  },
  request: {
    method: 'GET',
    url: 'api.github.com/repos/AirLabsTeam/next/deployments//statuses',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-core.js/3.2.4 Node.js/12.13.1 (linux; x64)',
      authorization: 'token [REDACTED]'
    },
    request: { agent: [Agent], hook: [Function: bound bound register] }
  },
  documentation_url: 'docs.github.com/rest'
}

Any ideas?

@patrickedqvist patrickedqvist self-assigned this Jun 8, 2021
@patrickedqvist
Copy link
Owner

@kylemh Hi! I've no idea by straight looking at the response you attached but could you try the canary branch and see if that changes anything?

@kylemh
Copy link
Contributor Author

kylemh commented Jun 16, 2021

Did that and also v1.1.1 with no dice. I can try to create a reproduction, but I'm not sure what extra info could be helpful.

Oh shit. I just scrolled up and noticed...

Checkout the fetch's URL: url: 'api.github.com/repos/AirLabsTeam/next/deployments//statuses',

How is that mistake happening?

@patrickedqvist
Copy link
Owner

@kylemh Hmm yes that is weird. The API request should look like this /repos/{owner}/{repo}/deployments/{deployment_id}/statuses. The deployment id is missing completely.

@kylemh
Copy link
Contributor Author

kylemh commented Jun 16, 2021

Maybe I need to wrap the value for environment in a string? I'm not sure where I've gone wrong otherwise.

@kylemh
Copy link
Contributor Author

kylemh commented Jun 21, 2021

Unreal ☠️

environment: Preview - website --> environment: Preview – website

In case you didn't catch that... - -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants