Skip to content

Make edit logging directories user-configurable #6497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 10, 2025

Conversation

adarshramiyer
Copy link
Collaborator

@adarshramiyer adarshramiyer commented Jul 7, 2025

Description

Instead of somewhat flaky and hardcoded repo detection, made edit-logging directories user-configurable via .editlogdirs file in global ~/.continue folder.

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Summary by cubic

Edit logging directories are now user-configurable using a .editlogdirs file in the global ~/.continue folder, replacing hardcoded repo detection.

  • Refactors
    • Logging only occurs for files in directories listed in .editlogdirs.
    • Updated logic to check directory membership before logging edits.

@adarshramiyer adarshramiyer requested a review from a team as a code owner July 7, 2025 21:45
@adarshramiyer adarshramiyer requested review from Patrick-Erichsen and removed request for a team July 7, 2025 21:45
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 7, 2025
Copy link

netlify bot commented Jul 7, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 7293b97
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/686f58622da29a000835c497

Copy link

github-actions bot commented Jul 8, 2025

⚠️ Conventional Commit Format

Your commit messages don't follow the conventional commit format, but this won't block your PR from being merged. We recommend downloading this extension if you are using VS Code.

Expected Format:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 8, 2025
@@ -132,6 +132,7 @@ export const processNextEditData = async ({
afterContent,
filePath,
DiffFormatType.Unified,
25, // 25 context lines; store a large number for trimming later on
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO this would be a good point to modify createDiff to instead take a single object as a param instead of n single arg params.

Then would you would have {..., contextLine: 25 } which reads much more easily.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

completed

ide: IDE,
) => {
// gets the workspace dir uri and checks if it's the open-source continue repo
const isFileWithinFolder = (fileUri: string, folderPath: string): boolean => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Feels like a quick unit test would be easy to one-shot here

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, the purpose of this is just to check if there is a .editlogdirs file? How are we doing this for the .staging/.local files? I'd think that logic already exists


const isEditLoggingAllowed = async (editedFileURI: string) => {
const globalContinuePath = getContinueGlobalPath();
const editLogDirsPath = resolve(globalContinuePath, ".editlogdirs");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we want to put this in core/util/paths.ts, we try to keep all the path logic centralized there

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

filepath logic is moved to core/util/paths.ts

diffType: DiffFormatType,
contextLines: number = 3,
) => {
export interface createDiffArgs {
Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen Jul 10, 2025

Choose a reason for hiding this comment

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

Super minor nitpick but interfaces in TypeScript should be in PascalCase, eg CreateDiffArgs

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Jul 10, 2025
@Patrick-Erichsen Patrick-Erichsen merged commit ae7a5a3 into main Jul 10, 2025
46 checks passed
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 10, 2025
@Patrick-Erichsen Patrick-Erichsen deleted the adarsh/feat/logging-control branch July 10, 2025 18:16
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Jul 10, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants