| Age | Commit message (Collapse) | Author | Files | Lines |
|
Extract the long onmessage() websocket lambda in requestRoutes() into a
named function, handleDbusMonitorMessage(), per the <10 line lambda
coding standard in docs/COMMON_ERRORS.md.
Tested:
- No other functional change.
- Tested on an AST2600 SoC platform.
- Redfish Service Validator passed with no new errors or warnings
introduced.
Change-Id: I340df11dfbc626e26dab931f0ca0581cbd17e102
Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
|
|
Long lambdas have been documented as an anti-pattern for some time.[1]
Despite this being generally understood, bmcweb has a long ways to go
cleaning these up, and routinely code is submitted in violation of this
anti-pattern.
Invent an ast-grep rule that can identify when new examples of this
anti-pattern are added, and ignore the existing 200+ examples that are
in the codebase already using ast-grep ignore. These flags will give us
something to search for as we clean this up, and will help to prevent
new instances from being added unintentionally.
[1] https://github.com/openbmc/docs/blob/master/anti-patterns.md#very-long-lambda-callbacks
Tested: Comment only change. ast-grep passes. Manually removing an
ast-grep ignore flag shows as a failure in ast-grep scan
Change-Id: I77d634a393884969f184d2c39c02cc08288d5a29
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* exception_t
* manager_t
* match
* match_rules
* message_t
* object_t
* slot_t
Change-Id: Iaf2a83fb67d57a6fafb664d27b349add17a96bcd
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t
* object_path
Change-Id: Iace20f9ad26e8d9dc234979e7a4087d599da2641
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
We should have a single entry point where we do json parsing. There are
configurations for nlohmmann that we had previously documented, but were
not well enforced. Move all uses to using the helper parse functions.
Tested: Unit tests pass.
Redfish service validator passes.
Change-Id: I2a8aed9327b6b15219dc9b4d6db146b69bcd8eb3
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
bmcweb's route handler generates handlers for both /foo/ and /foo
when a route is registered with a trailing slash. This change adds
trailing slashes to 24 routes that were missing them.
Existing clients are not affected: the router already accepted
both forms. This change makes the route registrations consistent
and lets the trailing-slash ast-grep rule pass without suppressions.
Routes using <path> captures already match everything and do not
need a trailing slash, so those are excluded in the ast-grep rule.
Tested: ast-grep scan --error exits 0.
Change-Id: I9de641bd8ffec773b313b7e4da9034be0fd7e8e8
Signed-off-by: Davy Marrero <dmarrero@nvidia.com>
|
|
nlohmann::json::begin() throws an uncaught exception.
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I08244b0787cd4d6e592b0731196490a5160aba62
|
|
Our includes haven't been enforced by tidy in a while. Run the script,
check in the result, minus the false positives.
Change-Id: I6a6da26f5ba5082d9b4aa17cdc9f55ebd8cd41a6
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
The backends are different things compared to generic code. Today,
these are all included in the /include folder, but it's not very clear
what options control which backends, or how things map together. This
also means that we can't separate ownership between the various
companies.
This commit is a proposal to try to create a features folder,
separated by the code for the various backends, to make interacting
with this easier. It takes the form
features/<option name>/files.hpp
features/<option name>/files_test.hpp
Note, redfish-core was already at top level, and contains lots of code,
so to prevent lots of conflicts, it's simply symlinked into that folder
to make clear that it is a backend, but not to move the implementation
and cause code conflicts.
Tested: Unit tests pass. Code compiles.
Change-Id: Idcc80ffcfd99c876734ee41d53f894ca5583fed5
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|