Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Children Display
Table of Contents

Steps to raise review in CMF gerrit(Ex:meta-cmf-raspberrypi)

Step 1:  Sign in the CMF gerrit (https://code.rdkcentral.com/r/q/status:open) and Go to below link for repo selection,

https://code.rdkcentral.com/r/admin/repos  and enter the repo name (For example: meta-cmf-raspberrypi) in filter search box .

...

Code Block
languagebash
themeDJango
titleCommit Format
<Project-Ticket-NO> : <summary of the ticket>
<blank line>
Reason for change: <add the reason why you are committing these changes>
Test Procedure: < Test steps>
Risks: <may be Low/Medium/High - based on your changes impact>

For Example,
REFPLTB-910915 : RPI-B Hostapd not starting on rdk-next with with change 50825Sometimes, WebUI login is failing in dunfell builds

Reason for change: Issue fixed
Test Procedure: HostapdTested processwith islocal runningbuild
Risks: Low

To exit the nano editor prompt . Need to follow the below steps,

  • ctrl + x
  • shift + y
  • click the enter button

Then , check the status of your commit

Code Block
languagebash
themeDJango
titleGit Push
$ git status
On branch rdk-next
Your branch is ahead of 'origin/rdk-next' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Step 10:  Push the code changes in CMF gerrit by using "git push " command.

Code Block
languagebash
themeDJango
titleGit Push
$ git push origin HEAD:refs/for/<branch-name>

For example,
git push origin HEAD:refs/for/rdk-next
Enumerating objects: 2511, done.
Counting objects: 100% (2511/2511), done.
Delta compression using up to 416 threads
Compressing objects: 100% (146/146), done.
Writing objects: 100% (146/146), 3.28640 KiBbytes | 1640.6400 MiBKiB/s, done.
Total 146 (delta 85), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (85/85)
remote: Processing changes: refs: 1, new: 1, done    
remote: commit 9cd2f9399b6d76: warning: subject >50 characters; use shorter first paragraph
remote: 
remote: SUCCESS
remote: 
remote: New Changes:
remote:   https://code.rdkcentral.com/r/admin/reposc/components/generic/rdk-oe/meta-cmf-raspberrypi/+/5101451157 REFPLTB-910915 : ... Sometimes, WebUI login is failing in dunfell builds
To https://code.rdkcentral.com/r/admin/repos/components/generic/rdk-oe/meta-cmf-raspberrypi
 * [new branch]      HEAD -> refs/for/rdk-next


Step 11:  Click the link from git push  success status(remote: https://code.rdkcentral.com/r/c/components/generic/rdk-oe/meta-cmf-raspberrypi/+/51157) to verify whether your code changes are successfully pushed or not in CMF gerrit.

Image Added




Steps to Modify the committed code changes in gerrit

Approach 1 

                       If we have committed code changes repo folder in your local terminal then go for this approach.

Step 1 :  Go to the committed code changes repo folder path in your local terminal . Rework the code changes

Step 2 :  Using "git status" command to verify re-worked files(It shown as RED color in below screenshot).

Image Added

Step 3: Add the Re-Worked files to git by using "git add" command.

Code Block
languagebash
themeDJango
$ git add <path_of_file> 

For example,
 git add recipes-ccsp/util/utopia/system_defaults


Step 4:
 Using "git status" command to verify  the  current code changes(whether it's successfully added or not). It shown as GREEN color in below screenshot

Image Added


Step 5: Commit the changes by using below command,


Code Block
languagebash
themeDJango
$ git commit --amend


Step 6: Push the code changes to CMF Gerrit

Code Block
languagebash
themeDJango
$ git push origin HEAD:refs/for/<branch-name>


Step 7:  Follow the Step 11 in Steps to raise review in CMF gerrit.

Approach 2 

                 If we don't have the commited code changes repo folder in your local terminal then go for this approach,

Step 1 : Follow the same 4 steps in Steps to raise review in CMF gerrit.

Step 2:  Just go to  committed  code changes link in code.rdkcentral.com then click the EDIT option in right side of the UI page. Then select the "Download Patch" option from EDIT. It shown as below screenshot,

Image Added




Step 3: Then click the cherry-pick option like below

Image Added


Step 4 :  Run this cherry-pick command in cloned repo(step1),


Code Block
languagebash
themeDJango
titlecherry-pick
$ git fetch "https://code.rdkcentral.com/r/components/generic/rdk-oe/meta-cmf-raspberrypi" refs/changes/57/51157/1 && git cherry-pick FETCH_HEAD

remote: Counting objects: 473, done
remote: Finding sources: 100% (6/6)
remote: Total 6 (delta 5), reused 6 (delta 5)
Unpacking objects: 100% (6/6), done.
From https://code.rdkcentral.com/r/components/generic/rdk-oe/meta-cmf-raspberrypi
 * branch            refs/changes/57/51157/1 -> FETCH_HEAD
[rdk-next 09912ac] REFPLTB-915 : Sometimes, WebUI login is failing in dunfell builds
 Date: Fri Jan 22 12:57:53 2021 +0000
 1 file changed, 1 insertion(+), 1 deletion(-)


Step 5 :  Using "git status" command to verify re-worked files(It shown as RED color in below screenshot).

Image Added

Step 6: Add the Re-Worked files to git by using "git add" command.

Code Block
languagebash
themeDJango
$ git add <path_of_file> 

For example,
 git add recipes-ccsp/util/utopia/system_defaults


Step 7:
 Using "git status" command to verify  the  current code changes(whether it's successfully added or not). It shown as GREEN color in below screenshot

Image Added


Step 8: Commit the changes by using below command,


Code Block
languagebash
themeDJango
$ git commit --amend


Step 9: Push the code changes to CMF Gerrit

Code Block
languagebash
themeDJango
$ git push origin HEAD:refs/for/<branch-name>


Step 10:  Follow the Step 11 in Steps to raise review in CMF gerrit.


Steps to raise review in github repositories

Step1: Forking the github repo from base repository

Login to the github account and search for the repository (For example, rdkcentral/meta-turris). Then fork the Base repository to create Head repository for the user

Image Added



Once you click on fork, below screenshot will be received. Now from the 'code' button copy the URL

Image Added

 


Step2: Clone the Head repository from github

Code Block
languagebash
themeDJango
$ git clone <github_url>
  Example,
  git clone https://github.com/KaviyaKumaresan/meta-turris.git
 
$ cd meta-turris


Step3: One approach is creating a temporary/topic branch for pushing the code

Code Block
languagebash
themeDJango
$ git checkout -b <topic_branch_name>
  Example,
  git checkout -b demo


Step4: Fetch all the updates into the topic branch to be in tip of Base repository

Code Block
languagebash
themeDJango
$ git remote add upstream https://github.com/rdkcentral/meta-turris
 
$ git remote -v
 
$ git fetch
 
$ git pull upstream master


Step5: Make changes in local github repository and can verify with "git status" command

Code Block
languagebash
themeDJango
$ git status 
 
On branch demo
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   recipes-rdkb/sysint-broadband/files/sysint-broadband.bbappend
no changes added to commit (use "git add" and/or "git commit -a")


Step6: Add required list of files where changes are done

Code Block
languagebash
themeDJango
$ git add <path_of_file_changes_done>
   
  Example,
  git add recipes-rdkb/sysint-broadband/sysint-broadband.bbappend


Step7: Give a commit message

Code Block
languagebash
themeDJango
$ git commit -sv


Step8:
Push the changes

Code Block
languagebash
themeDJango
$ git push origin <topic_branch_name>
  Example,
  git push origin demo


Need to type in Username(github handle) and Password(Github Access Token). NOTE: User need to create new Github Access token

Code Block
languagebash
themeDJango
Example,
Username for 'https://github.com': KaviyaKumaresan
Password for 'https://KaviyaKumaresan@github.com':
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 453 bytes | 0 bytes/s, done.
Total 5 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
remote:
remote: Create a pull request for 'demo' on GitHub by visiting:
remote: https://github.com/KaviyaKumaresan/meta-turris/pull/new/demo
remote:
To https://github.com/Kaviyakumaresan/meta-turris.git

Creating Pull Request

1. Once after pushing the commit into Head repository, visit the URL generated,

 Example,

 https://github.com/KaviyaKumaresan/meta-turris/pull/new/demo


With the link, you will find the below screenshot

Image Added

Click on the 'Create pull request' to generate Pull Request.


Example, PR created,

Image Added