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

Simplify Packet Broker settings #6639

Merged
merged 29 commits into from
Oct 30, 2023
Merged

Simplify Packet Broker settings #6639

merged 29 commits into from
Oct 30, 2023

Conversation

ryaplots
Copy link
Contributor

Summary

Closes #3838

Changes

  • Update packet broker main view
  • Separate two forms
  • Add radio button options
  • Update e2e tests
  • Remove gateway visibility

Screenshot 2023-10-18 at 14-47-15 Management platform for The Things Stack for LoRaWAN

Testing

  1. Open packet broker in the admin panel.
  2. Select the first two options one at a time to make sure each one is successful.
  3. Select custom configuration, go to the network tab and change a network config.
  4. Reload the page see that the configuration you selected is the one shown.

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • The steps/process to test this feature are clearly explained including testing for regressions.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@ryaplots ryaplots added c/console This is related to the Console ui/web This is related to a web interface labels Oct 18, 2023
@ryaplots ryaplots added this to the v3.28.1 milestone Oct 18, 2023
@ryaplots ryaplots self-assigned this Oct 18, 2023
@github-actions github-actions bot removed the c/console This is related to the Console label Oct 18, 2023
Copy link
Member

@johanstokking johanstokking left a comment

Choose a reason for hiding this comment

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

I tested this locally and I have a few issues:

  1. If you select sandbox, it creates a policy with NetID 000013 but not tenant ID ttn. It should be with tenant ID ttn explicitly because that is the community network.
  2. When I go from the first radio button (forward traffic to all networks) and save, there's indeed a default routing policy created. However, the home network routing policy with 00013 is still there. I think all other policies should be deleted
  3. When I go back to the second radio button (forward to sandbox) and click save, I get the error [0]

[0]

{
  "code": 3,
  "message": "type mismatch, parameter: net_id, error: strconv.ParseUint: parsing \"NaN\": invalid syntax"
}

@ryaplots
Copy link
Contributor Author

ryaplots commented Oct 23, 2023

I tested this locally and I have a few issues:

1. If you select sandbox, it creates a policy with NetID `000013` but not tenant ID `ttn`. It should be with tenant ID `ttn` explicitly because that is the community network.

2. When I go from the first radio button (forward traffic to all networks) and save, there's indeed a default routing policy created. However, the home network routing policy with `00013` is still there. I think all other policies should be deleted

3. When I go back to the second radio button (forward to sandbox) and click save, I get the error [0]

[0]

{
  "code": 3,
  "message": "type mismatch, parameter: net_id, error: strconv.ParseUint: parsing \"NaN\": invalid syntax"
}
  1. When trying to create a policy with an explicit tenant id (this url: https://tti.staging1.cloud.thethings.industries/api/v3/pba/home-networks/policies/19/ttn) I get an error:
{
  "code": 10,
  "message": "error:unknown:unknown (bad reference)",
  "details": [
    {
      "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
      "message_format": "bad reference",
      "correlation_id": "fa423e90d1854199bb417f4497ffb3be",
      "code": 10
    }
  ]
}

I checked the staging networks list and it seems like The Things Network network does not have a tenant id. Also when updating its policy the request is sent to https://tti.staging1.cloud.thethings.industries/api/v3/pba/home-networks/policies/19, which is why I used the same net_id and did not indicate a tenant ID.

  1. I will update this.

  2. Also looking into fixing this.

@johanstokking

@ryaplots ryaplots force-pushed the fix/packet-broker-view branch from 2661483 to 1761a1d Compare October 23, 2023 14:32
@kschiffer
Copy link
Contributor

If you select sandbox, it creates a policy with NetID 000013 but not tenant ID ttn. It should be with tenant ID ttn explicitly because that is the community network.

TTN is not on a tenant, is it? It's a single-tenant network, or what am I missing?

@johanstokking
Copy link
Member

If you select sandbox, it creates a policy with NetID 000013 but not tenant ID ttn. It should be with tenant ID ttn explicitly because that is the community network.

TTN is not on a tenant, is it? It's a single-tenant network, or what am I missing?

Yeah it actually is a tenant, but not on The Things Stack Cloud. The Things Stack Sandbox is a single tenant deployment that uses NetID 000013 and tenant ID ttn. For Packet Broker, there's no difference between ttn and TTSC tenants.

@ryaplots indeed the ttn tenant was missing on Packet Broker staging. It is there now.

Copy link
Contributor

@kschiffer kschiffer left a comment

Choose a reason for hiding this comment

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

The default gateway visibility configuration should not be deleted but moved to a separate tab next to "Routing configuration".

@kschiffer
Copy link
Contributor

See this updated wireframe:
image

@ryaplots
Copy link
Contributor Author

ryaplots commented Oct 24, 2023

See this updated wireframe:

Where can I get the texts from the tooltips of the routing options? @kschiffer

@kschiffer
Copy link
Contributor

Let's skip them for now.

@ryaplots ryaplots requested a review from kschiffer October 25, 2023 12:09
@kschiffer
Copy link
Contributor

We need to update the routing there in general a bit and make /routing-configuration an explicit routes, otherwise there is ambiguity in the active link selection. (Try selecting the network tab within routing configuration and notice that Routing configuration is not selected anymore.

I've taken a shot at this and added a fix commit.

@kschiffer kschiffer force-pushed the fix/packet-broker-view branch from c0b533a to 5a86cfc Compare October 26, 2023 07:37
Copy link
Contributor

@kschiffer kschiffer left a comment

Choose a reason for hiding this comment

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

Please do a final test of the new code before merging.

@johanstokking
Copy link
Member

  1. What I'm now missing is a way to reset the default routing policy. If you now have custom selected, you have an empty default routing policy, even if none is set. If you click Save, it saves an empty default routing policy. But as outlined in Simplify Packet Broker settings #6639 (comment), there is a difference between no default routing policy and an all-zero default routing policy.

  2. If you have "Forward traffic to all networks registered in Packet Broker" selected (and saved) and then click Custom, it would be nice to have the default routing policy enabled and all-checked, because that's what the current state is.

@ryaplots ryaplots requested a review from kschiffer October 30, 2023 08:36
@ryaplots
Copy link
Contributor Author

  1. What I'm now missing is a way to reset the default routing policy. If you now have custom selected, you have an empty default routing policy, even if none is set. If you click Save, it saves an empty default routing policy. But as outlined in Simplify Packet Broker settings #6639 (comment), there is a difference between no default routing policy and an all-zero default routing policy.

    1. If you have "Forward traffic to all networks registered in Packet Broker" selected (and saved) and then click Custom, it would be nice to have the default routing policy enabled and all-checked, because that's what the current state is.

I have taken this into account and added back the functionality. @johanstokking Please review.

Copy link
Member

@johanstokking johanstokking left a comment

Choose a reason for hiding this comment

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

Thanks, this now works as expected.

@ryaplots ryaplots merged commit 424bb46 into v3.28 Oct 30, 2023
12 of 13 checks passed
@ryaplots ryaplots deleted the fix/packet-broker-view branch October 30, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui/web This is related to a web interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants