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-cli: Provide uniform CLI #170

Closed
ivanperez-keera opened this issue Nov 22, 2024 · 6 comments
Closed

ogma-cli: Provide uniform CLI #170

ivanperez-keera opened this issue Nov 22, 2024 · 6 comments
Assignees
Labels
CR:Status:Closed Admin only: Change request that has been completed CR:Type:Feature Admin only: Change request pertaining to new features requested
Milestone

Comments

@ivanperez-keera
Copy link
Member

Description

The CLI of Ogma lacks uniformity: some commands are driven by the input format, others by the output format (e.g., ROS, cFS). To make Ogma easier to use, we should provide an interface that is driven by one or the other, but not both.

Type

  • Feature: Introduce new command.

Additional context

None.

Requester

  • Ivan Perez.

Method to check presence of bug

Not applicable (not a bug).

Expected result

Ogma provides commands for inputs support, or for outputs/targets supported, but not both.

Desired result

Ogma provides commands for inputs support, or for outputs/targets supported, but not both.

Proposed solution

Introduce new command standalone that implements the functionality currently supported by several commands to convert specs to Copilot.

Remove dedicated/redundant commands.

Adjust tests as needed to use the new interface.

Further notes

None.

@ivanperez-keera ivanperez-keera added CR:Status:Initiated Admin only: Change request that has been initiated CR:Type:Feature Admin only: Change request pertaining to new features requested labels Nov 22, 2024
@ivanperez-keera ivanperez-keera changed the title ogma-cli: Introduce standalone command ogma-cli: Provide uniform CLI Nov 22, 2024
@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, 2024
@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, 2024
@ivanperez-keera
Copy link
Member Author

Technical Lead: Issue scheduled for fixing in Ogma 1.5.

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, 2024
@ivanperez-keera ivanperez-keera added this to the 1.5.0 milestone Nov 22, 2024
@ivanperez-keera ivanperez-keera self-assigned this Nov 22, 2024
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
We want to make it possible to store the format specifications in
separate files, so that future versions of Ogma can read such
specifications from user-provided files.

This commit makes a JSONFormat readable, so that it can be easily read
from a file.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
@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, 2024
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
To make Ogma more easily extensible, we want to make it possible to
store the format specifications in individual files, so that they do not
have to be included with the code and they can be provided by users.

This commit makes a JSONFormat readable, so that it can be easily read
from a file.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
The CLI of Ogma lacks uniformity: some commands are driven by the input
format, others by the output format (e.g., ROS, cFS). To make Ogma
easier to use, we should provide an interface that is driven by one or
the other, but not both.

This commit introduces a new standalone command, at core level, that
produces an individual Copilot specification from an input file.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
The CLI of Ogma lacks uniformity: some commands are driven by the input
format, others by the output format (e.g., ROS, cFS). To make Ogma
easier to use, we should provide an interface that is driven by one or
the other, but not both.

A prior commit has introduced a new standalone command, at core level,
that produces an individual Copilot specification from an input file.

This commit exposes that command to the user via the CLI.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
The CLI of Ogma lacks uniformity: some commands are driven by the input
format, others by the output format (e.g., ROS, cFS). To make Ogma
easier to use, we should provide an interface that is driven by one or
the other, but not both.

A prior commit has introduced a new standalone command that can be used
to produce individual Copilot specs. This commit removes the commands
made redundant by that new command, at CLI level.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
The CLI of Ogma lacks uniformity: some commands are driven by the input
format, others by the output format (e.g., ROS, cFS). To make Ogma
easier to use, we should provide an interface that is driven by one or
the other, but not both.

A prior commit has introduced a new standalone command that can be used
to produce individual Copilot specs, and redundant commands have been
removed from the CLI. This commit removes the corresponding redundant
core commands.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
The CLI of Ogma lacks uniformity: some commands are driven by the input
format, others by the output format (e.g., ROS, cFS). To make Ogma
easier to use, we should provide an interface that is driven by one or
the other, but not both.

A prior commit has introduced a new standalone command that replaces two
prior existing commands.

This commit adjusts the core package tests to use the new standalone
command.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
The CLI of Ogma lacks uniformity: some commands are driven by the input
format, others by the output format (e.g., ROS, cFS). To make Ogma
easier to use, we should provide an interface that is driven by one or
the other, but not both.

A prior commit has introduced a new standalone command that replaces two
prior existing commands.

This commit adjusts the CLI package tests to use the new standalone
command.
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
ivanperez-keera added a commit to ivanperez-keera/ogma that referenced this issue Nov 22, 2024
@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, 2024
@ivanperez-keera
Copy link
Member Author

Change Manager: Verified that:

  • Solution is implemented:
    • The code proposed compiles and passes all tests. Details:
    • The solution proposed produces the expected result. Details:
      The following dockerfile uses the new standalone command to compile of the prior supported files, after which it prints the message "Success":
      FROM ubuntu:trusty
      
      ENV DEBIAN_FRONTEND=noninteractive
      
      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
      
      CMD git clone $REPO \
          && cd $NAME \
          && git checkout $COMMIT \
          && cd .. \
          && cabal v1-sandbox init \
          && cabal v1-install $NAME/$PAT**/ copilot-4.1 --constraint="aeson>=2.0.3.0" \
          && ./.cabal-sandbox/bin/ogma standalone --file-name $NAME/ogma-cli/examples/fret.json --input-format fcs > Spec.hs \
          && cabal v1-exec -- runhaskell -XPartialTypeSignatures -Wno-partial-type-signatures Spec.hs \
          && echo "Success"
      Command (substitute variables based on new path after merge):
      $ docker run -e "REPO=https://github.com/ivanperez-keera/ogma" -e "NAME=ogma" -e "PAT=ogma"  -e "COMMIT=c7d2dc64561d39adaed9cde0106e0841d11171ca" -it ogma-verify-170
      
  • Implementation is documented. Details:
    New modules include documentation. New commands include documentation and help messages.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    No updates needed.
  • Required version bumps are evaluated. Details:
    Bump needed; interface changes.

@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, 2024
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:Feature Admin only: Change request pertaining to new features requested
Projects
None yet
Development

No branches or pull requests

1 participant