diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d045c9d..0e247d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ defaults: jobs: docker: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: DOCKER_REGISTRY_URL: tip-tip-wlan-cloud-ucentral.jfrog.io DOCKER_REGISTRY_USERNAME: ucentral @@ -51,7 +51,8 @@ jobs: SLACK_TITLE: Docker build failed for OWFMS service trigger-testing: - if: startsWith(github.ref, 'refs/pull/') + #if: startsWith(github.ref, 'refs/pull/') + if: false runs-on: ubuntu-latest needs: docker steps: @@ -82,7 +83,8 @@ jobs: trigger-deploy-to-dev: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' + #if: github.ref == 'refs/heads/main' + if: false needs: - docker steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index ac5aa2a..b32cb07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.13) -project(owfms VERSION 3.2.0) +project(owfms VERSION 4.2.2) set(CMAKE_CXX_STANDARD 17) @@ -160,4 +160,3 @@ target_link_libraries( owfms PUBLIC resolv CppKafka::cppkafka ) - diff --git a/openapi/owfms.yaml b/openapi/owfms.yaml index 26ed0f1..b499dbb 100644 --- a/openapi/owfms.yaml +++ b/openapi/owfms.yaml @@ -226,6 +226,8 @@ components: $ref: '#/components/schemas/TagIntPairList' unknownFirmwares: $ref: '#/components/schemas/TagIntPairList' + matchedRevisions: + $ref: '#/components/schemas/TagIntPairList' usingLatest: $ref: '#/components/schemas/TagIntPairList' totalSecondsOld: diff --git a/src/RESTObjects/RESTAPI_FMSObjects.cpp b/src/RESTObjects/RESTAPI_FMSObjects.cpp index ff46f83..4eec06c 100644 --- a/src/RESTObjects/RESTAPI_FMSObjects.cpp +++ b/src/RESTObjects/RESTAPI_FMSObjects.cpp @@ -211,6 +211,7 @@ namespace OpenWifi::FMSObjects { field_to_json(Obj, "endPoints", EndPoints_); field_to_json(Obj, "usingLatest", UsingLatest_); field_to_json(Obj, "unknownFirmwares", UnknownFirmwares_); + field_to_json(Obj, "matchedRevisions", MatchedRevisions_); field_to_json(Obj, "snapshot", snapshot); field_to_json(Obj, "numberOfDevices", numberOfDevices); field_to_json(Obj, "totalSecondsOld", totalSecondsOld_); @@ -224,6 +225,7 @@ namespace OpenWifi::FMSObjects { EndPoints_.clear(); UsingLatest_.clear(); UnknownFirmwares_.clear(); + MatchedRevisions_.clear(); totalSecondsOld_.clear(); numberOfDevices = 0; snapshot = Utils::Now(); diff --git a/src/RESTObjects/RESTAPI_FMSObjects.h b/src/RESTObjects/RESTAPI_FMSObjects.h index 705ccc8..2eb6e83 100644 --- a/src/RESTObjects/RESTAPI_FMSObjects.h +++ b/src/RESTObjects/RESTAPI_FMSObjects.h @@ -120,6 +120,7 @@ namespace OpenWifi::FMSObjects { Types::CountedMap EndPoints_; Types::CountedMap UsingLatest_; Types::CountedMap UnknownFirmwares_; + Types::CountedMap MatchedRevisions_; Types::CountedMap totalSecondsOld_; void to_json(Poco::JSON::Object &Obj) const; void reset(); diff --git a/src/storage/orm_deviceInfo.cpp b/src/storage/orm_deviceInfo.cpp index cbe0ddc..4f03727 100644 --- a/src/storage/orm_deviceInfo.cpp +++ b/src/storage/orm_deviceInfo.cpp @@ -84,6 +84,11 @@ namespace OpenWifi { UpdateCountedMap(Report.EndPoints_, D.endPoint); UpdateCountedMap(Report.OUI_, D.serialNumber.substr(0, 6)); FMSObjects::FirmwareAgeDetails Age; + FMSObjects::Firmware MatchedFw; + if (StorageService()->FirmwaresDB().GetFirmwareByRevision( + D.revision, D.deviceType, MatchedFw)) { + UpdateCountedMap(Report.MatchedRevisions_, D.revision); + } if (StorageService()->FirmwaresDB().ComputeFirmwareAge(D.deviceType, D.revision, Age)) { if (Age.latest) { UpdateCountedMap(Report.UsingLatest_, D.revision);