Skip to content

Create ~/.fleet on first make serve#46521

Open
georgekarrv wants to merge 1 commit into
mainfrom
gkarr-fix-initial-make-serve
Open

Create ~/.fleet on first make serve#46521
georgekarrv wants to merge 1 commit into
mainfrom
gkarr-fix-initial-make-serve

Conversation

@georgekarrv
Copy link
Copy Markdown
Member

@georgekarrv georgekarrv commented May 30, 2026

Summary

  • make serve writes to ~/.fleet/last-serve-invocation in both branches of its main recipe (save-invocation when FORWARDED_ARGS is set, default-seed when it's empty), but neither branch creates the ~/.fleet directory first.
  • On a fresh machine the redirect fails with No such file or directory and the target aborts before ./build/fleet is ever invoked.
  • Adds a single mkdir -p ~/.fleet to the recipe so both branches have a directory to write into.

Test plan

  • On a machine without ~/.fleet, make serve previously failed with No such file or directory; with this patch it creates the directory, seeds the default invocation, and starts fleet.
  • On a machine with an existing ~/.fleet/last-serve-invocation, behavior is unchanged (mkdir -p is a no-op).

Follow-ups (not in this PR)

  • The RESET branch (make serve RESET=1, line 180) uses touch ~/.fleet/last-serve-invocation && rm ... which has the same gap on a fresh machine. Worth fixing in a follow-up if anyone hits it.
  • The SHOW branch (line 170) handles missing files via $? and gracefully no-ops, so it's fine.

Summary by CodeRabbit

  • Chores
    • Improved build process reliability by ensuring required directories are properly initialized.

Review Change Stack

`make serve` writes ./build/fleet's default invocation to
~/.fleet/last-serve-invocation, both when FORWARDED_ARGS is empty (the
default-invocation seed path) and when FORWARDED_ARGS is set (the
save-invocation path). Neither branch creates the ~/.fleet directory
first, so on a fresh machine the redirect fails with "No such file or
directory" and the target aborts before fleet ever starts.

Add `mkdir -p ~/.fleet` once at the top of the recipe so both branches
have a directory to write into.
Copilot AI review requested due to automatic review settings May 30, 2026 13:07
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes make serve startup on fresh machines by ensuring the ~/.fleet directory exists before the default serve recipe writes ~/.fleet/last-serve-invocation.

Changes:

  • Adds an idempotent mkdir -p ~/.fleet before the default serve branch writes or seeds the last invocation file.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

Walkthrough

The serve target in the Makefile now creates the ~/.fleet directory before using it to read and write the "last-serve-invocation" file. A mkdir -p ~/.fleet step is added to ensure the directory exists, preventing potential file system errors when the target runs for the first time.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides clear context (problem, solution, test plan, and follow-ups) but does not follow the repository's required template structure with its specific checklist items and sections. Restructure the description to match the required template, including relevant checklist items (e.g., changes files, testing, database migrations if applicable) and ensure all required sections are addressed or explicitly noted as N/A.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: creating ~/.fleet directory on first make serve invocation, which matches the single-line Makefile modification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gkarr-fix-initial-make-serve

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Makefile (1)

180-180: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

RESET branch has the same missing directory issue.

The RESET branch tries to touch ~/.fleet/last-serve-invocation without ensuring ~/.fleet exists, so it will fail with "No such file or directory" on a fresh machine (the same issue fixed by line 185 for the default branch).

🐛 Proposed fix
-	`@touch` ~/.fleet/last-serve-invocation && rm ~/.fleet/last-serve-invocation
+	`@mkdir` -p ~/.fleet && rm -f ~/.fleet/last-serve-invocation
🤖 Prompt for 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.

In `@Makefile` at line 180, The RESET branch's Makefile target runs the command
"`@touch` ~/.fleet/last-serve-invocation && rm ~/.fleet/last-serve-invocation"
without creating the parent directory; update that target (the line that
contains the touch/rm invocation) to ensure the ~/.fleet directory exists first
(e.g., run mkdir -p ~/.fleet or equivalent) before touching the file so the
touch won't fail on a fresh machine.
🤖 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.

Outside diff comments:
In `@Makefile`:
- Line 180: The RESET branch's Makefile target runs the command "`@touch`
~/.fleet/last-serve-invocation && rm ~/.fleet/last-serve-invocation" without
creating the parent directory; update that target (the line that contains the
touch/rm invocation) to ensure the ~/.fleet directory exists first (e.g., run
mkdir -p ~/.fleet or equivalent) before touching the file so the touch won't
fail on a fresh machine.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f7abb300-f477-4e98-a9c8-81fa12eb5322

📥 Commits

Reviewing files that changed from the base of the PR and between 1f934e1 and c8cdb4c.

📒 Files selected for processing (1)
  • Makefile

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