Prepare to archive fleet-gitops repo - #50134
Conversation
Remove references to the fleetdm/fleet-gitops repo ahead of archiving it (issue #40300) and point users to the fleetctl new scaffolding instead. - articles/managing-linux-desktops-with-gitops.md: replace the git clone walkthrough with fleetctl new; port the worked example from the old lib/ layout to the generated labels/ and platforms/ structure. - articles/setup-experience.md: retarget two repo links to the GitOps YAML docs. - tools/release/README.md: drop the step that PRs DEFAULT_FLEETCTL_VERSION into fleet-gitops; the fleetctl new scaffold auto-detects the version. - dogfood-gitops.yml: vendor the gitops-fleets composite action into .github/actions/gitops-fleets so dogfood no longer checks out fleet-gitops at runtime, matching the self-contained pattern fleetctl new ships.
| @@ -0,0 +1,92 @@ | |||
| name: fleetctl-gitops | |||
There was a problem hiding this comment.
Moving moving fleet-gitops repo.
| @@ -0,0 +1,59 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Moving moving fleet-gitops repo.
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
This PR prepares for archiving fleetdm/fleet-gitops by removing remaining references to that repo and making Fleet’s dogfood GitOps workflow self-contained within the monorepo, aligned with the fleetctl new scaffolding approach.
Changes:
- Remove release-process instructions that required updating
fleetdm/fleet-gitops. - Update the dogfood GitOps workflow to use a new in-repo composite action instead of checking out
fleetdm/fleet-gitops. - Add a vendored composite action (
.github/actions/gitops-fleets) and supporting script for runningfleetctl gitops.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/release/README.md | Removes the release step that referenced updating fleetdm/fleet-gitops. |
| .github/workflows/dogfood-gitops.yml | Stops checking out fleetdm/fleet-gitops and switches to the new local composite action. |
| .github/actions/gitops-fleets/action.yml | New composite action to install/configure fleetctl and run GitOps. |
| .github/actions/gitops-fleets/gitops-fleets.sh | New vendored GitOps runner script invoked by the composite action. |
| articles/setup-experience.md | Content excluded by policy (not reviewable here). |
| articles/managing-linux-desktops-with-gitops.md | Content excluded by policy (not reviewable here). |
Files excluded by content exclusion policy (2)
- articles/managing-linux-desktops-with-gitops.md
- articles/setup-experience.md
Comments suppressed due to low confidence (1)
.github/actions/gitops-fleets/action.yml:82
- Same issue as above for fleetctl config: a trailing comma/double comma in FLEET_CUSTOM_HEADERS produces an empty entry and will add
--custom-header "", which can causefleetctl config setto error. Skip empty header strings.
for _header in "${_CUSTOM_HEADERS[@]}"; do
CUSTOM_HEADER_ARGS+=(--custom-header "$_header")
done
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The -fleets suffix disambiguated it from a sibling action in the fleet-gitops repo; in the monorepo there's only one gitops action, so drop it. Script stays gitops-fleets.sh to signal the fleets-based flavor.
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 4 out of 6 changed files in this pull request and generated no new comments.
Files excluded by content exclusion policy (2)
- articles/managing-linux-desktops-with-gitops.md
- articles/setup-experience.md
Comments suppressed due to low confidence (1)
.github/actions/gitops/action.yml:45
- The
curlthat fetches the Fleet server version uses--silentwithout--show-error, so if the request fails the logs can be opaque (often just an exit code with no HTTP/body context). Adding--show-errorkeeps output quiet on success but surfaces useful errors on failure.
FLEET_VERSION="$(curl "$FLEET_URL/api/v1/fleet/version" --header "Authorization: Bearer $FLEET_API_TOKEN" "${CURL_HEADER_ARGS[@]}" --fail --silent | jq --raw-output '.version')"
The -fleets suffix only disambiguated from the teams-era gitops.sh in the fleet-gitops repo. Nothing to disambiguate from in the monorepo.
| @@ -0,0 +1,59 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
Moving from fleet-gitops.
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 4 out of 6 changed files in this pull request and generated no new comments.
Files excluded by content exclusion policy (2)
- articles/managing-linux-desktops-with-gitops.md
- articles/setup-experience.md
Comments suppressed due to low confidence (4)
.github/actions/gitops/action.yml:46
- This step doesn’t validate that required env vars (FLEET_URL, FLEET_API_TOKEN) are set, and curl runs with --silent --fail, which can make failures hard to diagnose. Also jq can return "null", which currently gets treated like a real version string. Add explicit required-var checks, use --show-error, and normalize "null" to empty before version selection.
FLEET_URL="${FLEET_URL%/}"
# Build optional custom request headers from FLEET_CUSTOM_HEADERS, a comma-separated
# list of "Header:Value" pairs (e.g. a Cloudflare Access service token). Empty by default.
CURL_HEADER_ARGS=()
if [[ -n "${FLEET_CUSTOM_HEADERS:-}" ]]; then
IFS=',' read -ra _CUSTOM_HEADERS <<< "$FLEET_CUSTOM_HEADERS"
for _header in "${_CUSTOM_HEADERS[@]}"; do
CURL_HEADER_ARGS+=(--header "$_header")
done
fi
FLEET_VERSION="$(curl "$FLEET_URL/api/v1/fleet/version" --header "Authorization: Bearer $FLEET_API_TOKEN" "${CURL_HEADER_ARGS[@]}" --fail --silent | jq --raw-output '.version')"
DEFAULT_FLEETCTL_VERSION="latest"
.github/actions/gitops/gitops.sh:59
$FLEETCTLis executed unquoted, which can break if FLEETCTL is set to a path containing spaces or includes extra flags. Quote it to avoid word-splitting and globbing issues.
# Dry run
$FLEETCTL gitops "${args[@]}" --dry-run
if [ "$FLEET_DRY_RUN_ONLY" = true ]; then
exit 0
fi
# Real run
$FLEETCTL gitops "${args[@]}"
.github/actions/gitops/gitops.sh:22
- If default.yml exists but doesn’t contain org_settings, the script will exit due to
set -ewith a generic grep failure and no clear explanation. Wrap the grep in an explicit check and print a helpful error before exiting.
# Check for existence of the global file in case the script is used
# on repositories with fleet only yamls.
if [ -f "$FLEET_GLOBAL_FILE" ]; then
# Validate that global file contains org_settings
grep -Exq "^org_settings:.*" "$FLEET_GLOBAL_FILE"
else
.github/actions/gitops/action.yml:85
- FLEET_URL is trimmed in the install step, but that change won’t persist to this later step (each composite step runs in a separate shell). This makes URL normalization inconsistent between version detection and fleetctl configuration. Normalize (and validate) FLEET_URL again here (or export it via GITHUB_ENV in the prior step) so both steps use the same value.
- name: Configure fleetctl
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
# Build optional custom request headers from FLEET_CUSTOM_HEADERS, a comma-separated
# list of "Header:Value" pairs. fleetctl persists them and sends them on every request,
# so the gitops commands below use them too.
CUSTOM_HEADER_ARGS=()
if [[ -n "${FLEET_CUSTOM_HEADERS:-}" ]]; then
IFS=',' read -ra _CUSTOM_HEADERS <<< "$FLEET_CUSTOM_HEADERS"
for _header in "${_CUSTOM_HEADERS[@]}"; do
CUSTOM_HEADER_ARGS+=(--custom-header "$_header")
done
fi
fleetctl config set --address "$FLEET_URL" --token "$FLEET_API_TOKEN" "${CUSTOM_HEADER_ARGS[@]}"
|
@coderabbitai full review |
✅ Action performedFull review finished. |
WalkthroughAdds a local Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/actions/gitops/action.yml:
- Line 45: Update the Fleet version request in the FLEET_VERSION assignment to
add explicit curl connection and total time limits, such as --connect-timeout
and --max-time. Preserve the existing authorization headers, silent/fail
behavior, jq parsing, and command substitution.
- Around line 67-68: Update the fleetctl installation command in the GitOps
action to install only the requested $INSTALL_VERSION and propagate any
installation failure. Remove the fallback to fleetctl@latest so the action fails
when the selected version cannot be installed.
In @.github/actions/gitops/gitops.sh:
- Around line 32-36: Update the duplicate-name validation in the fleet-file
conditional to use an explicit conditional around the Perl/sort/uniq pipeline,
rather than relying on the negated pipeline expression. Ensure the
duplicate-name case is detected and handled before the script continues building
args or invoking fleetctl, while preserving the existing behavior when names are
unique.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 378f6aec-d3a5-426b-a19b-cb4706abd1c6
⛔ Files ignored due to path filters (3)
articles/managing-linux-desktops-with-gitops.mdis excluded by!**/*.mdarticles/setup-experience.mdis excluded by!**/*.mdtools/release/README.mdis excluded by!**/*.md
📒 Files selected for processing (3)
.github/actions/gitops/action.yml.github/actions/gitops/gitops.sh.github/workflows/dogfood-gitops.yml
Related issue: #40300
What & why
Removes references to the
fleetdm/fleet-gitopsrepo ahead of archiving it (#40300), and points users at thefleetctl newscaffolding, which is now the recommended way to start a Fleet GitOps repository.articles/managing-linux-desktops-with-gitops.md: replace thegit clone fleet-gitopswalkthrough withfleetctl new, and port the worked example from the oldlib/layout to the structurefleetctl newgenerates (labels/,platforms/linux/…).articles/setup-experience.md: retarget two "GitOps workflow" links from the repo to the GitOps YAML docs.tools/release/README.md: drop the release step that opens a PR to bumpDEFAULT_FLEETCTL_VERSIONin fleet-gitops. Thefleetctl newscaffold auto-detects the version from the server, so nothing replaces it..github/workflows/dogfood-gitops.yml+.github/actions/gitops-fleets/(new): vendor thegitops-fleetscomposite action + script into the monorepo so dogfood no longer checks outfleetdm/fleet-gitopsat runtime. This brings Fleet's own pipeline onto the same self-contained patternfleetctl newships to everyone else.This PR is one of two: the companion PR in
fleetdm/fleet-gitopsadds a deprecation banner to that repo's README. The repo can be archived once both merge.Deferred follow-ups (not required for archiving, since an archived repo stays cloneable; these are the gate before eventual deletion): decouple the two
cmd/fleetctl/integrationtest/gitopstests from the live clone, retire the Renderfleet-gitops-ci-*services +render-deploy.ymlreferences, and sweep for publicuses: fleetdm/fleet-gitopsconsumers.Checklist for submitter
gitops-fleets.shis a verbatim copy of the existing production script.Testing
Summary by CodeRabbit
fleetctl, then apply Fleet GitOps configuration.