storacha / w3infra

🏗️ Infra for the w3up UCAN protocol implementation
Other
17 stars 7 forks source link

Storacha-branded validation flow #417

Closed Peeja closed 1 month ago

Peeja commented 2 months ago

Before Merge:


With NEXT_PUBLIC_W3UP_SERVICE_URL=https://petra.up.storacha.network in my local console:

CleanShot 2024-08-19 at 17 33 15

Then…

CleanShot 2024-08-19 at 17 34 12

And success!

CleanShot 2024-08-19 at 17 33 55

Or, failure.

CleanShot 2024-08-19 at 17 34 19

Note that that error message is a dummy message in the test harness, not something real. Also, I see to have bumped something that made the Stripe section always appear. Previously, staging/prod was set not to show it by not providing the right env vars. I'm not sure why that changed, and whether we want it to.

Closes https://github.com/storacha-network/project-tracking/issues/119

Peeja commented 2 months ago

Lint errors, please hold…

seed-deploy[bot] commented 2 months ago
View stack outputs - **pr417-w3infra-BillingDbStack** Name | Value -- | -- customerTableName | pr417-w3infra-customer spaceDiffTableName | pr417-w3infra-space-diff spaceSnapshotTableName | pr417-w3infra-space-snapshot usageTable | pr417-w3infra-usage - **pr417-w3infra-BillingStack** Name | Value -- | -- ApiEndpoint | https://vv2g4u9q14.execute-api.us-east-2.amazonaws.com billingCronHandlerURL | https://7zay7q3fhhs3mxm27hcbs7xuku0vnaex.lambda-url.us-east-2.on.aws/ CustomDomain | https://pr417.billing.web3.storage - **pr417-w3infra-CarparkStack** Name | Value -- | -- BucketName | carpark-pr417-0 Region | us-east-2 - **pr417-w3infra-RoundaboutStack** Name | Value -- | -- ApiEndpoint | https://5kfqhmzwoh.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr417.roundabout.web3.storage - **pr417-w3infra-UcanInvocationStack** Name | Value -- | -- invocationBucketName | invocation-store-pr417-0 taskBucketName | task-store-pr417-0 workflowBucketName | workflow-store-pr417-0 - **pr417-w3infra-UploadApiStack** Name | Value -- | -- ApiEndpoint | https://vfsk7vmnb7.execute-api.us-east-2.amazonaws.com ApiEndpointStoracha | https://f2ro5s78pi.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr417.up.web3.storage CustomDomainStoracha | Set HOSTED_ZONE_STORACHA in env to deploy to a custom domain for Storacha - **pr417-w3infra-BusStack** - **pr417-w3infra-FilecoinStack** - **pr417-w3infra-IndexerStack** - **pr417-w3infra-ReplicatorStack** - **pr417-w3infra-UcanFirehoseStack** - **pr417-w3infra-UploadDbStack**
Peeja commented 2 months ago

@alanshaw Not sure what's failing here. It should be unrelated. Are these tests a bit flaky, or did I bump something?

Peeja commented 2 months ago

@alanshaw Rereview? WDYT?

hannahhoward commented 2 months ago

Hi!

I did some investigating and it appears the build is failing for you on seed.run cause of the pluralization of HOSTED_ZONES. I added this env variable and now it's just failing on the flaky tests.

However, I'm seeing some other issues in the code as well around this pluralization and it needs a cleanup at minimum. For example the env.tpl lists HOSTED_ZONE and HOSTED_STORACHA_ZONE. And there's a reference to .HOSTED_ZONE in the filecoin stack.

Also in the integration tests if it's run locally I believe it tries to derive the api endpoint from .ApiEndpoint instead of .ApiEndpoints.

That's as far as I got -- I'm actually having an error running on my own deployment environment cause it says preact isn't defined in the lambda response when I click the email. I'm not sure if this is related to the typescript change or not, but all my integration tests fail when I attempt to validate the email. Generally, it should be possible to run npm run test-integration successfully even locally, though I'm not 100% sure about that.

Anyway, gonna move on to actually trying to fix flaky tests but this may be the source of your issues in seed.run

hannahhoward commented 2 months ago

I might also suggest setting HOSTED_ZONES on the fly if it's not present from HOSTED_ZONE and HOSTED_STORACHA_ZONE for maximum backward compatibility.

Peeja commented 2 months ago

@hannahhoward I don't think that's it. https://github.com/storacha-network/w3infra/pull/418 is failing too. All that does is bump the TypeScript version.

Peeja commented 2 months ago

@hannahhoward Also, you're right that there are references to HOSTED_ZONE which I missed. Now that I'm looking at them, I could use some direction. I don't fully understand the Filecoin and Roundabout stacks yet; what are they doing with that URL and what should they do when there are multiple "brands" to choose from?

Notably, there's one HOSTED_ZONE which is fine: the validate-email function takes a HOSTED_ZONE env var for its own hosted zone. It's instantiated for each of the zones configured.

As for reading from ApiEndpoints…apparently I didn't push that commit. 🤦🏻‍♀️ It's up now. 😅

hannahhoward commented 2 months ago

@Peeja for the filecoin and roundabout stacks, these are entirely API services with no direct interaction with the client. Honestly, they should probably all be on the storacha.network domain, but for now we can just avoid any change and use HOSTED_ZONES.split(",")[0]

seed-deploy[bot] commented 2 months ago
Stack outputs updated - **pr417-w3infra-BillingDbStack** Name | Value -- | -- customerTableName | pr417-w3infra-customer spaceDiffTableName | pr417-w3infra-space-diff spaceSnapshotTableName | pr417-w3infra-space-snapshot usageTable | pr417-w3infra-usage - **pr417-w3infra-BillingStack** Name | Value -- | -- ApiEndpoint | https://vv2g4u9q14.execute-api.us-east-2.amazonaws.com billingCronHandlerURL | https://7zay7q3fhhs3mxm27hcbs7xuku0vnaex.lambda-url.us-east-2.on.aws/ CustomDomain | https://pr417.billing.web3.storage - **pr417-w3infra-CarparkStack** Name | Value -- | -- BucketName | carpark-pr417-0 Region | us-east-2 - **pr417-w3infra-RoundaboutStack** Name | Value -- | -- ApiEndpoint | https://5kfqhmzwoh.execute-api.us-east-2.amazonaws.com CustomDomain | https://pr417.roundabout.web3.storage - **pr417-w3infra-UcanInvocationStack** Name | Value -- | -- invocationBucketName | invocation-store-pr417-0 taskBucketName | task-store-pr417-0 workflowBucketName | workflow-store-pr417-0 - **pr417-w3infra-UploadApiStack** Name | Value -- | -- ApiEndpoints | ["https://ponccdwk12.execute-api.us-east-2.amazonaws.com"] CustomDomains | ["https://pr417.up.web3.storage"] - **pr417-w3infra-BusStack** - **pr417-w3infra-FilecoinStack** - **pr417-w3infra-IndexerStack** - **pr417-w3infra-ReplicatorStack** - **pr417-w3infra-UcanFirehoseStack** - **pr417-w3infra-UploadDbStack**