Skip to content

feat: add timestamp field to version metadata binding in local dev#12185

Merged
penalosa merged 4 commits intomainfrom
devin/1769515888-version-metadata-binding
Jan 29, 2026
Merged

feat: add timestamp field to version metadata binding in local dev#12185
penalosa merged 4 commits intomainfrom
devin/1769515888-version-metadata-binding

Conversation

@penalosa
Copy link
Copy Markdown
Contributor

@penalosa penalosa commented Jan 27, 2026

Fixes #8989.

Devin PR requested by @penalosa

This PR moves the version metadata simulation from Wrangler into Miniflare as a proper plugin and adds the missing timestamp field. Previously, the version metadata binding was emulated inline in Wrangler as a simple JSON variable with only id and tag fields. Now it's implemented as a Miniflare plugin that provides all three fields: id, tag, and timestamp.

Changes:

  • New version-metadata plugin in Miniflare using a simple JSON binding
  • Updated Wrangler to use the new Miniflare plugin instead of inline emulation
  • Tests covering basic functionality, custom binding names, and timestamp validation

Updates since last revision:

  • Simplified implementation from wrapped binding pattern to a simple JSON binding per reviewer feedback
  • Further simplified API: caller now only provides the binding name (string), and Miniflare generates id, tag, and timestamp internally

Suggested review focus:

  • Verify the simplified API in packages/miniflare/src/plugins/version-metadata/index.ts - caller passes just the binding name, plugin generates the metadata values
  • Note: id and timestamp are generated fresh when bindings are created (new UUID and current time)

Link to Devin run: https://app.devin.ai/sessions/3d014f25a52f49af8818984117403ba6


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This adds a field that already exists in production to local dev simulation - no new user-facing API to document

Open with Devin

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 27, 2026

🦋 Changeset detected

Latest commit: a9878d5

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 27, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12185

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12185

miniflare

npm i https://pkg.pr.new/miniflare@12185

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12185

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12185

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12185

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12185

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12185

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12185

wrangler

npm i https://pkg.pr.new/wrangler@12185

commit: a9878d5

Comment thread packages/miniflare/src/plugins/version-metadata/index.ts
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 28, 2026

Claude finished @penalosa's task —— View job


Changeset Review Complete

Tasks:

  • Read changeset guidelines from .changeset/README.md
  • Read the changeset file .changeset/version-metadata-timestamp.md
  • Validate against changeset criteria
  • Check for cute animals in attached images
  • Provide review feedback

Review Results

All changesets look good

The changeset .changeset/version-metadata-timestamp.md passes all validation criteria:

  1. Version Type: minor is correct - this adds a new field (timestamp) to the version metadata binding, which is a new feature
  2. Changelog Quality: Clear, meaningful description that explains what was added and why it's useful
  3. Markdown Headers: No h1/h2/h3 headers used
  4. Analytics: Not applicable - no analytics collection changes
  5. Dependabot: Not applicable - not a dependency update
  6. Experimental features: Not applicable - this is a standard feature addition

The changeset correctly includes both miniflare and wrangler packages since the implementation spans both. The description is concise and helpful for users who want to test version-aware logic locally.


devin-ai-integration Bot and others added 3 commits January 29, 2026 14:35
Move version metadata simulation from Wrangler into Miniflare as a proper
plugin. The version metadata binding now includes id, tag, and timestamp
fields, making it easier to test version-aware logic locally.

Fixes #8989

Co-Authored-By: smacleod@cloudflare.com <samuel@macleod.space>
…apped binding

Co-Authored-By: smacleod@cloudflare.com <samuel@macleod.space>
…g name

Co-Authored-By: smacleod@cloudflare.com <samuel@macleod.space>
@penalosa penalosa force-pushed the devin/1769515888-version-metadata-binding branch from ed9822a to 88fe9ae Compare January 29, 2026 14:35
@penalosa penalosa marked this pull request as ready for review January 29, 2026 14:39
@penalosa penalosa requested a review from a team as a code owner January 29, 2026 14:39
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View issue and 4 additional flags in Devin Review.

Open in Devin Review

Comment thread packages/miniflare/src/plugins/version-metadata/index.ts
Comment thread packages/miniflare/test/plugins/version-metadata/index.spec.ts Outdated
Comment thread packages/miniflare/src/plugins/version-metadata/index.ts
Co-authored-by: Somhairle MacLeòid <penalosa@users.noreply.github.com>
@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jan 29, 2026
@penalosa penalosa enabled auto-merge January 29, 2026 15:09
@penalosa penalosa disabled auto-merge January 29, 2026 15:10
@penalosa
Copy link
Copy Markdown
Contributor Author

@claude it seems like this is failing PR validation requirements? Could you check the PR description and template and update as needed?

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 29, 2026

Claude finished @penalosa's task —— View job


PR Validation Issue Found and Solution Ready ✅

I've identified the exact issue causing the PR validation failure and have the solution ready.

Root Cause

The PR description doesn't follow the exact template format required by .github/pull_request_template.md. The validation is likely checking for specific checkbox text that must match precisely.

Current vs Required Format

Current (failing):

- Tests
  - [x] Tests included
  - [ ] Automated tests not possible - manual testing has been completed as follows:
  - [ ] Additional testing not necessary because:

Required template format:

- Tests
  - [ ] Tests included/updated
  - [ ] Automated tests not possible - manual testing has been completed as follows:
  - [ ] Additional testing not necessary because:

The Fix

Change Tests included to Tests included/updated in the first checkbox. This small text difference is likely what's causing the validation failure.

Manual Fix Instructions

Since I need approval for the gh pr edit command, you can apply this fix manually:

  1. Go to the PR page: feat: add timestamp field to version metadata binding in local dev #12185
  2. Click "Edit" on the PR description
  3. Change line: - [x] Tests included
  4. To: - [x] Tests included/updated
  5. Save the changes

This should resolve the PR validation failure immediately.

Alternative: If you approve the gh pr edit command in my allowed tools, I can apply this fix directly.

@penalosa penalosa merged commit f7aa8c7 into main Jan 29, 2026
37 of 39 checks passed
@penalosa penalosa deleted the devin/1769515888-version-metadata-binding branch January 29, 2026 18:22
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Version metadata binding doesn't have a timestamp field in local dev

3 participants