Skip to content
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

Include configuration for git mode in libms #952

Closed
prasadtalasila opened this issue Sep 30, 2024 · 10 comments · Fixed by #965
Closed

Include configuration for git mode in libms #952

prasadtalasila opened this issue Sep 30, 2024 · 10 comments · Fixed by #965
Assignees
Labels
enhancement New feature or request

Comments

@prasadtalasila
Copy link
Contributor

This issue is relates to discussion #951. In order to support these new features, the first step is to create a git mode for libms. We need to have a git configuration. This configuration can be specified in .env of libms as follows.

PORT='4001'
MODE='git'
LOCAL_PATH='/Users/<Username>/DTaaS/files'
LOG_LEVEL='debug'
APOLLO_PATH='/lib' or ''
GRAPHQL_PLAYGROUND='false' or 'true'
@prasadtalasila prasadtalasila added the enhancement New feature or request label Sep 30, 2024
@nichlaes
Copy link
Collaborator

nichlaes commented Oct 7, 2024

@prasadtalasila I think I need some more context for this issue. What are the goals/requirements?
Should it serve files from GIT?

@prasadtalasila
Copy link
Contributor Author

prasadtalasila commented Oct 7, 2024

@nichlaes Yes. To serve files over git without showing the .git files to users.

@nichlaes
Copy link
Collaborator

nichlaes commented Oct 9, 2024

Hi Prasad.

Can you add the link you used to show me an example of the the users on gitlab?

@prasadtalasila
Copy link
Contributor Author

please see gitlab.com

@nichlaes
Copy link
Collaborator

nichlaes commented Oct 9, 2024

Can you maybe elaborate on how you think it should be implemented.

Should it clone all the files to the local_path?
Do we need a extra env variable with token and repo name?
Whenever there is a change to a file, it should commit?

What is the overall goal of the feature? Just so I know what the implementation should solve.

@prasadtalasila
Copy link
Contributor Author

The scope of this issue is to just include MODE='git' in the .env file. We will deal with the token and repo name in the future PRs.

Including git mode will require adding scaffolding in the existing code base to support this git mode. The goal is to just have scaffolding now and add the actual git functionality later.

We used to have gitlab mode in libms wherein the gitlab is queried to fetch the files. This gitlab mode became non-functional due to upgrade of gitlab GraphQL API. The PR #435 has removed the gitlab mode. The changes made in that PR can show the scaffolding needed. Please use as an inspiration only; the design can perhaps be improved.

@prasadtalasila
Copy link
Contributor Author

The libms-gitlab-code commit contains the example code scaffolding for gitlab mode. We need similar one for git mode.

@nichlaes
Copy link
Collaborator

I should have pushed the necessary code now. Should I also update the docs/markdown files?

@nichlaes nichlaes linked a pull request Oct 10, 2024 that will close this issue
@prasadtalasila
Copy link
Contributor Author

Thanks for the update. The code structure looks similar to the one we had for gitlab mode. Please think about the design suggestion made on this discussion page. I am hoping that it would result in modular code. We can have the design discussion on the discussion page and only check the code implementation on this page.

In addition, please fix the failing tests and add tests for the git mode code as well. Thanks.

@prasadtalasila
Copy link
Contributor Author

@nichlaes This example provides a template for moving the MODE-based object creation from FilesServiceFactory class to files.module.ts. This move helps avoiding creating redundant objects (for example, creating LocalFileService object when using git mode).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants