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: convert versions and versions secret to createCommand #7437

Merged
merged 7 commits into from
Dec 4, 2024

Conversation

andyjessop
Copy link
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

Copy link

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

Copy link
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.


[email protected] 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 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

const args = options.parse(input) as VersionsDeployArgs;
const result = parseVersionSpecs(args);
const result = parseVersionSpecs({});
Copy link
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
Contributor

Choose a reason for hiding this comment

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

Copy link
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
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
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

},
},
handler: async function versionsSecretListHandler(args) {
const config = readConfig(args.config, args, false, true);
Copy link
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
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
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
32 checks passed
@penalosa penalosa deleted the aj/define-command-versions-2 branch December 4, 2024 13:59
penalosa pushed a commit that referenced this pull request Jan 10, 2025
* chore: convert versions and versions secret to createCommand

remove comment

* use correct config for upload handler

* use built-in config for list command

* chore: fix lint errors

* don't print config warnings for deploy

* warnings are on upload, not deploy

* chore: update shapshot

snapshot update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e tests on a PR no-changeset-required
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants