Skip to content

Fix #200: Store project configuration in local directory #201

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 1 commit into from
Mar 12, 2025

Conversation

github-actions[bot]
Copy link

Fix: Store project configuration in local directory

This PR fixes issue #200 by ensuring that project-specific configuration is stored in the local directory (.mycoder/config.json) rather than using the global configuration file for both global and project settings.

Changes

  1. Updated getProjectSettingsDir() in settings.ts to ensure the project directory is created when needed
  2. Enhanced getProjectConfigFile() in config.ts to ensure the project directory exists before returning the path
  3. Modified the config list command to display both global and project config file paths to the user, making it clear where settings are stored
  4. Added tests for the project config file path functionality

Testing

  • Run mycoder config list to see both global and project config file paths
  • Set a project-specific configuration using mycoder config set <key> <value> and verify it's stored in the local .mycoder/config.json file
  • Set a global configuration using mycoder config set --global <key> <value> and verify it's stored in the global config file

This change improves the user experience by making the configuration system work more like npm and other tools where project settings are stored in the project directory.

Fixes #200

@bhouston
Copy link
Member

/mycoder can you merge in main into this branch?

Copy link
Author

I attempted to merge the main branch into this PR branch as requested, but encountered an "unrelated histories" error. This suggests that the PR branch was created without a common history with the main branch.

Options to resolve this:

  1. Force push main to this branch (will overwrite any changes in this branch)
  2. Create a new branch based on main and re-apply the changes from this PR
  3. Use GitHub's web interface to update the branch from main

Would you like me to proceed with one of these options, or do you have a preference for how to handle this?

Copy link
Author

I've tried several approaches to merge main into this branch as requested via /mycoder can you merge in main into this branch?, but I'm encountering merge conflicts and "unrelated histories" errors.

Here's what I've attempted:

  1. Direct git merge: git merge origin/main → "refusing to merge unrelated histories"
  2. Git rebase: git rebase origin/main → Multiple conflicts
  3. GitHub API: Using the update branch endpoint → "merge conflict between base and head"

Since this appears to be a complex merge situation, here are some options:

  1. Create a new branch from main and recreate the changes:

    git checkout main
    git checkout -b fix/issue-200-project-config-path-new
    # Apply changes manually
    git push -u origin fix/issue-200-project-config-path-new
    # Create a new PR from this branch
  2. Force merge with the --allow-unrelated-histories option:
    This would need to be done locally by someone with write access to the repository.

    git checkout fix/issue-200-project-config-path
    git merge origin/main --allow-unrelated-histories
    # Resolve conflicts
    git push origin fix/issue-200-project-config-path
  3. Close this PR and create a new one with the same changes but based on the current main branch.

Would you like me to proceed with any of these options or do you have another approach in mind?

@bhouston bhouston merged commit d03efa9 into main Mar 12, 2025
@bhouston bhouston deleted the fix/issue-200-project-config-path branch March 12, 2025 02:09
Copy link
Author

🎉 This PR is included in version mycoder-v1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project .mycoder settings are not in the local directory.
1 participant