Support custom (secret) variables in host name templates - #49337
Conversation
Relates to #38806 Host name templates previously accepted only built-in $FLEET_VAR_* variables and rejected custom $FLEET_SECRET_* (secret) variables. Allow secret variables so admins can embed an org-wide custom value in an Apple host's name.
|
@coderabbitai full review |
✅ Action performedFull review finished. |
WalkthroughHost name templates now accept Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #49337 +/- ##
=======================================
Coverage 67.95% 67.96%
=======================================
Files 3820 3820
Lines 240982 241058 +76
Branches 12693 12693
=======================================
+ Hits 163759 163826 +67
- Misses 62346 62354 +8
- Partials 14877 14878 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| WHERE COALESCE(t.config->>'$.mdm.name_template', '') != '' | ||
| UNION ALL | ||
| SELECT 'host_name_template' AS entity, 'Host name' AS name, | ||
| 'No team' AS team_name, json_value->>'$.mdm.name_template' AS contents |
There was a problem hiding this comment.
We should probably update these instances to be "Unassigned" instead of "No team" (IIRC it's for the error)
There was a problem hiding this comment.
Cool - I'll make that update in the other batch of changes
Relates to #38806
Host name templates previously accepted only built-in $FLEET_VAR_* variables and rejected custom $FLEET_SECRET_* (secret) variables. Allow secret variables so admins can embed an org-wide custom value in an Apple host's name.
Checklist for submitter
If some of the following don't apply, delete the relevant line.
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.Testing
Summary by CodeRabbit
New Features
Bug Fixes