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

Update remapping order of __ns and __node to not affect each other #299

Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions articles/141_static_remapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ The replacement must be a single token which will become the node's new name.

Remapping rules are applied in the following order:

1. Node name remapping
1. Namespace remapping
1. Namespace or Node name remapping
Copy link
Member

Choose a reason for hiding this comment

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

so now name are namespace rules are applied in the order they appear, right?

It would be great to make that clear here

Copy link
Member

Choose a reason for hiding this comment

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

order they appear

This is not the case, they order doesn't matter.
Their prefix is always the node name before remapping, maybe that can be made more clear.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the case, they order doesn't matter.

They're still ordered within a rule, right? If I give talker:__node:=foo and talker:__node:=bar, then is the final name is foo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ivanpauno

name and namespace rules are applied in the order they appear, right?

they order doesn't matter

the order of name and namespace rules doesn't matter.
I think users like to understand some rules by referring to an example description.

  • A user gives the rules talker:__ns:=/my_namespace then talker:__node:=foo, or vice versa

@sloretz

They're still ordered within a rule, right?

I supposed you mean the order of multiple items about __node or __ns, the answer is yes.

If I give talker:__node:=foo and talker:__node:=bar, then is the final name is foo?

Yes.
Actually, the example description already showed messages,

  • talker's namespace is /foo because that rule was given first
    though the above example uses talker:__ns:=/foo and __ns:=/bar

About this kind of information, I'll not update it in this PR.

1. All other rules

Within each category, the rules are applied in the order in which the user gave them.
Expand All @@ -339,8 +338,8 @@ Within each category, the rules are applied in the order in which the user gave
**Example of node/namespace remapping order:**

- A node has name `talker`
- A user gives the rules `talker:__ns:=/my_namespace` then `talker:__node:=foo`
- The final namespace is the default `/` because the node name remap is applied before the namespace remap
- A user gives the rules `talker:__ns:=/my_namespace` then `talker:__node:=foo`, or vice versa
- The final fully qualified name is `/my_namespace/foo` because the namespace and node name remap are applied without affecting each other
Copy link
Contributor

@sloretz sloretz Oct 20, 2020

Choose a reason for hiding this comment

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

the namespace and node name remap are applied without affecting each other

I would change this wording to: the namespace and node name remap rules both match against the orignal node name before remappings are applied.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I'll update it later.


**Example of a default and node specific namespace remap:**

Expand Down