Skip to content

[docs] Extend description of templates behaviour #991

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

okraits
Copy link
Member

@okraits okraits commented Mar 14, 2025

I improved the description of the behaviour of default and required templates a bit.

@@ -116,6 +122,9 @@ unassigned from a device configuration, they can only be overridden.
They will be always assigned earlier than default templates, so they can
be overridden if needed.

Another difference to :ref:`default_templates` is that required templates are
assigned to all devices, not just new devices.
Copy link
Member

Choose a reason for hiding this comment

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

Are you 100% sure of this? I don't remember we added logic to automatically modify existing devices. As far as I remember the required template would be applied only if the user saves the device object.

Copy link
Member Author

@okraits okraits Mar 14, 2025

Choose a reason for hiding this comment

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

I didn't see it in the code but I noticed that a required template had been marked as assigned (with its checkbox disabled) in all devices after the template was made required. I didn't create a new device at all.

That's why I thought that adding this information to the docs would be useful as this is a clear difference in behaviour compared to default templates.

Edit: this comment #480 (comment) puts some doubt on it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Trying to investigate the current behaviour, I did the following:

  1. Create two devices, in different orgs. None has a template assigned.
  2. Create four templates, two in each org. In each org one template is a default template and one is a required template.
  3. Create two shared templates. One is a default template and one is a required template.
  4. Create two more devices, one in each org.

Then the situation is as follows:

  • The first two devices have two templates assigned each. The one required template of their org and the one shared required template.
  • The second two devices have four templates assigned each. Two required templates (one of their org and one shared) and two default templates (one of their org and one shared).

So my previous observation and my additions to the docs match my tests.

to any new device but to any new device config. So if you have any
device which was registered before a specific template was made a default
template, you can delete its config and create a new one, then the new config
will automatically have all current default templates assigned.
Copy link
Member

Choose a reason for hiding this comment

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

We shall keep in mind this could change: #480.

@okraits
Copy link
Member Author

okraits commented Mar 20, 2025

I will put this on hold until #480 is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants