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

Improve importer.py #10505

Merged
merged 13 commits into from May 13, 2019

Conversation

Projects
None yet
7 participants
@orenc17
Copy link
Contributor

commented Apr 28, 2019

Description

Improve python logic and fix an issue when multiple cherry-pick messages has been added

Pull request type

[ ] Fix
[X] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@ARMmbed/mbed-os-tools @alzix

Release Notes

@ciarmcom ciarmcom requested review from alzix and ARMmbed/mbed-os-maintainers Apr 28, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented Apr 28, 2019

@orenc17, thank you for your changes.
@alzix @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

@orenc17 orenc17 force-pushed the orenc17:imporve_importer branch from 2659a4f to e15068d Apr 28, 2019

@alzix

alzix approved these changes Apr 28, 2019

Copy link
Contributor

left a comment

LGTM

@@ -148,10 +153,14 @@ def get_last_cherry_pick_sha(branch):
lines = output.split('\n')
for line in lines:
if 'cherry picked from' in line:
sha = line.split(' ')[-1]
return sha[:-1]
sha = line.split(' ')[-1][:-1]

This comment has been minimized.

Copy link
@alzix

alzix Apr 28, 2019

Contributor
Suggested change
sha = line.split(' ')[-1][:-1]
# take the last line - git cherry-pick can add this line more
# than once if used multiple times
sha = line.split(' ')[-1][:-1]

This comment has been minimized.

Copy link
@orenc17

orenc17 Apr 28, 2019

Author Contributor

switched to regex

This comment has been minimized.

Copy link
@alzix

alzix Apr 29, 2019

Contributor

ok

# Set logging level
logging.basicConfig(level=level)
rel_log = logging.getLogger("Importer")

if (args.repo_path is None) or (args.config_file is None):
rel_log.error("Repository path and config file required as input. Use \"--help\" for more info.")
exit(1)
rel_log.error(

This comment has been minimized.

Copy link
@alzix

alzix Apr 28, 2019

Contributor

this can be replaced by required=True in parser

This comment has been minimized.

Copy link
@alzix

alzix Apr 29, 2019

Contributor

ok


repo = abspath(args.repo_path)
if not os.path.exists(repo):
rel_log.error("%s not found.", args.repo_path)
exit(1)
sys.exit(1)

This comment has been minimized.

Copy link
@alzix

alzix Apr 28, 2019

Contributor

use parser.error or add an action to validate it in the parser

This comment has been minimized.

Copy link
@alzix

alzix Apr 29, 2019

Contributor

ok


json_file = abspath(args.config_file)
if not os.path.isfile(json_file):
rel_log.error("%s not found.", args.config_file)
exit(1)
sys.exit(1)

This comment has been minimized.

Copy link
@alzix

alzix Apr 28, 2019

Contributor

use parser.error or add an action to validate it in the parser

This comment has been minimized.

Copy link
@alzix

alzix Apr 29, 2019

Contributor

ok

Show resolved Hide resolved tools/importer/importer.py Outdated
@alzix
Copy link
Contributor

left a comment

see above

orenc17 added some commits Apr 28, 2019

@0xc0170 0xc0170 changed the title Imporve importer.py Improve importer.py Apr 29, 2019

@orenc17 orenc17 force-pushed the orenc17:imporve_importer branch from 744212c to d1fa7bd Apr 29, 2019

@bridadan
Copy link
Contributor

left a comment

Nice clean up!

@alzix

alzix approved these changes Apr 29, 2019

Copy link
Contributor

left a comment

lgtm

@0xc0170

0xc0170 approved these changes May 2, 2019

@0xc0170 0xc0170 added needs: CI and removed needs: review labels May 2, 2019

@adbridge

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

commented May 7, 2019

Test run: FAILED

Summary: 2 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_dynamic-memory-usage
  • jenkins-ci/mbed-os-ci_greentea-test
@0xc0170

This comment has been minimized.

Copy link
Member

commented May 10, 2019

CI was restarted, all green now

@0xc0170 0xc0170 merged commit 998d85f into ARMmbed:master May 13, 2019

26 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage Success
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8524 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8448B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.