#
78d4ec4f
|
| 06-Mar-2024 |
Ed Tanous <ed@tanous.net> |
Clean up event service to use readJson
Use multiple level direct read.
Tested: Visual only. Need help if anyone wants to test.
Change-Id: I8655e74d39edcbab43fcd2a8379b085e91ed00eb Signed-off-by: E
Clean up event service to use readJson
Use multiple level direct read.
Tested: Visual only. Need help if anyone wants to test.
Change-Id: I8655e74d39edcbab43fcd2a8379b085e91ed00eb Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
8ece0e45
|
| 02-Jan-2024 |
Ed Tanous <ed@tanous.net> |
Fix spelling mistakes
These were found with: codespell -w $(git ls-files | grep "\.[hc]\(pp\)\?$")
At some point in the future, we might want to get this enabled in CI.
Change-Id: Iccb57b2adfd06a2
Fix spelling mistakes
These were found with: codespell -w $(git ls-files | grep "\.[hc]\(pp\)\?$")
At some point in the future, we might want to get this enabled in CI.
Change-Id: Iccb57b2adfd06a2e177e99db2923fe4e8e329118 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
5a39f77a
|
| 20-Oct-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I2f9540cf0d545a2da4d6289fc87b754f684bc9a7 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
6fd29553
|
| 04-Oct-2023 |
Ed Tanous <edtanous@google.com> |
Update to boost 1.83.0
In boost 1.83.0, the boost::url maintainers deprecated the header only usage of the library without warning. A discussion with the maintainers[1] made it clear that they remo
Update to boost 1.83.0
In boost 1.83.0, the boost::url maintainers deprecated the header only usage of the library without warning. A discussion with the maintainers[1] made it clear that they removed the abiliy on purpose, and they're not going to add it back or add a deprecation strategy (they did say they would update the documentation to actually match the intent), and that from here on in we should be using the cmake boost project to pull in the non-header-only boost libraries we use (which at this point is ONLY boost url).
This commit updates to remove the usage of boost::urls::result typedef, which was deprecated in this release (which causes a compile error) and moves it to boost::system::result.
In addition, it updates our meson files to pull in the boost project as a cmake dependency.
[1] https://cpplang.slack.com/archives/C01JR6C9C4U/p1696441238739129
Tested: Not yet.
Change-Id: Ia7adfc0348588915440687c3ab83a1de3e6b845a Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
a716aa74
|
| 01-Aug-2023 |
Ed Tanous <edtanous@google.com> |
Move http client to URL
Type safety is a good thing. In: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/65606
It was found that splitting out the URI into encoded pieces in the early phase removed
Move http client to URL
Type safety is a good thing. In: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/65606
It was found that splitting out the URI into encoded pieces in the early phase removed some information we needed, namely whether or not a URI was ipv6. This commit changes http client such that it passes all the information through, with the correct type, rather than passing in hostname, port, path, and ssl separately.
Opportunistically, because a number of log lines are changing, this uses the opportunity to remove a number of calls to std::to_string, and rely on std::format instead.
Now that we no longer use custom URI splitting code, the ValidateAndSplitUrl() method can be removed, given that our validation now happens in the URI class.
Tested: Aggregation works properly when satellite URIs are queried.
Change-Id: I9f605863179af54c5af2719bc5ce9d29cbfffab7 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
3544d2a7
|
| 06-Aug-2023 |
Ed Tanous <edtanous@google.com> |
Use ranges
C++20 brought us std::ranges for a lot of algorithms. Most of these conversions were done using comby, similar to:
``` comby -verbose 'std::lower_bound(:[a].begin(),:[b].end(),:[c])' 's
Use ranges
C++20 brought us std::ranges for a lot of algorithms. Most of these conversions were done using comby, similar to:
``` comby -verbose 'std::lower_bound(:[a].begin(),:[b].end(),:[c])' 'std::ranges::lower_bound(:[a], :[c])' $(git ls-files | grep "\.[hc]\(pp\)\?$") -in-place ```
Change-Id: I0c99c04e9368312555c08147d474ca93a5959e8d Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
3b32780d
|
| 14-Aug-2023 |
Ed Tanous <edtanous@google.com> |
Update event_service and account_service URI
Use boost::urls::format. Boost::urls::format allows escaping URLs properly, and has been deployed in most places. This now includes users in that set.
Update event_service and account_service URI
Use boost::urls::format. Boost::urls::format allows escaping URLs properly, and has been deployed in most places. This now includes users in that set.
Tested: Inspection only.
Change-Id: Ib16c8fceb7c58f4074f65df7634ac91af0633e2b Signed-off-by: Willy Tu <wltu@google.com> Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
1306101e
|
| 25-Jul-2023 |
Ed Tanous <edtanous@google.com> |
Add error code check for snmp
When SNMP isn't present, and the name is not activatable, (becuase snmp isn't installed) it returns a 113 error code. We should handle this silently, rather than retur
Add error code check for snmp
When SNMP isn't present, and the name is not activatable, (becuase snmp isn't installed) it returns a 113 error code. We should handle this silently, rather than returning an internal error, because snmp is optional.
Tested: Ran redfish service validator on a system without phosphor-snmp installed, and observed no more error on /redfish/v1/EventService/Subscriptions.
Change-Id: I2254d763de6c55c678a95765e1bc87fb9aaa9564 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
62598e31
|
| 17-Jul-2023 |
Ed Tanous <ed@tanous.net> |
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level of compile time checks, it needs to be a method, instead of the stream style logging we had before. This requires a pretty substantial change. Fortunately, this change can be largely automated, via the script included in this commit under scripts/replace_logs.py. This is to aid people in moving their patchsets over to the new form in the short period where old patches will be based on the old logging. The intention is that this script eventually goes away.
The old style logging (stream based) looked like.
BMCWEB_LOG_DEBUG << "Foo " << foo;
The new equivalent of the above would be: BMCWEB_LOG_DEBUG("Foo {}", foo);
In the course of doing this, this also cleans up several ignored linter errors, including macro usage, and array to pointer deconstruction.
Note, This patchset does remove the timestamp from the log message. In practice, this was duplicated between journald and bmcweb, and there's no need for both to exist.
One design decision of note is the addition of logPtr. Because the compiler can't disambiguate between const char* and const MyThing*, it's necessary to add an explicit cast to void*. This is identical to how fmt handled it.
Tested: compiled with logging meson_option enabled, and launched bmcweb
Saw the usual logging, similar to what was present before: ``` [Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled [Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800 [Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist [Info src/webserver_main.cpp:59] Starting webserver on port 18080 [Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file. [Info src/webserver_main.cpp:137] Start Hostname Monitor Service... ``` Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8
show more ...
|
#
24d67ff8
|
| 28-Sep-2020 |
Ed Tanous <ed@tanous.net> |
Remove IBM console events from Redfish
The /ibm/v1 console is a different tree than Redfish, and as such, should not be sending non-redfish resource events out. This is very likely to break redfish
Remove IBM console events from Redfish
The /ibm/v1 console is a different tree than Redfish, and as such, should not be sending non-redfish resource events out. This is very likely to break redfish clients on the other end. If the management console wants an event-like entity, it needs to come up with its own EventService-like resource, considering it is a separate tree.
Significant related discussion occurred here: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/36368
Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: Ic2a9e572099490f8810e03ab08336518f5672690
show more ...
|
#
e81de512
|
| 27-Jun-2023 |
Ed Tanous <edtanous@google.com> |
Make error codes take by reference
Similar to may other refactors we've done, capture boost::system::error_code instances by const reference.
Tested: Trivial change. Code compiles.
Change-Id: I63
Make error codes take by reference
Similar to may other refactors we've done, capture boost::system::error_code instances by const reference.
Tested: Trivial change. Code compiles.
Change-Id: I63b6c1e3e793621cf55aca03259c2e9ffddab853 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
3d30708f
|
| 26-Nov-2020 |
Chicago Duan <duanzhijia01@inspur.com> |
Redfish: Implement SNMP Trap
Implement SNMPTrap in EventDestination of Redfish. We can use this Redfish interface to add/get/delete the SNMPTrap port and destination address. When the error
log is
Redfish: Implement SNMP Trap
Implement SNMPTrap in EventDestination of Redfish. We can use this Redfish interface to add/get/delete the SNMPTrap port and destination address. When the error
log is generated, phosphor-snmp will send SNMPTrap messages to our configured SNMPTrap destination.
The MIB is here: [1] https://github.com/openbmc/phosphor-snmp/blob/master/mibs/NotificationMIB.txt
Refer: [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2019.3.pdf
SNMPTrap test: Tested ok on the Witherspoon machine. Steps are as follows: 1. Use this Redfish interface to configure the port and destination address: curl -k -H "X-Auth-Token: $token" -X POST https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination": "snmp://192.168.31.89:162", "SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c"}' 2. Run the SNMPTrap receiver tool in the destination computer(192.168.31.89),I used iReasoning MIB Browser as the SNMPTrap receiving tool. 3. Trigger error logs such as power supply AC Lost. We will see the error log under /xyz/openbmc_project/logging. 4. The SNMPTrap receiver tool in the destination computer received the SNMPTrap sent by OpenBMC.
Tested: Validator passes 1. Add snmp client: curl -k -H "X-Auth-Token: $token" -X POST https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination": "snmp://192.168.31.89:162", "SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c", "Context": "testContext"}' { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "The resource has been created successfully", "MessageArgs": [], "MessageId": "Base.1.8.1.Created", "MessageSeverity": "OK", "Resolution": "None" } ] } 2. Get snmp trap client configurations: curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/EventService/Subscriptions/snmp1 { "@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1", "@odata.type": "#EventDestination.v1_7_0.EventDestination", "Context": "testContext", "Destination": "snmp://192.168.31.89:162", "EventFormatType": "Event", "Id": "snmp1", "Name": "Event Destination snmp1", "Protocol": "SNMPv2c", "SubscriptionType": "SNMPTrap" }
Reboot the BMC, and get the snmp trap client again: curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/EventService/Subscriptions/snmp1 { "@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1", "@odata.type": "#EventDestination.v1_7_0.EventDestination", "Context": "testContext", "Destination": "snmp://192.168.31.89:162", "EventFormatType": "Event", "Id": "snmp1", "Name": "Event Destination snmp1", "Protocol": "SNMPv2c", "SubscriptionType": "SNMPTrap" }
3. Delete snmp client: curl -k -H "X-Auth-Token: $token" -X DELETE https://${bmc}/redfish/v1/EventService/Subscriptions/snmp1 { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.8.1.Success", "MessageSeverity": "OK", "Resolution": "None" } ] } 4. After we have added some SNMP clients using Redfish, we can see them in Dbus: busctl tree xyz.openbmc_project.Network.SNMP `-/xyz `-/xyz/openbmc_project `-/xyz/openbmc_project/network `-/xyz/openbmc_project/network/snmp `-/xyz/openbmc_project/network/snmp/manager |-/xyz/openbmc_project/network/snmp/manager/1
busctl introspect xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager/1 xyz.openbmc_project.Network.Client NAME TYPE SIGNATURE RESULT/VALUE FLAGS .Address property s "192.168.31.89" emits-change writable .Port property q 162 emits-change writable
5. Use "busctl call" add client busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager xyz.openbmc_project.Network.Client.Create Client sq 192.168.31.90 162 s "/xyz/openbmc_project/network/snmp/manager/2"
We will see it use the redfish url: curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/EventService/Subscriptions/snmp2 { "@odata.id": "/redfish/v1/EventService/Subscriptions/snmp2", "@odata.type": "#EventDestination.v1_7_0.EventDestination", "Context": "", "Destination": "snmp://192.168.31.90:162", "EventFormatType": "Event", "Id": "snmp2", "Name": "Event Destination snmp2", "Protocol": "SNMPv2c", "SubscriptionType": "SNMPTrap" }
6. Deleting snmp client using "busctl" First, we use redfish to add some SNMP clients: curl -k -H "X-Auth-Token: $token" -X POST https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination": "snmp://192.168.31.90:162", "SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c", "Context": "testContext0"}'
curl -k -H "X-Auth-Token: $token" -X POST https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination": "snmp://192.168.31.91:162", "SubscriptionType": "SNMPTrap", "Protocol": "SNMPv2c", "Context": "testContext1"}'
Then we can use redfish to get the subscriptions: curl -k -H "X-Auth-Token: $token" -XGET https://${bmc}/redfish/v1/EventService/Subscriptions { "@odata.id": "/redfish/v1/EventService/Subscriptions", "@odata.type":"#EventDestinationCollection.EventDestinationCollection", "Members": [ { "@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1" }, { "@odata.id": "/redfish/v1/EventService/Subscriptions/snmp2" } ], "Members@odata.count": 2, "Name": "Event Destination Collections" }
Now we use busctl to delete SNMP client 2: busctl call xyz.openbmc_project.Network.SNMP /xyz/openbmc_project/network/snmp/manager/2 xyz.openbmc_project.Object.Delete Delete
Then we won't see snmp2 in the subscriptions of redfish: curl -k -H "X-Auth-Token: $token" -XGET https://${bmc}/redfish/v1/EventService/Subscriptions { "@odata.id": "/redfish/v1/EventService/Subscriptions", "@odata.type":"#EventDestinationCollection.EventDestinationCollection",
"Members": [ { "@odata.id": "/redfish/v1/EventService/Subscriptions/snmp1" } ], "Members@odata.count": 1, "Name": "Event Destination Collections" }
7. Test the generic event subscription to make sure it didn't impacted Add Redfish subscription: curl -k -H "X-Auth-Token: $token" -X POST https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination": "https://192.168.31.189:443", "SubscriptionType": "RedfishEvent", "Protocol": "Redfish", "Context": "testContext"}' { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The resource has been created successfully.", "MessageArgs": [], "MessageId": "Base.1.13.0.Created", "MessageSeverity": "OK", "Resolution": "None." } ]
Get Redfish subscription: curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/EventService/Subscriptions/1358109191 { "@odata.id": "/redfish/v1/EventService/Subscriptions/1358109191", "@odata.type": "#EventDestination.v1_8_0.EventDestination", "Context": "testContext", "DeliveryRetryPolicy": "TerminateAfterRetries", "Destination": "https://192.168.31.189:443", "EventFormatType": "Event", "HttpHeaders": [], "Id": "1358109191", "MessageIds": [],
"MetricReportDefinitions": [], "Name": "Event Destination 1358109191", "Protocol": "Redfish", "RegistryPrefixes": [], "ResourceTypes": [], "SubscriptionType": "RedfishEvent" }
Signed-off-by: Chicago Duan <duanzhijia01@inspur.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie589b3934ee749c7e0add35e3ed1b0b7e817c557
show more ...
|
#
f818b04d
|
| 27-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Make propertyValueFormatError more typesafe
Similar to other patches, make propertyValueFormatError accept a nlohmann::json object, which removes a lot of the unsafe dump code that we have littered
Make propertyValueFormatError more typesafe
Similar to other patches, make propertyValueFormatError accept a nlohmann::json object, which removes a lot of the unsafe dump code that we have littered about.
Tested: No easy to replicate error. Code is identical to previous patchsets. Inspection and code compilation only.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic9d0f196b6e198073189f744b738db7ffa2f1b74
show more ...
|
#
5e44e3d8
|
| 16-Mar-2021 |
AppaRao Puli <apparao.puli@linux.intel.com> |
Add SSE style subscription support to eventservice
This commit adds the SSE style eventservice subscription style event Using this, end user can subscribe for Redfish event logs using GET on SSE uri
Add SSE style subscription support to eventservice
This commit adds the SSE style eventservice subscription style event Using this, end user can subscribe for Redfish event logs using GET on SSE uris from browser.
Tested: - From Browser did GET on above SSE URI and generated some Redfish event logs(power cycle) and saw redfish event logs streaming on browser. - After SSE registration, Check Subscription collections and GET on individual subscription and saw desired response. - Ran RedfishValidation and its passed.
Change-Id: I7f4b7a34974080739c4ba968ed570489af0474de Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
600af5f1
|
| 06-Oct-2021 |
AppaRao Puli <apparao.puli@linux.intel.com> |
Input parameter validation for Event Subscription
User input must be validated to avoid the out-of-memory issue. This commit adds the size check on input parameters such as Context, Destination and
Input parameter validation for Event Subscription
User input must be validated to avoid the out-of-memory issue. This commit adds the size check on input parameters such as Context, Destination and Header field while create or update the EventDestination.
Added a generic error message "PropertySizeExceeded" in message registry which is used as response when size limit is exceeded.
Tested - Validated using POST on Event Subscription. - When Context, Destination and Headers were too long, received a error message denoting the same.
Change-Id: Ibab847ce0c99f445a76e6d3aee8074428bb7d30f Signed-off-by: AppaRao Puli <apparao.puli@intel.com> Signed-off-by: Ayushi Smriti <smriti.ayushi@intel.com> Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
f8ca6d79
|
| 28-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Allow async resolver to be optional
This commit adds a meson option to allow selecting which dns resolver bmcweb uses. There are use cases, like Open Compute Project Inband Management Agent, that w
Allow async resolver to be optional
This commit adds a meson option to allow selecting which dns resolver bmcweb uses. There are use cases, like Open Compute Project Inband Management Agent, that would require not using dbus, which would require us to fall back to the asio resolver. This commit makes the existing asio resolver constructor, and async_resolve methods match the equivalents in asio (which we intended to do anyway), then adds a macro and configure option for being able to select which resolver backend to rely on.
Tested: Code can now compile without sdbusplus.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I3220214367179f131a60082bdfaf7e725d35c125
show more ...
|
#
b2ba3072
|
| 12-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
fix more push vs emplace calls
It seems like clang-tidy doesn't catch every place that an emplace could be used instead of a push. Use a few grep/sed pairs to find and fix up some common patterns.
fix more push vs emplace calls
It seems like clang-tidy doesn't catch every place that an emplace could be used instead of a push. Use a few grep/sed pairs to find and fix up some common patterns.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I93eaec26b8e3be240599e92b66cf54947073dc4c
show more ...
|
#
89492a15
|
| 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I75f89d2959b0f1338c20d72ad669fbdc1d720835 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
d14a48ff
|
| 21-Feb-2023 |
Carson Labrado <clabrado@google.com> |
Aggregation: Increase response read limit to 50MB
With Redfish aggregation, responses from satellite BMCs can be on the order of MBs due to use cases like logging or binary payloads. Offloading $exp
Aggregation: Increase response read limit to 50MB
With Redfish aggregation, responses from satellite BMCs can be on the order of MBs due to use cases like logging or binary payloads. Offloading $expand could similar result in responses that exceed the current read limit of 128 KB.
Splits the connection pools used for aggregation and EventService so that the response read limit is 50MB for responses associated with aggregation. Pools used by EventService keep the current limit of 2^17 bytes or 128 KB. It also propogates a ConnectionPolicy object that gets instantiated within HttpClient, which allows per-client policies for retry/byte limits. This allows EventService and aggregation to have different policies.
Tested: With aggregation enabled I was able to return a response from a satellite BMC which was than 2MB. Ran the Redfish Mockup Creator and it was able to successfully query all aggregated resources as part of walking the tree. Also verified that HTTP push events still work with EventListener.
Change-Id: I91de6f82aadf8ad6f7bc3f58dfa0d14c0759dd47 Signed-off-by: Carson Labrado <clabrado@google.com> Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
3ccb3adb
|
| 13-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't catch most of these.
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic741fbb2cc9e5e92955fd5a1b778a482830e80e8
show more ...
|
#
33a32b34
|
| 17-Nov-2022 |
Gunnar Mills <gmills@us.ibm.com> |
Allow a lower DeliveryRetryIntervalSeconds
The current DeliveryRetryIntervalSeconds range is 30 - 180 seconds. As far as I can tell, this is arbitrary. Lower the minimum to 5 seconds so the client (
Allow a lower DeliveryRetryIntervalSeconds
The current DeliveryRetryIntervalSeconds range is 30 - 180 seconds. As far as I can tell, this is arbitrary. Lower the minimum to 5 seconds so the client (the IBM management console) can set it to this low. The current default will still be 30 seconds. The client wanted it this low because the data might not be correct by the time the event is retried. 5 seconds is arbitrary, decided on this only based on the client's request. A lower minimum of like 1 or even 0 is reasonable to me but going with 5 seconds because that is the request and what has been tested.
Tested:
Before:
``` curl -k -H "Content-Type: application/json" -X PATCH https://$bmc/redfish/v1/EventService/ -d '{"DeliveryRetryIntervalSeconds": 5}' { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The value 5 for the query parameter DeliveryRetryIntervalSeconds is out of range [30-180].", "MessageArgs": [ "5", "DeliveryRetryIntervalSeconds", "[30-180]" ], "MessageId": "Base.1.8.1.QueryParameterOutOfRange", ... ``` After:
``` curl -v -k -H "Content-Type: application/json" -X PATCH https://$bmc/redfish/v1/EventService/ -d '{"DeliveryRetryIntervalSeconds": 5}' ...
< HTTP/1.1 200 OK
```
We have this patch downstream and have seen retring at 5 secs.
Change-Id: I462569969565bdc97c15cb190ed65201d50abdf0 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
613dabea
|
| 09-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Remove nlohmann brace initialization
There's a few last places (outside of tests) where we still use nlohmann brace initialization. Per the transforms we've been doing, move these to constructing t
Remove nlohmann brace initialization
There's a few last places (outside of tests) where we still use nlohmann brace initialization. Per the transforms we've been doing, move these to constructing the objects explicitly, using operator[], nlohmann::object_t and nlohmann::array_t. Theses were found by manual inspection grepping for all uses of nlohmann::json.
This is done to reduce binary size and reduce the number of intermediate objects being constructed. This commit saves a trivial amount of size (~4KB, Half a percent of total) and in addition but makes our construction consistent.
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7478479a9fdc41b254eef325002d413c1fb411a0
show more ...
|
#
62bafc01
|
| 08-Sep-2022 |
Patrick Williams <patrick@stwcx.xyz> |
clang-tidy: fix misc warnings
The following error reports have started to be reported by clang-tidy:
* readability-qualified-auto - add 'const' to `auto&` iterators * bugprone-use-after-move -
clang-tidy: fix misc warnings
The following error reports have started to be reported by clang-tidy:
* readability-qualified-auto - add 'const' to `auto&` iterators * bugprone-use-after-move - add break in loop after element is found
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I5314559f62f58aa032d4c74946b8e3e4ce6be808
show more ...
|
#
3ba00073
|
| 06-Jun-2022 |
Carson Labrado <clabrado@google.com> |
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation op
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation operations. The functions in query.hpp are used by all endpoints making them the logical location. The aggregation code requires a shared_ptr to the AsyncResp so these functions need to be able to supply that.
This patch is broken out of a future patch for routing Redfish Aggregation requests https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310
The follow commands can be used to perform most of the replacements: find . -type f | xargs sed -i 's/setUpRedfishRoute(app, req, asyncResp->res/setUpRedfishRoute(app, req, asyncResp/g' find . -type f | xargs sed -i 's/setUpRedfishRouteWithDelegation(app, req, asyncResp->res/setUpRedfishRouteWithDelegation(app, req, asyncResp/g'
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I4f4f9f22cdcfb14a3bd94b9a8f3d64aae34e57bc
show more ...
|
#
002d39b4
|
| 31-May-2022 |
Ed Tanous <edtanous@google.com> |
Try to fix the lambda formatting issue
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels
Try to fix the lambda formatting issue
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels and to use OuterScope."
bmcweb is very callback heavy code. Try to enable it and see if that improves things. There are many cases where the length of a lambda call will change, and reindent the entire lambda function. This is really bad for code reviews, as it's difficult to see the lines changed. This commit should resolve it. This does have the downside of reindenting a lot of functions, which is unfortunate, but probably worth it in the long run.
All changes except for the .clang-format file were made by the robot.
Tested: Code compiles, whitespace changes only.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib4aa2f1391fada981febd25b67dcdb9143827f43
show more ...
|