Gerrit Review

환경 설정

Git review를 설치해준다.

sudo apt-get update && sudo apt-get install git git-review

Git config 설정을 해주고,

git config --global user.name "<NAME>"
git config --global user.email "<EMAIL>"

Gerrit에 접속하기 위해 SSH key를 생성해준다.

ssh-keygen -t rsa -b 4096 -C "<EMAIL>"

~/.ssh에 생성된 id_rsa.pub를 복사하여 Gerrit에 등록해준다.

Gerrit에 접속해 ssh key가 등록되었는지 확인해준다.

ssh -p 29418 <USERNAME>@gerrit.o-ran-sc.org

Gerrit Review

  1. Jira에 이슈를 등록한다.

    https://lf-o-ran-sc.atlassian.net/jira/software/c/projects/AIMLFW/issues/

  2. 이슈 관련 리포지토리를 클론한다.

  3. git review -s

    • 출력 예시

        Creating a git remote called 'gerrit' that maps to:
            ssh://sdin99@gerrit.o-ran-sc.org:29418/aiml-fw/athp/sdk/feature-store
      
  4. 코드 수정

  5. git add <FILE>

    git add를 통해 수정한 파일을 스테이징한다. 이 때 git add . 사용은 권장하지 않는다.

  6. git commit -s

    -s 옵션은 Signed-off-by를 추가해준다. Signed-off-by가 정상적으로 추가되었으면 Ctrl + X를 눌러서 나온다.

    • 출력 예시

        [master db2e06d] Change-Id: Ibe8887c1b52c701112ed52093048cc04a75ca1a4 Signed-off-by: Sungjin Lee <sodyn99@gmail.com>
        1 file changed, 7 insertions(+), 1 deletion(-)
      
  7. git commit --amend

    본격적으로 커밋 메시지를 작성한다. 커밋 메시지는 아래와 같은 형식으로 작성한다.

     <COMMIT SUMMARY>
    
     - <DETAIL 1>
     - <DETAIL 2>
     - ...
    
     ISSUE-ID: AIMLFW-<ISSUE-NUMBER>
    
     Change-Id: I<CHANGE-ID>
     Signed-off-by: <NAME> <EMAIL>
    
  8. git log -p

    커밋 메시지가 정상적으로 작성되었는지 확인한다.

    • 출력 예시

        Author: Sungjin Lee <sodyn99@gmail.com>
        Date:   Fri Aug 30 11:29:38 2024 +0000
      
            Sort the Cassandra data to retrieve the data in the correct order.
      
            - Data sorting by '__Id' added to the get_features() function
      
            Issue-ID: AIMLFW-148
      
            Change-Id: Ibe8887c1b52c701112ed52093048cc04a75ca1a4
            Signed-off-by: Sungjin Lee <sodyn99@gmail.com>
      
        diff --git a/featurestoresdk/feature_store_sdk.py b/featurestoresdk/feature_store_sdk.py
        index a834cff..22a681e 100644
      
  9. git review

    • 출력 예시

        remote:
        remote: Processing changes: refs: 1, new: 1
        remote: Processing changes: refs: 1, new: 1, done
        remote: commit 90369c9: warning: subject >50 characters; use shorter first paragraph
        remote:
        remote: SUCCESS
        remote:
        remote:   https://gerrit.o-ran-sc.org/r/c/aiml-fw/athp/sdk/feature-store/+/13287 Sort the Cassandra data to retrieve the data in the correct order. [NEW]
        remote:
        To ssh://gerrit.o-ran-sc.org:29418/aiml-fw/athp/sdk/feature-store
        * [new reference]   HEAD -> refs/for/master
      
Debug Pod 생성하기
Cassandra 데이터 정렬 문제 - 1