Skip to content

Docs: correct GitOps mode label editing behavior and document exceptions - #50552

Merged
rachaelshaw merged 4 commits into
mainfrom
50551-gitops-mode-labels-docs
Aug 6, 2026
Merged

Docs: correct GitOps mode label editing behavior and document exceptions#50552
rachaelshaw merged 4 commits into
mainfrom
50551-gitops-mode-labels-docs

Conversation

@kitzy

@kitzy kitzy commented Aug 5, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #50551

Two published pages still describe pre-4.84 behavior, telling users that GitOps mode doesn't restrict label editing in the UI. Since 4.84 that's only true when the labels exception is enabled. This PR corrects both pages and documents the exceptions framework.

docs/Configuration/yaml-files.md

  • labels section: rewrote the note around the two exception states. Beyond the sentence the issue flagged, the premise it rested on was also stale: the note said omitting the labels key leaves existing labels intact. Since Enforce GitOps exceptions #42191, computeLabelChanges (cmd/fleetctl/fleetctl/gitops.go:947) branches on len(specifiedLabels) == 0, so omitting the key deletes every custom label in that scope unless the labels exception is enabled. Its own tests name this behavior ("labels omitted removes all regular labels when not excepted"). The note now spells out both states and fixes a label / labels typo.
  • gitops section: added a note that exceptions can't be set in YAML. Client.DoGitOps strips the exceptions key defensively (server/service/client.go:726), so this was worth stating explicitly.

articles/gitops-mode.md

  • Added an "Exceptions" section covering the three exception types, what an exception does to both the UI and fleetctl gitops, and the enroll secrets default. Upgrade behavior is left to the release notes. It notes that exceptions affect fleetctl gitops whether or not GitOps mode is on, since neither the apply-path check nor computeLabelChanges reads gitops_mode_enabled.
  • "Still available" no longer lists "Add and edit labels" unconditionally. It now points at the exceptions section for labels, software, and enroll secrets.

Behavior the docs now match:

  • UI gating is GitOpsModeTooltipWrapper with entityType="labels" (frontend/pages/labels/components/LabelForm/LabelForm.tsx:172, NewLabelPage.tsx:676, HostsFilterBlock.tsx:223). useGitOpsMode treats an enabled exception as GitOps mode being off for that entity.
  • Apply-path enforcement is in server/service/client.go:2219-2242 (premium only).
  • Defaults: server/fleet/app.go:1216 for new installs, migration 20260323144117_AddGitOpsExceptionsToAppConfig.go for upgrades.

The backend is unchanged and was already correct. ModifyLabel applies no GitOps check, and the per-host label endpoints stay available regardless of GitOps mode or exception state, so this PR is docs-only.

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    Not applicable: documentation-only change, no product behavior change.

Testing

  • QA'd all new/changed functionality manually
    Verified the described behavior against the UI gating, the fleetctl gitops apply path, and the exception defaults in code (references above).

Two pages stated that GitOps mode does not restrict label editing in the
UI. Since 4.84 that is only true when the labels exception is enabled.

Resolves #50551
Copilot AI lite review requested due to automatic review settings August 5, 2026 02:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Omitting the labels key deletes existing labels unless the labels
exception is enabled (see computeLabelChanges). The previous text said
omission preserved them, which stopped being true in #42191.
Copilot AI review requested due to automatic review settings August 5, 2026 02:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Copilot AI review requested due to automatic review settings August 5, 2026 02:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Copilot AI review requested due to automatic review settings August 5, 2026 02:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@kitzy
kitzy marked this pull request as ready for review August 5, 2026 02:30
@kitzy
kitzy requested a review from rachaelshaw as a code owner August 5, 2026 02:30
@rachaelshaw
rachaelshaw merged commit 5d8f7e2 into main Aug 6, 2026
11 checks passed
@rachaelshaw
rachaelshaw deleted the 50551-gitops-mode-labels-docs branch August 6, 2026 16:25
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.

Docs state GitOps mode does not restrict label editing in the UI, which is no longer true after 4.84

3 participants