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

[IOTDB-1197] add iotdb-client-go as a git submodule of IoTDB repo #2792

Merged
merged 25 commits into from
Apr 1, 2021

Conversation

jixuan1989
Copy link
Member

@jixuan1989 jixuan1989 commented Mar 9, 2021

From this PR on, the IoTDB-client-go will be as a git submodule of IoTDB repo.
( apache/iotdb-client-go#17 is sychned with this pr.)

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.

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.

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

@jixuan1989 jixuan1989 changed the title add iotdb-client-go as a git submodule of IoTDB repo [IOTDB-1197] add iotdb-client-go as a git submodule of IoTDB repo Mar 10, 2021
@jixuan1989 jixuan1989 marked this pull request as ready for review March 10, 2021 11:11
@jixuan1989 jixuan1989 mentioned this pull request Mar 16, 2021
11 tasks
@sonarcloud
Copy link

sonarcloud bot commented Apr 1, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@jixuan1989 jixuan1989 merged commit fa5aafa into master Apr 1, 2021
@jixuan1989 jixuan1989 deleted the gitsubmodule2 branch April 1, 2021 08:20
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.

None yet

2 participants