diff --git a/CHANGELOG.md b/CHANGELOG.md index ddeee97b..336fce6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ change warranting a new major release: ## Fixed +- Single sourcing the version information into `CMakeLists.txt`. The `git describe` functionality + is only used to retrieve the git SHA hash now. Also removed `OBSWVersion.h` accordingly. - Build system: Fixed small bug, where the version itself was stored as the git SHA hash in `commonConfig.h`. This will be an empty string now for regular versions. diff --git a/CMakeLists.txt b/CMakeLists.txt index 25e63e69..f670b6f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,9 @@ # ############################################################################## cmake_minimum_required(VERSION 3.13) -set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 1) -set(OBSW_VERSION_MINOR_IF_GIT_FAILS 25) -set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0) +set(OBSW_VERSION_MAJOR 1) +set(OBSW_VERSION_MINOR 25) +set(OBSW_VERSION_REVISION 0) # set(CMAKE_VERBOSE TRUE) @@ -168,12 +168,12 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) set(GIT_INFO ${GIT_INFO} CACHE STRING "Version information retrieved with git describe") - list(GET GIT_INFO 1 OBSW_VERSION_MAJOR) - list(GET GIT_INFO 2 OBSW_VERSION_MINOR) - list(GET GIT_INFO 3 OBSW_VERSION_REVISION) + # CMakeLists.txt is now single source of information. list(GET GIT_INFO 1 + # OBSW_VERSION_MAJOR) list(GET GIT_INFO 2 OBSW_VERSION_MINOR) list(GET + # GIT_INFO 3 OBSW_VERSION_REVISION) list(LENGTH GIT_INFO LIST_LEN) if(LIST_LEN GREATER 4) - list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1) + list(GET GIT_INFO 4 OBSW_VERSION_CST_GIT_SHA1) endif() if(NOT OBSW_VERSION_MAJOR) set(OBSW_VERSION_MAJOR ${OBSW_VERSION_MAJOR_IF_GIT_FAILS}) diff --git a/bsp_hosted/OBSWConfig.h.in b/bsp_hosted/OBSWConfig.h.in index e58e534d..5e6fcc2c 100644 --- a/bsp_hosted/OBSWConfig.h.in +++ b/bsp_hosted/OBSWConfig.h.in @@ -7,7 +7,6 @@ #define FSFWCONFIG_OBSWCONFIG_H_ #include "commonConfig.h" -#include "OBSWVersion.h" /*******************************************************************/ /** All of the following flags should be enabled for mission code */ diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index 5dff001c..9273e4e9 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -8,7 +8,6 @@ #include "commonConfig.h" #include "q7sConfig.h" -#include "OBSWVersion.h" /*******************************************************************/ /** All of the following flags should be enabled for mission code */ diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 23c6cc4f..50c662d7 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -5,7 +5,7 @@ #include #include -#include "OBSWVersion.h" +#include "commonConfig.h" #include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/timemanager/Stopwatch.h" #include "fsfw/version.h" @@ -179,6 +179,11 @@ ReturnValue_t CoreController::initializeAfterTaskCreation() { ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy, const uint8_t *data, size_t size) { switch (actionId) { + case (ANNOUNCE_VERSION): { + // uint32_t p1= + triggerEvent(VERSION_INFO); + return HasActionsIF::EXECUTION_FINISHED; + } case (LIST_DIRECTORY_INTO_FILE): { return actionListDirectoryIntoFile(actionId, commandedBy, data, size); } @@ -673,9 +678,9 @@ ReturnValue_t CoreController::initVersionFile() { sif::warning << "CoreController::versionFileInit: Retrieving uname line failed" << std::endl; } - std::string fullObswVersionString = "OBSW: v" + std::to_string(SW_VERSION) + "." + - std::to_string(SW_SUBVERSION) + "." + - std::to_string(SW_REVISION); + std::string fullObswVersionString = "OBSW: v" + std::to_string(common::OBSW_VERSION_MAJOR) + "." + + std::to_string(common::OBSW_VERSION_MINOR) + "." + + std::to_string(common::OBSW_VERSION_REVISION); char versionString[16] = {}; fsfw::FSFW_VERSION.getVersion(versionString, sizeof(versionString)); std::string fullFsfwVersionString = "FSFW: v" + std::string(versionString); diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 4d9d5ee8..9cbc6340 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -74,6 +74,8 @@ class CoreController : public ExtendedControllerBase { static constexpr dur_millis_t DEFAULT_SD_CARD_CHECK_TIMEOUT = 60000; static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; + static constexpr ActionId_t ANNOUNCE_VERSION = 1; + static constexpr ActionId_t ANNOUNCE_CURRENT_IMAGE = 2; static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5; static constexpr ActionId_t RESET_REBOOT_COUNTERS = 6; static constexpr ActionId_t SWITCH_IMG_LOCK = 7; @@ -109,6 +111,12 @@ class CoreController : public ExtendedControllerBase { //! [EXPORT] : [COMMENT] No SD card was active. Core controller will attempt to re-initialize //! a SD card. static constexpr Event NO_SD_CARD_ACTIVE = event::makeEvent(SUBSYSTEM_ID, 4, severity::HIGH); + //! [EXPORT] : [COMMENT] + //! P1: Byte 0: Major, Byte 1: Minor, Byte 2: Patch, Byte 3: Has Git Hash + //! P2: First four letters of Git SHA is the last byte of P1 is set. + static constexpr Event VERSION_INFO = event::makeEvent(SUBSYSTEM_ID, 5, severity::INFO); + //! [EXPORT] : [COMMENT] P1: Current Chip, P2: Current Copy + static constexpr Event CURRENT_IMAGE_INFO = event::makeEvent(SUBSYSTEM_ID, 6, severity::INFO); CoreController(object_id_t objectId); virtual ~CoreController(); diff --git a/common/config/OBSWVersion.h b/common/config/OBSWVersion.h deleted file mode 100644 index 36233c3b..00000000 --- a/common/config/OBSWVersion.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef COMMON_CONFIG_OBSWVERSION_H_ -#define COMMON_CONFIG_OBSWVERSION_H_ - -const char* const SW_NAME = "eive"; - -#define SW_VERSION 1 -#define SW_SUBVERSION 12 -#define SW_REVISION 1 - -#endif /* COMMON_CONFIG_OBSWVERSION_H_ */ diff --git a/fsfw b/fsfw index 84dc7ac0..84bbef01 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 84dc7ac0ce4f16d93a6a5a5fcd453b2fde206dba +Subproject commit 84bbef016712096147e8cf3f2cec87f317d9e7e7 diff --git a/mission/system/objects/AcsSubsystem.cpp b/mission/system/objects/AcsSubsystem.cpp index f5b8a0ce..6f7bbf7c 100644 --- a/mission/system/objects/AcsSubsystem.cpp +++ b/mission/system/objects/AcsSubsystem.cpp @@ -58,7 +58,7 @@ void AcsSubsystem::handleEventMessages() { case EventMessage::EVENT_MESSAGE: if (event.getEvent() == acs::SAFE_RATE_VIOLATION) { CommandMessage msg; - ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::DETUMBLE, 0); + ModeMessage::setCmdModeMessage(msg, acs::CtrlSubmode::DETUMBLE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending DETUMBLE mode cmd to self has failed" << std::endl; @@ -66,7 +66,7 @@ void AcsSubsystem::handleEventMessages() { } if (event.getEvent() == acs::SAFE_RATE_RECOVERY) { CommandMessage msg; - ModeMessage::setCmdModeModeMessage(msg, acs::CtrlSubmode::SAFE, 0); + ModeMessage::setCmdModeMessage(msg, acs::CtrlSubmode::SAFE, 0); ReturnValue_t result = commandQueue->sendMessage(commandQueue->getId(), &msg); if (result != returnvalue::OK) { sif::error << "AcsSubsystem: sending IDLE mode cmd to self has failed" << std::endl; diff --git a/release_checklist.md b/release_checklist.md new file mode 100644 index 00000000..b4f08165 --- /dev/null +++ b/release_checklist.md @@ -0,0 +1,12 @@ +OBSW Release Checklist +========= + +# Pre-Release + +1. Update version in `CMakeLists.txt` +2. Verify that the Q7S, Q7S EM and Host build are working +3. Wait for CI/CD results + +# Post-Release + +1. Create a new release with tag on `EGit` diff --git a/unittest/rebootLogic/src/CoreController.h b/unittest/rebootLogic/src/CoreController.h index 1846c27f..0d89b215 100644 --- a/unittest/rebootLogic/src/CoreController.h +++ b/unittest/rebootLogic/src/CoreController.h @@ -76,4 +76,4 @@ class CoreController { SdCardManager* sdcMan = nullptr; RebootFile rebootFile = {}; bool doPerformRebootFileHandling = true; -}; \ No newline at end of file +};