Skip to content

Restructure storage blockdevice directory #13273

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 5 commits into from
Jul 17, 2020

Conversation

rajkan01
Copy link
Contributor

@rajkan01 rajkan01 commented Jul 10, 2020

Summary of changes

Preceding PR: #13253 #13244

Restructured storage/blockdevice as per the new directory structure proposal:

storage
├── blockdevice
│   ├── include
│   │   └── blockdevice
│   │          └── [...]
│   ├── source
│   │   └── [...]
│   ├── tests
│        ├── TESTS
│        ├── UNITTESTS

Note:

  • UNITTESTS/stubs sources left untouched as it is used across different libraries.

Impact of changes

None.

Migration actions required

None.

Documentation

To Be Updated.


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

Manual testing: (Build for K64F target with ARMC6 and GCC_ARM toolchain)

  • mbed-os-example-blockdevice
  • Greentea tests: Full and bare metal profiles
  • Unit tests build and run

Reviewers

@bulislaw @0xc0170 @ARMmbed/mbed-os-core


@ciarmcom ciarmcom requested review from a team July 10, 2020 15:00
@ciarmcom
Copy link
Member

@rajkan01, thank you for your changes.
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

@rajkan01 rajkan01 force-pushed the storage_rb_dir_restructure branch from a794899 to c1df660 Compare July 10, 2020 18:13
@rajkan01 rajkan01 changed the title Storage rb dir restructure Refactor storage blockdevice directory Jul 10, 2020
@@ -175,10 +176,11 @@ foreach(testfile ${unittest-file-list})
include("${testfile}")

get_filename_component(TEST_SUITE_DIR ${testfile} DIRECTORY)
message( STATUS ${PROJECT_SOURCE_DIR} )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a debug message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed this one. I will update

@@ -27,3 +27,4 @@
^TESTS/mbed_hal/trng/pithy
^tools
^UNITTESTS
^storage/blockdevice/tests/UNITTESTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's possible to match all UNITTESTS in mbed-os

Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rajkan01 rajkan01 changed the title Refactor storage blockdevice directory Restructure storage blockdevice directory Jul 13, 2020
evedon
evedon previously approved these changes Jul 15, 2020
Copy link
Contributor

@evedon evedon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change is fine.
(You could squash the last commit with the commit that introduced the issue)

@mergify mergify bot added needs: CI and removed needs: work labels Jul 15, 2020
@rajkan01 rajkan01 force-pushed the storage_rb_dir_restructure branch from fc3a412 to 2d98fd8 Compare July 15, 2020 16:51
@mergify mergify bot dismissed evedon’s stale review July 15, 2020 16:54

Pull request has been modified.

@rajkan01
Copy link
Contributor Author

Code change is fine.
(You could squash the last commit with the commit that introduced the issue)

@evedon I squashed last commit as suggested, please re-review

@evedon
Copy link
Contributor

evedon commented Jul 15, 2020

I would also suggest to simplify the path for greentea tests by removing one blockdevice instance. So instead of storage/blockdevice/tests/TESTS/blockdevice/flashsim_block_device/main.cpp, you could have storage/blockdevice/tests/TESTS/flashsim_block_device/main.cpp

@rajkan01
Copy link
Contributor Author

rajkan01 commented Jul 15, 2020

I would also suggest to simplify the path for greentea tests by removing one blockdevice instance. So instead of storage/blockdevice/tests/TESTS/blockdevice/flashsim_block_device/main.cpp, you could have storage/blockdevice/tests/TESTS/flashsim_block_device/main.cpp

Current Mbed OS build tools to build the greentea test looks for an XYZ directory (It can be any name) under TESTS (Magic name) to consider as test suite and then it will build all the test under XYZ directory
for example:
TESTS/block device/flashsimlock_device => build
TESTS/flashsim_block_device => not recognized by build tools

[Warning] Test with name 'storage-blockdevice-tests-tests-flashsim_block_device' was not found in the available tests

@evedon
Copy link
Contributor

evedon commented Jul 16, 2020

I would also suggest to simplify the path for greentea tests by removing one blockdevice instance. So instead of storage/blockdevice/tests/TESTS/blockdevice/flashsim_block_device/main.cpp, you could have storage/blockdevice/tests/TESTS/flashsim_block_device/main.cpp

Current Mbed OS build tools to build the greentea test looks for an XYZ directory (It can be any name) under TESTS (Magic name) to consider as test suite and then it will build all the test under XYZ directory
for example:
TESTS/block device/flashsimlock_device => build
TESTS/flashsim_block_device => not recognized by build tools

[Warning] Test with name 'storage-blockdevice-tests-tests-flashsim_block_device' was not found in the available tests

Alas, let's leave this for another day then...

evedon
evedon previously approved these changes Jul 16, 2020
Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just have one question regarding the COMPONENT_* "sub" libraries to discuss.

Comment on lines 34 to 40
#if COMPONENT_FLASHIAP
#include "components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.h"
#include "storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.h"
#endif

#if COMPONENT_QSPIF
#include "components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.h"
#include "storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.h"
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realised we haven't refactored the include paths for COMPONENT_*/*BlockDevice.h - they are public APIs but don't follow the "include" proposal in this PR.

Shall we use the same path name **/include/blockdevice/** inside each of them, so we would have a consistent

#include "blockdevice/FlashIAPBlockDevice.h"
#include "blockdevice/QSPIFBlockDevice.h"
...

@rajkan01 @evedon ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial blockdevice directory restructure proposal, just to move the source COMPONENT_xxx directly into storage/blockdevice and no refactoring. if we would like to changes on COMPONENT_XXX then we will do it incremental changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should do in a subsequent PR.

Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the proposal we didn't explicit document some of the sub libraries under blockdevice, but anything that's public API requires refactoring.

@mergify mergify bot added the needs: work label Jul 17, 2020
rajkan01 added 5 commits July 17, 2020 03:10
- Update the header reference and source reference in cmake
- Update astyleignore to ignore blockdevice UNITTESTS
- Removed the redundant debug log
@rajkan01 rajkan01 force-pushed the storage_rb_dir_restructure branch from 2d98fd8 to 3bcb4eb Compare July 17, 2020 10:26
@mergify mergify bot dismissed evedon’s stale review July 17, 2020 10:26

Pull request has been modified.

@rajkan01
Copy link
Contributor Author

@adbridge Rebased this PR to resolve the merge conflicts, Could you start the CI

@adbridge
Copy link
Contributor

@evedon @LDong-Arm are you happy with this PR? If so please approve so we can get it into CI

@evedon
Copy link
Contributor

evedon commented Jul 17, 2020

@evedon @LDong-Arm are you happy with this PR? If so please approve so we can get it into CI

@adbridge I am pretty sure this PR was approved by both of us but the rebase has dismissed the approvals.

@mergify mergify bot added needs: CI and removed needs: review labels Jul 17, 2020
@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Jul 17, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 1
Build artifacts

@adbridge adbridge merged commit ca2f980 into ARMmbed:master Jul 17, 2020
@mergify mergify bot removed the ready for merge label Jul 17, 2020
@mergify
Copy link

mergify bot commented Jul 17, 2020

This PR does not contain release version label after merging.

@mergify mergify bot added the release version missing When PR does not contain release version, bot should label it and we fix it afterwards label Jul 17, 2020
@adbridge adbridge added release-type: patch Indentifies a PR as containing just a patch and removed release version missing When PR does not contain release version, bot should label it and we fix it afterwards labels Jul 17, 2020
@mbedmain mbedmain added release-version: 6.2.1 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Aug 16, 2020
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.

7 participants