Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ogma-core: Generated cFS application mentions the sample app #105

Closed
ivanperez-keera opened this issue Oct 20, 2023 · 6 comments
Closed
Assignees
Labels
CR:Status:Closed Admin only: Change request that has been completed CR:Type:Bug Admin only: Change request pertaining to error detected
Milestone

Comments

@ivanperez-keera
Copy link
Member

ivanperez-keera commented Oct 20, 2023

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.

$ 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)

Expected result

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

Desired result

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

Proposed solution

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

Further notes

None.

@ivanperez-keera ivanperez-keera changed the title ogma-cli: Generated cFS application mentions the sample app ogma-core: Generated cFS application mentions the sample app Nov 22, 2023
@ivanperez-keera ivanperez-keera added CR:Status:Initiated Admin only: Change request that has been initiated CR:Type:Bug Admin only: Change request pertaining to error detected labels Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Change Manager: Confirmed that the issue exists.

@ivanperez-keera ivanperez-keera added CR:Status:Confirmed Admin only: Change request that has been acknowledged by the change manager and removed CR:Status:Initiated Admin only: Change request that has been initiated labels Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Technical Lead: Confirmed that the issue should be addressed.

@ivanperez-keera ivanperez-keera added CR:Status:Accepted Admin only: Change request accepted by technical lead and removed CR:Status:Confirmed Admin only: Change request that has been acknowledged by the change manager labels Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Technical Lead: Issue scheduled for fixing in Ogma 1.0.12.

Fix assigned to: @ivanperez-keera.

@ivanperez-keera ivanperez-keera added CR:Status:Scheduled Admin only: Change requested scheduled and removed CR:Status:Accepted Admin only: Change request accepted by technical lead labels Nov 22, 2023
@ivanperez-keera ivanperez-keera self-assigned this Nov 22, 2023
@ivanperez-keera ivanperez-keera added this to the 1.0.12 milestone Nov 22, 2023
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2023
The cFS application produced by Ogma includes multiple mentions of the Sample
App. This is because template used is based on cFS' Sample Application. Keeping
those references there is misleading, since this is not the sample app, but a
monitoring app.

This commit replaces all mentions of the sample app to the Copilot app.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2023
@ivanperez-keera ivanperez-keera added CR:Status:Implementation Admin only: Change request that is currently being implemented and removed CR:Status:Scheduled Admin only: Change requested scheduled labels Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Implementor: Solution implemented, review requested.

@ivanperez-keera ivanperez-keera added CR:Status:Verification Admin only: Change request that is currently being verified and removed CR:Status:Implementation Admin only: Change request that is currently being implemented labels Nov 22, 2023
@ivanperez-keera
Copy link
Member Author

Change Manager: Verified that:

  • Solution is implemented:
    • The code proposed compiles passes the tests. Details:
      Docker image:

      FROM ubuntu:trusty
      
      RUN apt-get update
      
      RUN apt-get install --yes software-properties-common
      RUN add-apt-repository ppa:hvr/ghc
      RUN apt-get update
      
      RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4
      RUN apt-get install --yes libz-dev
      
      ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
      
      RUN cabal update
      RUN cabal v1-sandbox init
      RUN cabal v1-install alex happy
      RUN apt-get install --yes git
      
      # We install the application first and then test it, in case any tests need to
      # run the tool.
      CMD git clone $REPO && \
          cd $NAME && \
          git checkout $COMMIT && \
          cd .. && \
          cabal v1-install $NAME/$PAT**/ --enable-tests && \
          cabal v1-install $NAME/$PAT**/ --enable-tests --run-tests -j1

      Command:

      $ docker run -e "REPO=https://github.com/ivanperez-keera/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=96bc35da1452014de074ec13361048a9cb9d787f" -it ogma-test
    • The solution proposed fixes the issues described. Details:
      The following Dockerfile searches for all mentions of the sample app in all files, printing the word Success if none are found.

      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:

      $ docker run -e "REPO=https://github.com/ivanperez-keera/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=96bc35da1452014de074ec13361048a9cb9d787f" -it ogma-verify-105
  • Implementation is documented. Details:
    No changes needed.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    No examples affected.
  • Required version bumps are evaluated. Details:
    Bump needed (the generated app has a different name in cFS).

@ivanperez-keera
Copy link
Member Author

Change Manager: Implementation ready to be merged.

@ivanperez-keera ivanperez-keera added CR:Status:Closed Admin only: Change request that has been completed and removed CR:Status:Verification Admin only: Change request that is currently being verified labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CR:Status:Closed Admin only: Change request that has been completed CR:Type:Bug Admin only: Change request pertaining to error detected
Projects
None yet
Development

No branches or pull requests

1 participant