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

chore(create-cloudflare): provide SPARROW_SOURCE_KEY on pre-release and publish build #6807

Closed
wants to merge 2 commits into from

Conversation

edmundhung
Copy link
Member

@edmundhung edmundhung commented Sep 23, 2024

What this PR solves / how to test

Fixes #6484.

We merged #6484 today and thought that the current build setup should be sufficient as both wrangler and create-cloudflare rely on the same env SPARROW_SOURCE_KEY. Unfortunately, wrangler does an additional re-build before publish and the current setup inject the env only on the publish step instead of during the build.

This is a quick fix to enable telemetry in c3. We should removes the need to set the env on both steps in the future.

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because: no feature change
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: no feature change
  • Changeset (Changeset guidelines)
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: No feature change

@edmundhung edmundhung requested a review from a team as a code owner September 23, 2024 16:40
Copy link

changeset-bot bot commented Sep 23, 2024

⚠️ No Changeset found

Latest commit: 6ea473b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -33,6 +33,9 @@ jobs:
run: pnpm run build
env:
CI_OS: ${{ runner.os }}
# This is the "production" key for sparrow analytics.
# This is needed for create-cloudflare
SPARROW_SOURCE_KEY: "50598e014ed44c739ec8074fdc16057c"
Copy link
Member Author

@edmundhung edmundhung Sep 23, 2024

Choose a reason for hiding this comment

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

Wrangler will rebuild on publish on a later step, click here to see the publish step.

@@ -40,6 +40,9 @@ jobs:
env:
NODE_ENV: "production"
CI_OS: ${{ runner.os }}
# this is the "test/staging" key for sparrow analytics
# This is needed for create-cloudflare
SPARROW_SOURCE_KEY: "5adf183f94b3436ba78d67f506965998"
Copy link
Member Author

@edmundhung edmundhung Sep 23, 2024

Choose a reason for hiding this comment

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

Wrangler will re-build on publish later, click here to see the publish step.

Copy link
Contributor

Choose a reason for hiding this comment

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

just for my understanding...why is one workflow using prod and the other staging?

Copy link
Contributor

github-actions bot commented Sep 23, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10999209560/npm-package-wrangler-6807

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6807/npm-package-wrangler-6807

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10999209560/npm-package-wrangler-6807 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10999209560/npm-package-create-cloudflare-6807 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10999209560/npm-package-cloudflare-kv-asset-handler-6807
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10999209560/npm-package-miniflare-6807
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10999209560/npm-package-cloudflare-pages-shared-6807
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10999209560/npm-package-cloudflare-vitest-pool-workers-6807
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10999209560/npm-package-cloudflare-workers-editor-shared-6807
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10999209560/npm-package-cloudflare-workers-shared-6807

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.78.7 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240909.4
workerd 1.20240909.0 1.20240909.0
workerd --version 1.20240909.0 2024-09-09

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@edmundhung edmundhung marked this pull request as draft September 23, 2024 17:48
@edmundhung
Copy link
Member Author

I make a wrong assumption that only wrangler is re-built on publish, but it's not as both create-cloudflare and wrangler will rebuild.

@edmundhung edmundhung closed this Sep 23, 2024
@edmundhung edmundhung deleted the edmundhung/enable-c3-telemetry branch September 23, 2024 17:54
@edmundhung
Copy link
Member Author

Followup PR: #6808

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

Successfully merging this pull request may close these issues.

2 participants