Skip to content

Conversation

hongfeiyang
Copy link
Contributor

Overview

This pull request resolves a circular dependency issue by relocating the MCP server creation logic from index.ts to mcp-server.ts. The circular dependency was occurring because index.ts was exporting the server creation function while also importing from mcp-server.ts, and mcp-server.ts was importing from index.ts.

Changes

  • Moved the createMCPServer() function from src/index.ts to src/mcp/mcp-server.ts
  • Relocated related imports (IDBManager, NLParser, MCPOrchestrator) to avoid circular references

Technical Details

Before this change, we had a circular dependency where:

  • index.ts was exporting createMCPServer() but importing mcpServer from mcp-server.ts
  • mcp-server.ts was importing createMCPServer() from index.ts

This circular dependency caused initialisation issues and was addressed by:

  1. Moving the server creation logic to the file where it's directly used
  2. Ensuring proper imports in each file
  3. Maintaining the same public API

@arturonaredo
Copy link
Collaborator

Thanks @hongfeiyang ! Let me give it a try tomorrow morning.

@jorgeteixe
Copy link
Member

Hi @hongfeiyang,

This is a reminder that, as stated in our CONTRIBUTING guide, all contributions to any @InditexTech repositories require signing our Contributor License Agreement (CLA) first. Here you can find the Contributor License Agreement and a detailed guide on how to proceed.

Please note that this is a prerequisite for contributions, and any contributions will be blocked until the CLA is signed.

Thank you for your understanding and cooperation.

@jorgeteixe
Copy link
Member

Hi @hongfeiyang,

First of all, sorry for the delay in the response. I can confirm that the CLA has been signed, and this PR is no longer blocked.

Thank you for your patience and contribution. It is now in @arturonaredo's hands to approve.

@arturonaredo arturonaredo self-requested a review April 21, 2025 11:20
arturonaredo
arturonaredo previously approved these changes Apr 21, 2025
@arturonaredo
Copy link
Collaborator

Sorry @hongfeiyang , last thing I promise... you need to verify your commits. Here is how:

✅ How to Sign and Re-sign Commits for GitHub (GPG)


1. Generate a GPG Key

If you don’t already have a GPG key:

gpg --full-generate-key
  • Select RSA and RSA
  • Key size: 4096
  • Expiration: your choice
  • Enter your name and the same email you use on GitHub

2. Find Your GPG Key ID

gpg --list-secret-keys --keyid-format=long

Example output:

/Users/you/.gnupg/secring.gpg
------------------------------------
sec   rsa4096/ABCD1234EFGH5678 2025-04-21 [SC]

Copy the part after rsa4096/ — that’s your GPG key ID.


3. Tell Git to Use That Key

git config --global user.signingkey ABCD1234EFGH5678
git config --global commit.gpgsign true

4. Add Your Public Key to GitHub

Export your public key:

gpg --armor --export ABCD1234EFGH5678

Copy the full output and go to:

👉 GitHub > Settings > SSH and GPG keys > New GPG key

Paste it and save.


5. Re-sign Specific Commits

To re-sign the two commits:

git rebase --exec 'git commit --amend --no-edit -S' -i a65b492ccc090b5351b2bdb605a1be910b4d17bd~1

When the editor opens, leave both commits as pick, then save and close.

Git will re-sign them using your GPG key.


6. Force Push the Signed Commits

git push --force-with-lease

After pushing, GitHub will show a "Verified" badge next to each commit. ✅ . We will be able to merge your PR.

Copy link

@hongfeiyang
Copy link
Contributor Author

Sorry @hongfeiyang , last thing I promise... you need to verify your commits. Here is how:

✅ How to Sign and Re-sign Commits for GitHub (GPG)

1. Generate a GPG Key

If you don’t already have a GPG key:

gpg --full-generate-key
  • Select RSA and RSA
  • Key size: 4096
  • Expiration: your choice
  • Enter your name and the same email you use on GitHub

2. Find Your GPG Key ID

gpg --list-secret-keys --keyid-format=long

Example output:

/Users/you/.gnupg/secring.gpg
------------------------------------
sec   rsa4096/ABCD1234EFGH5678 2025-04-21 [SC]

Copy the part after rsa4096/ — that’s your GPG key ID.

3. Tell Git to Use That Key

git config --global user.signingkey ABCD1234EFGH5678
git config --global commit.gpgsign true

4. Add Your Public Key to GitHub

Export your public key:

gpg --armor --export ABCD1234EFGH5678

Copy the full output and go to:

👉 GitHub > Settings > SSH and GPG keys > New GPG key

Paste it and save.

5. Re-sign Specific Commits

To re-sign the two commits:

git rebase --exec 'git commit --amend --no-edit -S' -i a65b492ccc090b5351b2bdb605a1be910b4d17bd~1

When the editor opens, leave both commits as pick, then save and close.

Git will re-sign them using your GPG key.

6. Force Push the Signed Commits

git push --force-with-lease

After pushing, GitHub will show a "Verified" badge next to each commit. ✅ . We will be able to merge your PR.

Ok done thanks for the guidance

@arturonaredo arturonaredo merged commit 988116e into InditexTech:main Apr 25, 2025
5 checks passed
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.

3 participants