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

Feature/vercel haas #6769

Merged
merged 2 commits into from
Mar 13, 2024
Merged

Feature/vercel haas #6769

merged 2 commits into from
Mar 13, 2024

Conversation

jsdalton
Copy link
Member

Purpose

We'll need HAAs to dynamically construct URLs for preview environments. This PR introduces some of the boilerplate and project structure needed to support HAAs along side the frontend.

Approach

  • Set up app actions as a folder
  • Move frontend to subfolder
  • Set up top level project to handle deploy and build
  • Add a basic status HAA as a smoke test

Testing steps

Front end still works:

image

Hosted app action call output:

ACCESS_TOKEN={redacted} npm run call-app-action -- -a vercelGetPreviewEnvironment -s q5wv5ajna1af

> @contentful/[email protected] call-app-action
> npx ts-node scripts/call-app-action.ts -a vercelGetPreviewEnvironment -s q5wv5ajna1af

APP ACTION RESULT
{
  sys: {
    id: '7a9cGi1GVeAHDUbYnEV0ZJ',
    type: 'AppActionCallDetails',
    space: { sys: { type: 'Link', linkType: 'Space', id: 'q5wv5ajna1af' } },
    sys: { type: 'Link', linkType: 'Environment', id: 'master' },
    createdBy: {
      sys: {
        type: 'Link',
        linkType: 'AppAction',
        id: 'vercelGetPreviewEnvironment'
      }
    },
    createdAt: '2024-03-13T17:25:34.110Z'
  },
  request: { function: 'actions/get-preview-env.js', parameters: {} },
  response: { body: '{"ok":true,"data":{"url":"url"}}', statusCode: 200 },
  statusCode: 200,
  responseAt: '2024-03-13T17:25:34.603Z',
  errors: [],
  eventType: 'call',
  url: 'hosted',
  requestAt: '2024-03-13T17:25:34.110Z',
  environmentId: 'master'
}
Result: success!

Breaking Changes

Dependencies and/or References

Deployment

@jsdalton jsdalton requested a review from a team as a code owner March 13, 2024 17:33
Copy link

netlify bot commented Mar 13, 2024

Deploy Preview for ecommerce-app-base-components canceled.

Name Link
🔨 Latest commit 6f8190b
🔍 Latest deploy log https://app.netlify.com/sites/ecommerce-app-base-components/deploys/65f1e3546f41a40007cf7bbc

Copy link
Contributor

@matthew-gordon matthew-gordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ LGTM

@jsdalton jsdalton merged commit 0a658b8 into master Mar 13, 2024
12 checks passed
@jsdalton jsdalton deleted the feature/vercel-haas branch March 13, 2024 17:43
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

Successfully merging this pull request may close these issues.

2 participants