Skip to content

Commit

Permalink
Merge branch 'develop-mentions-sampleApp' into develop. Close #105.
Browse files Browse the repository at this point in the history
**Description**

Ogma's cFS template is based on cFS' Sample Application, and the generated code
includes multiple references to the sample app.

Keeping those references there is misleading, since this is not the sample app,
but a monitoring app.

**Type**

- Bug: The application produced by Ogma contains incorrect references.

**Additional context**

None.

**Requester**

- Ivan Perez

**Method to check presence of bug**

Searching for mentions of the sample app in the ogma directory brings up
multiple results. It should not bring any.

```sh
$ grep -niHre 'sample.\?app' *
ogma-core/src/Command/CFSApp.hs:212:      , "**   This file contains the source code for the Sample App."
ogma-core/templates/copilot-cfs/fsw/mission_inc/copilot_cfs_perfids.h:6:**  Define Sample App Performance IDs
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c:5:**   This file contains the source code for the Sample App.
ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs_version.h:6:**  The Sample Application header file containing version number
ogma-core/templates/copilot-cfs/fsw/platform_inc/copilot_cfs_msgids.h:6:**  Define Sample App  Message IDs
ogma-core/templates/copilot-cfs/CMakeLists.txt:2:project(CFE_SAMPLE_APP C)
```

The following dockerfile searches for mentions of the sample app  in all files,
printing the word Success if none are found:

```Dockerfile
FROM ubuntu:focal

RUN apt-get update

RUN apt-get install --yes git

SHELL ["/bin/bash", "-c"]
CMD git clone $REPO \
    && cd $NAME \
    && git checkout $COMMIT \
    && ! grep -niHre 'sample.\?app' --exclude='CHANGELOG.md' ogma** \
    && echo "Success"
```

Command (substitute variables based on new path after merge):

```sh
$ docker run -e "REPO=https://github.com/NASA/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=<HASH>" -it ogma-verify-105
```

**Expected result**

The result of the `grep` command above should be empty, indicating that there
are no mentions of the sample app.

**Solution implemented**

Replace all mentions of the sample app in the cFS template with mentions of the
Copilot app.

**Further notes**

None.
  • Loading branch information
ivanperez-keera committed Nov 22, 2023
2 parents 96b9de0 + 96bc35d commit 6d7ebba
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions ogma-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [1.X.Y] - 2023-11-21

* Remove trailing spaces from cFS app template (#108).
* Replace all mentions of the Sample App (#105).

## [1.0.11] - 2023-09-21

Expand Down
2 changes: 1 addition & 1 deletion ogma-core/src/Command/CFSApp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ fileContents variables msgIds msgNames msgDatas = cfsFileContents
, "** File: copilot_cfs.c"
, "**"
, "** Purpose:"
, "** This file contains the source code for the Sample App."
, "** This file contains the source code for the Copilot App."
, "**"
, "*********************************************************************/"
, ""
Expand Down
2 changes: 1 addition & 1 deletion ogma-core/templates/copilot-cfs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.6.4)
project(CFE_SAMPLE_APP C)
project(CFE_COPILOT_APP C)

include_directories(../../Modules/Core/Interfaces)
include_directories(../Icarouslib/fsw/platform_inc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** $Id: copilot_cfs_perfids.h $
**
** Purpose:
** Define Sample App Performance IDs
** Define Copilot App Performance IDs
**
** Notes:
**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** $Id: copilot_cfs_msgids.h $
**
** Purpose:
** Define Sample App Message IDs
** Define Copilot App Message IDs
**
** Notes:
**
Expand Down
2 changes: 1 addition & 1 deletion ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
** File: copilot_cfs.c
**
** Purpose:
** This file contains the source code for the Sample App.
** This file contains the source code for the Copilot App.
**
*******************************************************************************/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
** $Id: copilot_app_version.h $
**
** Purpose:
** The Sample Application header file containing version number
** The Copilot Application header file containing version number
**
** Notes:
**
Expand Down

0 comments on commit 6d7ebba

Please sign in to comment.