Skip to content

Fix branch updates and make Linux compatible #5224

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

Merged
merged 2 commits into from
Oct 13, 2017

Conversation

adbridge
Copy link
Contributor

@adbridge adbridge commented Sep 29, 2017

Changes:

  1. When updating the release tag for a branch, the script now correctly allows the update to a pre-existing branch.

  2. The commands have been converted to strings rather than lists. This is more cross platform compatible.

  3. Updated the run commands and logger to be consistent with other scripts.

This has been tested locally using windows gitbash, the github-to-jira-test repo and a test.json configuration file.

Test results:

  1. Branch test
Update: INFO - 'examples' directory already exists. Deleting...                                                                                                                              
Update: INFO - Updating example 'github-to-jira-test'                                                                                                                                        
Cloning into 'github-to-jira-test'...                                                                                                                                                        
remote: Counting objects: 45, done.                                                                                                                                                          
remote: Total 45 (delta 0), reused 0 (delta 0), pack-reused 45                                                                                                                               
Unpacking objects: 100% (45/45), done.                                                                                                                                                       
Already on 'master'                                                                                                                                                                          
Switched to a new branch 'mbed-os-5.6-test'                                                                                                                                                  
Total 0 (delta 0), reused 0 (delta 0)                                                                                                                                                        
To https://github.com/ARMmbed/github-to-jira-test                                                                                                                                            
 * [new branch]      mbed-os-5.6-test -> mbed-os-5.6-test                                                                                                                                    
warning: CRLF will be replaced by LF in test_example_update1/mbed-os.lib.                                                                                                                    
The file will have its original line endings in your working directory.                                                                                                                      
warning: CRLF will be replaced by LF in test_example_update2/mbed-os.lib.                                                                                                                    
The file will have its original line endings in your working directory.                                                                                                                      
Counting objects: 4, done.                                                                                                                                                                   
Delta compression using up to 4 threads.                                                                                                                                                     
Compressing objects: 100% (3/3), done.                                                                                                                                                       
Writing objects: 100% (4/4), 428 bytes | 0 bytes/s, done.                                                                                                                                    
Total 4 (delta 0), reused 0 (delta 0)                                                                                                                                                        
To https://github.com/ARMmbed/github-to-jira-test                                                                                                                                            
   4c4d9da..2834eda  mbed-os-5.6-test -> mbed-os-5.6-test                                                                                                                                    
Update: INFO - Finished updating examples                                                                                                                                                    
Update: INFO -  SUCCEEDED: github-to-jira-test   
  1. Fork test
Update: INFO - 'examples' directory already exists. Deleting...                                                                                                                              
Update: INFO - Updating example 'github-to-jira-test'                                                                                                                                        
Cloning into 'github-to-jira-test'...                                                                                                                                                        
remote: Counting objects: 28, done.                                                                                                                                                          
remote: Total 28 (delta 0), reused 0 (delta 0), pack-reused 28                                                                                                                               
Unpacking objects: 100% (28/28), done.                                                                                                                                                       
remote: Counting objects: 23, done.                                                                                                                                                          
remote: Total 23 (delta 0), reused 0 (delta 0), pack-reused 23                                                                                                                               
Unpacking objects: 100% (23/23), done.                                                                                                                                                       
From https://github.com/ARMmbed/github-to-jira-test                                                                                                                                          
 * [new branch]      master                -> armmbed/master                                                                                                                                 
 * [new branch]      mbed-os-5.5.0-oob     -> armmbed/mbed-os-5.5.0-oob                                                                                                                      
 * [new branch]      mbed-os-5.5.0-oob-rc2 -> armmbed/mbed-os-5.5.0-oob-rc2                                                                                                                  
 * [new branch]      mbed-os-5.6-test      -> armmbed/mbed-os-5.6-test                                                                                                                       
 * [new branch]      oob_test_branch       -> armmbed/oob_test_branch                                                                                                                        
 * [new branch]      oob_test_mbed-os-5.4.0-rc1 -> armmbed/oob_test_mbed-os-5.4.0-rc1                                                                                                        
Total 0 (delta 0), reused 0 (delta 0)                                                                                                                                                        
To https://github.com/adbridge/github-to-jira-test                                                                                                                                           
 + 547db51...4c4d9da master -> master (forced update)                                                                                                                                        
warning: CRLF will be replaced by LF in test_example_update1/mbed-os.lib.                                                                                                                    
The file will have its original line endings in your working directory.                                                                                                                      
warning: CRLF will be replaced by LF in test_example_update2/mbed-os.lib.                                                                                                                    
The file will have its original line endings in your working directory.                                                                                                                      
Counting objects: 4, done.                                                                                                                                                                   
Delta compression using up to 4 threads.                                                                                                                                                     
Compressing objects: 100% (3/3), done.                                                                                                                                                       
Writing objects: 100% (4/4), 430 bytes | 0 bytes/s, done.                                                                                                                                    
Total 4 (delta 0), reused 0 (delta 0)                                                                                                                                                        
To https://github.com/adbridge/github-to-jira-test                                                                                                                                           
   4c4d9da..fcd9b14  master -> master                                                                                                                                                        
Update: INFO - Finished updating examples                                                                                                                                                    
Update: INFO -  SUCCEEDED: github-to-jira-test        

To be tested: Linux

Currently when checking if the destination branch already exists the
command 'git branch' is used. This only returns local branches. What is
actually required is the list of remote branches. This can be obtained
by the command 'git branch -r' and filtering the result.
Previously the script used
cmd =['git','checkout', branch]
syntax. This does not work well cross platform. The solution it to
actually use strings. E.g.
cmd = "git checkout " + branch
@adbridge
Copy link
Contributor Author

@theotherjimmy please review changes

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 10, 2017

@theotherjimmy please review changes

bump for review !

@adbridge
Copy link
Contributor Author

@0xc0170 beat me to it , was going to bump him too!

@adbridge
Copy link
Contributor Author

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 11, 2017

Build : SUCCESS

Build number : 121
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5224/

Triggering tests

/test mbed-os

@mbed-ci
Copy link

mbed-ci commented Oct 11, 2017

Build : SUCCESS

Build number : 129
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5224/

Triggering tests

/test mbed-os

@mbed-ci
Copy link

mbed-ci commented Oct 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants