Skip to content

Conversation

@tiffafoo
Copy link
Contributor

@tiffafoo tiffafoo commented Feb 19, 2021

- Summary
The --trafficMesh flag is not a super clear term to users, let's go for --edgeHandlers which is more to the point. Deprecate the current flag in favor of a. new flag and add a warning to users that use the old one.

image

- Test plan

Choose your poison:

  • npm run test (follow Contributing.md for instructions)
  • netlify dev --edgeHandlers
  • netlify dev -eh

- Description for the changelog

Rename netlify dev flag --trafficMesh (short: -t) to --edgeHandlers (short: -eh) and update description to activates the edge handlers runtime.

- A picture of a cute animal (not mandatory but encouraged)

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Feb 19, 2021
@tiffafoo tiffafoo marked this pull request as ready for review February 19, 2021 17:03
@tiffafoo tiffafoo requested a review from a team as a code owner February 19, 2021 17:03
@tiffafoo
Copy link
Contributor Author

tiffafoo commented Feb 19, 2021

I have this as fix: but maybe chore: is better? It is a breaking change though even if it's hidden

@erquhart
Copy link
Contributor

Thanks @tiffanosaurus!

cc/ @erezrokah I believe this is okay if --trafficMesh is considered beta, but defer to you on the decision.

Copy link
Contributor

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

Thanks @tiffanosaurus is there any issue we can discuss this?
To my knowledge the trafficMesh flag does more than add Edge Handlers support (which allows running custom logic at the edge).
Should we should call it edge or local-edge?

Also, could we keep the old flag and add a warning message to users instructing them to switch to the new flag so they can self serve?
We can drop the old flag completely after a couple of weeks with the new one.

As for the PR type:

  1. chore: is a change that isn't visible to users (doesn't even require a new release)
  2. fix: is a bug fix (suggests a patch version)
  3. feat: is a user facing change (suggests a minor version) - so I believe this should be a feat:

To declare a breaking change you can use feat!:, but this isn't once since:

  1. The flag is hidden (like you mentioned).
  2. This is considered Beta (again like you mentioned).

@tiffafoo
Copy link
Contributor Author

Thanks @erezrokah! The issue and discussion around how to handle the flag can be found here: https://github.com/netlify/traffic-mesh/issues/1517

We can definitively add a new flag instead, we figured since it was beta, we could be more aggressive with the approach and replace it.

@tiffafoo tiffafoo changed the title fix: rename trafficMesh flag to edgeHandlers feat: rename trafficMesh flag to edgeHandlers Feb 22, 2021
@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Feb 22, 2021
char: 't',
hidden: true,
description: 'uses Traffic Mesh for proxying requests',
description: '(DEPRECATED: use --edgeHandlers or -eh instead) uses Traffic Mesh for proxying requests',
Copy link
Contributor Author

@tiffafoo tiffafoo Feb 22, 2021

Choose a reason for hiding this comment

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

Same here for the copy


if (flags.trafficMesh) {
warn(
'--trafficMesh and -t are deprecated and will be removed in the near future. Please use --edgeHandlers or -eh instead.',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if a different copy here would be better!

@tiffafoo tiffafoo requested a review from erezrokah February 22, 2021 20:45
@tiffafoo
Copy link
Contributor Author

tiffafoo commented Feb 22, 2021

Updated the PR with the new flag and a deprecation notice for the --trafficMesh. Thanks for the feedback!

This might have more changes as discussed in the issue since this not only enables edge handlers, but also the new redirect engine and people might want to enable it without wanting to use edge handlers.

Would you prefer to put this in draft mode or iterate as we figure it out @erezrokah?

description: 'start a public live session',
}),
edgeHandlers: flagsLib.boolean({
char: 'eh',
Copy link
Contributor

@mraerino mraerino Feb 22, 2021

Choose a reason for hiding this comment

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

it's common in the unix world to only have single-letter flags following a single-dash parameter so that you can combine multiple single letters in one param, e.g. tar -xzf which is short for tar -x -z -f. this kinda breaks with this convention and might leave users confused, wondering if there are isolated -e or -h (help?) flags?

multi-letter flags should always use double-dashes as a prefix imho

@erezrokah
Copy link
Contributor

Thank you for making these changes @tiffanosaurus. Can we finalize the discussion here before merging this? Also great point by @mraerino about the single letter convention.

@tiffafoo
Copy link
Contributor Author

Yep of course and will update for the letter convention

@rstavchansky
Copy link
Contributor

Heads up that the --trafficMesh flag is currently publicly documented. https://docs.netlify.com/routing/edge-handlers/configure-and-deploy/#local-development
@jacklyn-net for a docs update

@erezrokah erezrokah added needs docs and removed type: bug code to address defects in shipped code labels Feb 23, 2021
@tiffafoo tiffafoo dismissed erezrokah’s stale review February 24, 2021 22:56

Updated for the review

@erezrokah
Copy link
Contributor

@tiffanosaurus when you merge this can you keep the commit message as feat: rename trafficMesh flag to edgeHandlers (#1906) and clear the commit description from any intermediate messages?
That will ensure an automated version bump as a minor version.

@tiffafoo tiffafoo force-pushed the breaking/traffic-mesh-to-edge-handlers branch from eb5634e to be41c62 Compare February 25, 2021 17:04
@tiffafoo tiffafoo merged commit 54e4ac8 into master Feb 25, 2021
@tiffafoo tiffafoo deleted the breaking/traffic-mesh-to-edge-handlers branch February 25, 2021 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs docs type: feature code contributing to the implementation of a feature and/or user facing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants