Skip to content

chore: convert versions and versions secret to createCommand#7437

Merged
penalosa merged 7 commits intomainfrom
aj/define-command-versions-2
Dec 4, 2024
Merged

chore: convert versions and versions secret to createCommand#7437
penalosa merged 7 commits intomainfrom
aj/define-command-versions-2

Conversation

@andyjessop
Copy link
Copy Markdown
Contributor

@andyjessop andyjessop commented Dec 4, 2024

Fixes #000.

Converts wrangler versions and wrangler versions secret to use the CommandRegistry.

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Dec 4, 2024

⚠️ No Changeset found

Latest commit: bc3f051

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 4, 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/12160970528/npm-package-wrangler-7437

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

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

Or you can use npx with this latest build directly:

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

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


wrangler@3.92.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20241106.2
workerd 1.20241106.2 1.20241106.2
workerd --version 1.20241106.2 2024-11-06

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

@andyjessop andyjessop force-pushed the aj/define-command-versions-2 branch 2 times, most recently from 983d255 to 3f7f90f Compare December 4, 2024 11:04
@andyjessop andyjessop marked this pull request as ready for review December 4, 2024 11:07
@andyjessop andyjessop requested a review from a team as a code owner December 4, 2024 11:07
@andyjessop andyjessop added e2e Run wrangler + vite-plugin e2e tests on a PR no-changeset-required labels Dec 4, 2024
@andyjessop andyjessop force-pushed the aj/define-command-versions-2 branch from 4ed136d to be54053 Compare December 4, 2024 11:34
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These are now pure unit tests, rather than testing any yargs functionality. So the ordering tests have been removed (not the concern of this function), and there is no need to build and parse the yargs object.

@andyjessop andyjessop force-pushed the aj/define-command-versions-2 branch from be54053 to f679597 Compare December 4, 2024 11:59
metadata: {
description: "View the details of a specific version of your Worker",
owner: "Workers: Authoring and Testing",
status: "open-beta",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Best to leave for a separate PR, I think.

requiresArg: true,
},
},
handler: async function versionsUploadHandler(args, { config }) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we can use this config as-is—this command used const configPath = args.config || (args.script && findWranglerConfig(path.dirname(args.script))); to locate the config, logic which isn't in defineCommand

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated here: c447e87

Comment thread packages/wrangler/src/versions/list.ts Outdated
},
},
handler: async function versionsSecretListHandler(args) {
const config = readConfig(args.config, args, false, true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated here: 25c9e04

Copy link
Copy Markdown
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

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

Deferring beta re-classification for now

@andyjessop andyjessop force-pushed the aj/define-command-versions-2 branch from edf60ee to bc3f051 Compare December 4, 2024 13:40
@penalosa penalosa merged commit bc30823 into main Dec 4, 2024
@penalosa penalosa deleted the aj/define-command-versions-2 branch December 4, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run wrangler + vite-plugin e2e tests on a PR no-changeset-required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants