Add 'linux' as platform for labels - #50270
Conversation
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Pull request overview
Adds support for a generic linux platform option when creating/editing labels so label platform scoping can target all Linux distributions (not just Ubuntu/CentOS), spanning backend validation + host matching, UI selection/display, and GitOps generation tests.
Changes:
- Accept
linuxas a valid label platform and ensure Linux hosts match both their distro-specific platform and the genericlinuxplatform. - Update UI platform selector/display strings to include “Linux” and clarify Ubuntu/CentOS as “(Linux)”.
- Extend integration/unit/GitOps tests and fixtures to cover
platform: linuxand round-tripping through spec endpoints and generated YAML.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| server/fleet/labels.go | Adds linux to the allowed label platform variants. |
| server/datastore/mysql/labels.go | Updates label query selection to match Linux hosts against both specific distro + generic linux via sqlx.In. |
| server/datastore/mysql/labels_test.go | Adds datastore-level test coverage for generic linux platform labels across multiple Linux host platforms. |
| server/service/integration_core_test.go | Updates integration coverage for invalid platforms and adds create/spec round-trip coverage for platform: linux. |
| frontend/pages/labels/components/PlatformField/PlatformField.tsx | Adds “Linux” option and updates display strings for Ubuntu/CentOS. |
| frontend/pages/labels/components/PlatformField/PlatformField.tests.tsx | Adds component tests for the new Linux option and updated edit-mode display text. |
| cmd/fleetctl/integrationtest/gitops/gitops_enterprise_integration_test.go | Extends GitOps integration test fixture to include a label with platform: linux. |
| cmd/fleetctl/fleetctl/generate_gitops_test.go | Extends mock label specs so generated GitOps output includes a linux platform label. |
| cmd/fleetctl/fleetctl/testdata/generateGitops/test_dir_premium/default.yml | Updates expected generated GitOps YAML fixture to include a linux platform label. |
| cmd/fleetctl/fleetctl/testdata/generateGitops/test_dir_free/default.yml | Updates expected generated GitOps YAML fixture to include a linux platform label. |
| cmd/fleetctl/fleetctl/testdata/generateGitops/expectedLabels.yaml | Updates expected labels YAML output to include the linux platform label. |
| changes/44088-linux-label-platform | Changes entry (content excluded by policy). |
Files excluded by content exclusion policy (1)
- changes/44088-linux-label-platform
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #50270 +/- ##
==========================================
+ Coverage 68.15% 68.17% +0.01%
==========================================
Files 3934 3935 +1
Lines 250923 250987 +64
Branches 13281 13285 +4
==========================================
+ Hits 171012 171104 +92
+ Misses 64581 64547 -34
- Partials 15330 15336 +6
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:
|
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Pull request overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.
Files excluded by content exclusion policy (1)
- changes/44088-linux-label-platform
There was a problem hiding this comment.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated no new comments.
Files excluded by content exclusion policy (1)
- changes/44088-linux-label-platform
Comments suppressed due to low confidence (1)
cmd/fleetctl/fleetctl/gitops_test.go:389
- The YAML fixture label name still says "Test - Linux invalid platform", but this PR makes "linux" a valid label platform. Renaming this string will keep the test intent clear (it’s testing rejection of an invalid platform value like "bados").
- name: Test - Linux invalid platform
Resolves #44088.
Changes file added for user-visible changes in
changes/,orbit/changes/oree/fleetd-chrome/changes.Input data is properly validated,
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