daviewer / backend

0 stars 0 forks source link

[ISSUE] Vue 변경으로 인한 문제점 #2

Open myeongju-kim opened 4 days ago

myeongju-kim commented 4 days ago

문제상황) Vue로 변경하게 되면 기존 front에서 진행하는 git clone, git diff file 추출(exec)하는 로직의 경우 Node.js로 진행하는 서버 작업이므로 Spring 서버로 옮겨야 된다고 생각

그러나 문제가 있음 1. local repo upload image Upload 방식의 경우 diff branch를 제공 후, 사용자가 선택하여 서버에 전송하게 되면 어떤 git repo의 diff branch인지 알 수 없음

해결하기 위해서는 임시로 .git repo를 저장해야함..

2. repository uri 제공 image 이렇게 하면 가능하기는 하지만..

myeongju-kim commented 4 days ago

@junghun133 선임님 어떻게 하면 좋을까요???

  1. Vue.js에 node 설치해서 as-is 로직 그대로 따라간다
  2. 기존 as-is를 계속 쓴다.
  3. uri 제공 방식으로 변경한다.

요정도로 고민하고 있습니다 ㅜ

junghun133 commented 4 days ago

처음 문제점에 git clone, git diff file 추출(exec)하는 로직의 경우 Node.js로 진행하는 서버 작업 이 부분이 이해가 안돼요...ㅠㅠ vuetify 적용된 vue.js 에 electron 추가해서 빌드된 exe 파일만 실행하면 되는거 아닌가요?!

myeongju-kim commented 4 days ago
const { exec } = require('child_process');

function fetchBranches(projectPath) {
    return new Promise((resolve, reject) => {
        exec(`git -C ${projectPath} branch -a`, (error, stdout, stderr) => {
...
            }
        });
    });
}

as-is에서 요 코드여!! 이 child_process 사실은 node.js (https://nodejs.org/api/child_process.html) 에 내장되어 있는 기능이라, 서버가 두 대인 느낌입니다 (node.js, spring)

junghun133 commented 3 days ago

require('child_process'); 이 구문이 node 서버가 실행되는게 아니라 외부 프로세스를 실행하는 node 런타임의 모듈을 사용하는 거라 서버가 구동되는건 아닌 것 같아서요

image

myeongju-kim commented 3 days ago

앗 그렇네요!! npm install 해보겠읍니당