Skip to content

Commit

Permalink
Merge branch 'main' into python_crc8
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-gomez-windhover committed Nov 22, 2024
2 parents a102801 + f6c5692 commit 7b0e35b
Show file tree
Hide file tree
Showing 1,410 changed files with 33,019 additions and 25,039 deletions.
10 changes: 8 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ OPENC3_SR_BUCKET_USERNAME=scriptrunnerminio
OPENC3_SR_BUCKET_PASSWORD=scriptrunnerminiopassword
OPENC3_SERVICE_PASSWORD=openc3service
# Build and repository settings
ALPINE_VERSION=3.18
ALPINE_BUILD=7
ALPINE_VERSION=3.19
ALPINE_BUILD=4
APK_URL=https://dl-cdn.alpinelinux.org
RUBYGEMS_URL=https://rubygems.org
PYPI_URL=https://pypi.org
Expand All @@ -58,6 +58,9 @@ OPENC3_CLOUD=local
# Change to arn:aws-us-gov for deploying to AWS Gov Cloud
OPENC3_AWS_ARN_PREFIX=arn:aws

# This can be used to set the default language for generators
# OPENC3_LANGUAGE=ruby

# Don't automatically make the tools bucket public read
# OPENC3_NO_BUCKET_POLICY=1

Expand All @@ -79,3 +82,6 @@ OPENC3_AWS_ARN_PREFIX=arn:aws
# OPENC3_NO_TOOLADMIN=1
# OPENC3_NO_BUCKETEXPLORER=1
# OPENC3_NO_DOCS=1

# Enables the --trusted-host flag when downloading python package from the PYPI_URL
# PIP_ENABLE_TRUSTED_HOST=1
2 changes: 1 addition & 1 deletion .github/workflows/build_ubi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
# cache: "yarn"
# cache-dependency-path: "**/yarn.lock"
- name: login to ironbank
Expand Down
51 changes: 33 additions & 18 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
pull_request:
branches: [main]

env:
OPENC3_API_PASSWORD: password

jobs:
openc3-cli:
if: ${{ github.actor != 'dependabot[bot]' }}
Expand Down Expand Up @@ -70,37 +73,49 @@ jobs:
run: |
set -e
### PLUGIN ###
./openc3.sh cliroot generate | grep "Unknown generator" || true
./openc3.sh cliroot generate plugin | grep "Usage" || true
./openc3.sh cliroot generate plugin cli-test
./openc3.sh cliroot generate plugin cli-test | grep "already exists" || true
./openc3.sh cli generate plugin | grep "Usage" || true
./openc3.sh cli generate plugin cli-test --ruby
./openc3.sh cli generate plugin cli-test --ruby | grep "already exists" || true
cd openc3-cosmos-cli-test
../openc3.sh cliroot rake build VERSION=1.0.0
../openc3.sh cliroot validate openc3-cosmos-cli-test-1.0.0.gem
../openc3.sh cli rake build VERSION=1.0.0
../openc3.sh cli validate openc3-cosmos-cli-test-1.0.0.gem
### TARGET ###
../openc3.sh cliroot generate target MY-cli
../openc3.sh cli generate target MY-cli --ruby
# Verify the target name 'MY_CLI' and lib filename 'my_cli.rb'
ls targets/MY_CLI/lib | grep my_cli.rb
../openc3.sh cliroot rake build VERSION=1.0.1
../openc3.sh cliroot validate openc3-cosmos-cli-test-1.0.1.gem
../openc3.sh cli rake build VERSION=1.0.1
../openc3.sh cli validate openc3-cosmos-cli-test-1.0.1.gem
### MICROSERVICE ###
../openc3.sh cliroot generate microservice background
../openc3.sh cli generate microservice background --ruby
# Verify the microservice name 'BACKGROUND' and filename 'background.rb'
ls microservices/BACKGROUND | grep background.rb
../openc3.sh cliroot rake build VERSION=1.0.2
../openc3.sh cliroot validate openc3-cosmos-cli-test-1.0.2.gem
../openc3.sh cli rake build VERSION=1.0.2
../openc3.sh cli validate openc3-cosmos-cli-test-1.0.2.gem
### CONVERSION ###
../openc3.sh cliroot generate conversion MY_CLI upcase
../openc3.sh cli generate conversion MY_CLI upcase --ruby
# Verify the conversion filename 'upcase_conversion.rb'
ls targets/MY_CLI/lib | grep upcase_conversion.rb
../openc3.sh cliroot rake build VERSION=1.0.3
../openc3.sh cliroot validate openc3-cosmos-cli-test-1.0.3.gem
../openc3.sh cli rake build VERSION=1.0.3
../openc3.sh cli validate openc3-cosmos-cli-test-1.0.3.gem
### LIMITS_RESPONSE ###
../openc3.sh cliroot generate limits_response MY_CLI example
../openc3.sh cli generate limits_response MY_CLI example --ruby
# Verify the conversion filename 'example_limits_response.rb'
ls targets/MY_CLI/lib | grep example_limits_response.rb
../openc3.sh cliroot rake build VERSION=1.0.3
../openc3.sh cliroot validate openc3-cosmos-cli-test-1.0.3.gem
../openc3.sh cli rake build VERSION=1.0.3
../openc3.sh cli validate openc3-cosmos-cli-test-1.0.3.gem
- name: openc3.sh cli script list, run, spawn
shell: 'script -q -e -c "bash {0}"'
run: |
set -e
docker exec -it cosmos-openc3-redis-1 sh -c "echo -e 'AUTH openc3 openc3password\nset OPENC3__TOKEN 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8' | redis-cli"
# list shows all the available file names
./openc3.sh cli script list | tee /dev/tty | grep "INST/procedures/stash.rb"
# spawning a script prints only a PID
./openc3.sh cli script spawn INST/procedures/checks.rb | grep -v "^\s*\d+\s*$"
# run a script that will fail and look for the failure message
./openc3.sh cli script run --wait 10 INST/procedures/checks.rb | tee /dev/tty | grep -q "script failed"
# run a script that will complete successfully
./openc3.sh cli script run INST/procedures/stash.rb | tee /dev/tty | grep "script complete"
- name: openc3.sh util save,load
shell: 'script -q -e -c "bash {0}"'
run: |
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
# cache: "yarn"
# cache-dependency-path: "**/yarn.lock"
- name: openc3.sh build
# This `shell` line is required to get around a known issue: https://github.com/actions/runner/issues/241#issuecomment-745902718
shell: 'script -q -e -c "bash {0}"'
run: ./openc3.sh build
- name: Install playwright dependencies
run: yarn; yarn playwright install --with-deps; yarn playwright --version
run: ./playwright.sh install-playwright
working-directory: playwright
- name: Check for test.only
run: yarn playwright test --list --forbid-only
Expand All @@ -53,24 +53,15 @@ jobs:
# Build a test plugin for playwright and a copy so we can 'upgrade'
- name: Build plugin
shell: 'script -q -e -c "bash {0}"'
run: |
./openc3.sh cliroot generate plugin PW_TEST
cd openc3-cosmos-pw-test
../openc3.sh cliroot generate target PW_TEST
../openc3.sh cliroot rake build VERSION=1.0.0
sudo cp openc3-cosmos-pw-test-1.0.0.gem openc3-cosmos-pw-test-1.0.1.gem
../openc3.sh cliroot validate openc3-cosmos-pw-test-1.0.0.gem
run: ./playwright.sh build-plugin
working-directory: playwright
# Ensure we're connected and running
- name: Wait for build
run: yarn playwright test --project=chromium tests/wait-for-build.spec.ts
working-directory: playwright
- name: Run Playwright tests
# Run separately to allow for parallelism
run: |
yarn playwright test --project=chromium --grep-invert enterprise
# Don't run against firefox in parallel because tests persist things
# in the backend and there are race conditions
# yarn playwright test --project=firefox
run: ./playwright.sh run-chromium --grep-invert='enterprise'
working-directory: playwright
- name: Generate coverage
run: yarn fixlinux; yarn cobertura
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/post_release_trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
required: true
type: string

# Workaround for https://github.com/aquasecurity/trivy-action/issues/389
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1

jobs:
openc3-scan:
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
environment: Release
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.QA_PAT }}
- name: Set up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
Expand All @@ -37,7 +39,7 @@ jobs:
working-directory: openc3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: "https://registry.npmjs.org"
- name: Set up Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -73,6 +75,7 @@ jobs:
with:
commit_message: "[Github Action] Update version to ${{ github.event.inputs.version }}"
tagging_message: "v${{ github.event.inputs.version }}"
push_options: --force
- name: Build Python Package
working-directory: openc3/python
run: python -m build
Expand Down Expand Up @@ -107,7 +110,7 @@ jobs:
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
- name: Publish python package
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Expand All @@ -132,3 +135,4 @@ jobs:
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[Github Action] Update version to ${{ github.event.inputs.next_version }}"
push_options: --force
20 changes: 20 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check Spelling

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
spelling:
name: Codespell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@v2
with:
# Skip generated code as well as cstol_converter which has false
# positivies on ADN and Adn
skip: ./docs,*.map,*.min.js,*.pem,*.bin,cstol_converter
ignore_words_file: .whitelist
5 changes: 5 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
pull_request:
branches: [main]

# Workaround for https://github.com/aquasecurity/trivy-action/issues/389
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db:1

jobs:
openc3-scan:
if: ${{ github.actor != 'dependabot[bot]' }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ typescript

developer.code-workspace
__pycache__

playwright/tests/enterprise
10 changes: 9 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Style:
# Style/GlobalVars:
# Enabled: false # We need globals in several places
# Style/MissingRespondToMissing:
# Enabled: false # TODO: We don't implement respond_to_missing? Should we?
# Enabled: false # We don't implement respond_to_missing?
# Style/TrailingUnderscoreVariable:
# Enabled: false # I prefer "result, _ = method()" to result, = method()"

Expand All @@ -40,3 +40,11 @@ Gemspec/RequireMFA:
# We use this in our APIs like WHITELIST ||= []
Lint/OrAssignmentToConstant:
Enabled: false
Lint/UnusedMethodArgument:
Enabled: false
# This rule doesn't allow for value.to_s(16)
Lint/RedundantStringCoercion:
Enabled: false
# This rule interferes with a lot of unit tests as well as json_accessor.rb
Lint/ConstantDefinitionInBlock:
Enabled: false
5 changes: 5 additions & 0 deletions .whitelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
assertin
xdescribe
xit
beforeAll
afterAll
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ The most commands can also take arguments. The current argument options when run

## Setup

To build you can use an environment variable `SSL_CERT_FILE` or it will default to use a public curl ca file. When you run setup it copys the `SSL_CERT_FILE` and will place a copy in the root of the openc3 repo as `cacert.pem`. These are needed to build the docker containers.
To build you can use an environment variable `SSL_CERT_FILE` or it will default to use a public curl ca file. When you run setup it copies the `SSL_CERT_FILE` and will place a copy in the root of the openc3 repo as `cacert.pem`. These are needed to build the docker containers.

If you're building and want to use a private Rubygems, NPM or APK server (e.g. Nexus) you can update the following environment variables: RUBYGEMS_URL, NPM_URL, APK_URL, and more in the .env file. Example values:

- ALPINE_VERSION=3.18
- ALPINE_BUILD=6
- ALPINE_BUILD=9
- RUBYGEMS_URL=https://rubygems.org
- NPM_URL=https://registry.npmjs.org
- APK_URL=http://dl-cdn.alpinelinux.org
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ After configuring OpenC3 COSMOS to talk to your hardware, you immediately can us

1. **Command Sender**

- Command Sender allows you to manually send one-off commands with conventient drop downs and descriptions of each command and command parameter.
- Command Sender allows you to manually send one-off commands with convenient drop downs and descriptions of each command and command parameter.

1. **Script Runner**

- Script Runner allows for running OpenC3 COSMOS test procedures or any other Ruby code from a graphical environment that highlights each line as it executes. At anytime during execution, the script can be paused or stopped. If a telemetry check fails or any other exception occurs, the script is immediately stopped and the user notified.

- Script Runner also allows you to break your operational or test procedures down into discreet test cases that each complete with either SUCCESS or FAILURE. After running, a script report is automatically created for you. Convenient features such as the ability to loop testing help get the kinks out of your system before formal runs.
- Script Runner also allows you to break your operational or test procedures down into discret test cases that each complete with either SUCCESS or FAILURE. After running, a script report is automatically created for you. Convenient features such as the ability to loop testing help get the kinks out of your system before formal runs.

1. **Packet Viewer**

Expand Down
5 changes: 0 additions & 5 deletions RELEASE.txt

This file was deleted.

Loading

0 comments on commit 7b0e35b

Please sign in to comment.