Uploaded image for project: 'Apache IoTDB'
  1. Apache IoTDB
  2. IOTDB-1197

add iotdb-client-go as a submodule of iotdb repo

    XMLWordPrintableJSON

Details

    Description

      The discussion is on https://lists.apache.org/thread.html/r99e9b72e6f3779acb0888c3ad7acf56a54ffe230cea0ff4bdd6c88f3%40%3Cdev.iotdb.apache.org%3E

       

        1. How to get source codes of the submodule

      when you git clone or git pull the repo, the git command does not clone/pull codes in the submodules automatically;
      (1) for the first time, you need to run: cd client-go && git submodule update --init
      (2) for the 2nd time or the future usage, just run git submodule update to get latest codes of the submodule.

      Notice: when you pull the codes, the submodule is on an anonymous branch. you need to use `git checkout <existing branch>` or `git checkout -b <new branch>` in the client-go folder.

        1. How to modify codes of the submodule

      1. cd client-go, and do whatever you want to do, and then commit codes here by `git add`, `git commit` and `git push` command;
      2. cd iotdb's root folder, when you run `git status` at this time, you will find it shows `client-go` is modified, so just run `git add client-go` to let the parent repo knows the submodule's repo is updated.

      Notice, `git checkout` to a new/existing branch on client-go folder will be considered as a modification operation. And, if you want IoTDB repo knows you want to link a new branch of client-go to iotdb's repo, you can run `git checkout` command in client-go folder.

        1. Example

      Scenario:
      I want to modify the Thrift definition in IoTDB, and need to maintain the go client.

      Step 1: modify the thrift file and modify codes in IoTDB.
      Step 2: cd client-go, checkout to a new branch, modify codes..
      (Especially, the client-go has to copy generated thrift codes to client-go/rpc/, there are two choices to do that:
      a. run `mvn generate-sources` in iotdb's folder (not supported now in this PR. will do it later)
      b. cd client-go, run `make generate`
      )
      Step 3: in client-go, git add, git commit and git push
      Step 4: int IoTDB's root folder, git add, git commit and git push
      Step 5: submit a PR to IoTDB, and wait for the success of CI in IoTDB's repo;
      Step 6: If success, then submit a PR to iotdb-client-go repo, and paste the PR address in IoTDB. (The github action in iotdb-client-go will fail because it just clone codes of iotdb's master branch. However, our modifications of IoTDB are in another branch. So, we need the github action result in IoTDB to show the correction of the modifications in IoTDB-client-go).
      Step 7: After all reviewers approve the PRs in both IoTDB and IoTDB-client-go,
      Step 7.1. Merge PR in iotdb-client-go first, and
      Step 7.2. cd client-go folder, checkout back to the main branch (the iotdb-client-go repo uses `main` ratherthan `master`). Then git add, git commit and git push
      Step 7.3 After that, send notification on your PR and let others merge the PR in IoTDB

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hxd Xiangdong Huang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: