Update default wrangler version to 3.x
Hey! 👋 Apologies for not reviewing this sooner. This wrangler version is now out of date again... 😅 We should set up some automation to bump this automatically. 👍 Would you be able to bump this to 3.37.0 and add a changeset similar to https://github.com/cloudflare/wrangler-action/commit/473d9cbd296528b41c653af10062faba6540a7ab?
@mrbbot all done, but I'm afraid there is a new version already...
IMO, we should rework the action to use latest as a last resort default (rather than some hardcoded version number that'll quickly fall out of date), with the following precedence order for determining the wrangler version used by the action:
- If the
wranglerVersioninput was specified, check for an existingwranglerinstallation in the PATH that satisfies that version. If so, use it. Else, install the specified version and use that instead. - If no
wranglerVersionwas specified, check for an existingwranglerinstallation in the PATH (most likely declared in package.json and installed by a previous "install packages" step of the workflow). If so, use it. Else, installwrangler@latestand use that.
IMO, we should rework the action to use
latestas a last resort default (rather than some hardcoded version number that'll quickly fall out of date), with the following precedence order for determining the wrangler version used by the action:
- If the
wranglerVersioninput was specified, check for an existingwranglerinstallation in the PATH that satisfies that version. If so, use it. Else, install the specified version and use that instead.- If no
wranglerVersionwas specified, check for an existingwranglerinstallation in the PATH (most likely declared in package.json and installed by a previous "install packages" step of the workflow). If so, use it. Else, installwrangler@latestand use that.
Makes sense LGTM 👍
In that case I think we should leave @nevikashah to take a call on this and hand it over to the new team that owns this repo now.
Oh! It is 3.52.0 now...
OK - so thinking about this a bit more.
Rather than constantly bumping this, I propose that we land #235 and then set change DEFAULT_WRANGLER_VERSION to latest.
Then the user has two ways to lock this down, either by installing wrangler locally or specifying a version in the wrangler-action config. Otherwise they just get latest.
How do people feel about that?
OK - so thinking about this a bit more.
Rather than constantly bumping this, I propose that we land #235 and then set change
DEFAULT_WRANGLER_VERSIONtolatest.Then the user has two ways to lock this down, either by installing wrangler locally or specifying a version in the wrangler-action config. Otherwise they just get latest.
How do people feel about that?
latest sounds dangerous and like a breaking change waiting to happen. I think v3 or 3.x.x would be fine though.
latest sounds dangerous and like a breaking change waiting to happen. I think v3 or 3.x.x would be fine though.
Yeah I actually meant to say 3.x when I said latest 😄
@petebacondarwin @1000hz to confirm, there is a way around this? a user can specify the version in their package.json? just trying to understand the urgency here
@petebacondarwin @1000hz to confirm, there is a way around this? a user can specify the version in their package.json? just trying to understand the urgency here
Yes, I believe now that #235 has been merged this is much less urgent. We should still eventually figure out what a good fallback default value ought to be though.
OK - so thinking about this a bit more.
Rather than constantly bumping this, I propose that we land #235 and then set change
DEFAULT_WRANGLER_VERSIONtolatest.Then the user has two ways to lock this down, either by installing wrangler locally or specifying a version in the wrangler-action config. Otherwise they just get latest.
How do people feel about that?
This was my original intent. This should be the case, at the very least default the minor versions like here const DEFAULT_WRANGLER_VERSION = "3.x";
@JacobMGEvans I don't think the action should ever default to latest - that's a semver problem waiting to happen when v4.x releases and some commands people are using (like for example publish) get removed, or behaviour changed. The action has always pinned a version, so changing that behaviour now (especially to new majors) would be breaking.
The latest version of the 3.x should be fine though.
Edit: saw the edit, and yep agreed. Latest 3.x should be good!