Skip to content

[Forked Extensions] Add repository cleanup action - #30138

Merged
raycastbot merged 2 commits into
raycast:mainfrom
TyceHerrman:forked-extensions-cleanup
Aug 12, 2026
Merged

[Forked Extensions] Add repository cleanup action#30138
raycastbot merged 2 commits into
raycast:mainfrom
TyceHerrman:forked-extensions-cleanup

Conversation

@TyceHerrman

@TyceHerrman TyceHerrman commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a repository-wide "Clean Up Repository" action to the existing Manage Forked Extensions action panel.

  • Shows the managed repository path and current pack statistics before confirmation
  • Runs git maintenance run --task=gc in the foreground without installing scheduled maintenance
  • Uses the existing operation lock while allowing dirty worktrees for cleanup only
  • Reports pack count, packed size, and reclaimed space after completion
  • Preserves Git's maintenance lock behavior and existing copyable error handling
  • Documents the action and adds focused tests for statistics parsing, formatting, and command sequencing

Screencast

Not included because this adds an action to an existing command rather than a new extension or command. The distribution build succeeds, but the final in-app distribution check remains pending because Raycast Beta could not be controlled or launched through the local test environment.

Validation

  • npm test
  • npm run lint
  • npm run build

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: forked-extensions Issues related to the forked-extensions extension platform: macOS platform: Windows labels Aug 11, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @LitoMore @pernielsentikaer @yusifaliyevpro @vensauro @j3lte you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="forked-extensions-cleanup"
FORK_URL="https://github.com/TyceHerrman/extensions.git"
EXTENSION_NAME="forked-extensions"
REPO_NAME="extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds a confirmed, repository-wide Git cleanup action with before-and-after pack statistics while preserving the existing operation lock and action order.

  • Adds foreground git maintenance run --task=gc execution and statistics parsing/formatting.
  • Integrates cleanup into both Manage Forked Extensions action panels.
  • Documents the cleanup workflow and updates extension metadata.

Confidence Score: 5/5

The PR appears safe to merge because the previously reported action-order issue has been fixed and no blocking failure remains.

The cleanup action is now appended after the established actions in both affected panels, so the prior workflow-order regression no longer exists.

Important Files Changed

Filename Overview
extensions/forked-extensions/src/manage-forked-extensions.tsx Appends the cleanup action after the existing actions in both panels, resolving the prior action-order finding.
extensions/forked-extensions/src/components/clean-up-repository.tsx Adds the confirmation UI and delegates confirmed cleanup through the existing operation layer.
extensions/forked-extensions/src/git.ts Adds repository validation, maintenance statistics collection, path consistency checking, and foreground cleanup execution.
extensions/forked-extensions/src/operation.ts Extends operation execution with optional clean-worktree enforcement and result-based completion messages.
extensions/forked-extensions/src/repository-maintenance.ts Adds strict parsing and user-facing formatting for Git object-store statistics.

Reviews (5): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile

Comment thread extensions/forked-extensions/src/manage-forked-extensions.tsx Outdated
@TyceHerrman
TyceHerrman force-pushed the forked-extensions-cleanup branch from b9a6d5a to e774b12 Compare August 11, 2026 15:04
@TyceHerrman
TyceHerrman marked this pull request as ready for review August 11, 2026 15:07

@LitoMore LitoMore 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.

Can you let your AI read through my entire source code and make the code style better fit my code structure? It looks like some Git-related operations were not added to git.ts.

In the meantime, please ask your AI to review the Windows platform as well. Thanks!

@LitoMore LitoMore Aug 11, 2026

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.

I don't write unit tests since Raycast does support programmatic testing. Please remove the unit test related code.

@TyceHerrman
TyceHerrman force-pushed the forked-extensions-cleanup branch from e774b12 to a60d087 Compare August 11, 2026 16:35
@TyceHerrman

Copy link
Copy Markdown
Contributor Author

@LitoMore I had codex review Windows compatibility. I don't have development enviro for raycast on windows set up for direct testing though. codex results:

  • git count-objects -v and git maintenance run --task=gc use the extension’s existing Windows-aware Git executor.
  • CRLF output is handled because parsed field names and values are trimmed.
  • Windows repository paths are passed unchanged to the process launcher.
  • The cleanup runs in the foreground and does not invoke a Unix-specific scheduler or background-maintenance mechanism.
  • If the installed Git version does not support maintenance, or the command otherwise fails, the existing subprocess error handling reports the failure normally.

lmk if you had something else in mind

@pernielsentikaer pernielsentikaer self-assigned this Aug 12, 2026
@pernielsentikaer

Copy link
Copy Markdown
Collaborator

Hey @LitoMore 👋

Just checking in on this one — HEAD was squashed to a60d087 after your earlier CHANGES_REQUESTED. From my pass the cleanup action looks solid (confirmations / Destructive styling / no rememberUserChoice / foreground GC only).

Are you happy for us to move forward, or do you still want changes first?

@LitoMore LitoMore 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.

LGTM. Thanks for contributing.

@raycast-extensions-bot raycast-extensions-bot Bot added the Approved Approved by a user label Aug 12, 2026
@0xdhrv 0xdhrv self-assigned this Aug 12, 2026

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, approved ✅

@raycastbot
raycastbot merged commit 8d213e6 into raycast:main Aug 12, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Published to the Raycast Store:
https://raycast.com/litomore/forked-extensions

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@TyceHerrman
TyceHerrman deleted the forked-extensions-cleanup branch August 12, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Approved by a user extension fix / improvement Label for PRs with extension's fix improvements extension: forked-extensions Issues related to the forked-extensions extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants