From 9555679602ac6c24e9983bfed5859f83261666eb Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Mon, 9 Sep 2024 20:10:22 -0400 Subject: [PATCH 1/3] From `docker-compose` to `docker compose` for #643 More details about GHA runner compatibility with old versus new docker compose commands in this discussion post. https://github.com/orgs/community/discussions/27185 --- src/content/module.mk | 2 +- src/examples/java/README.md | 8 ++++---- src/examples/javascript/README.md | 6 +++--- src/examples/module.mk | 6 +++--- src/examples/python/README.md | 8 ++++---- src/validations/CONTRIBUTING.md | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/content/module.mk b/src/content/module.mk index b3268ca37..78a6a72b1 100644 --- a/src/content/module.mk +++ b/src/content/module.mk @@ -9,7 +9,7 @@ OSCAL_DIR := vendor/oscal CICD_DIR_PATH := $(OSCAL_DIR)/build/ci-cd CONTENT_CONFIG_PATH := src/config -OSCAL_DOCKER := docker-compose -f $(OSCAL_DIR)/build/docker-compose.yml -f $(CONTENT_DIR)/docker-compose.yml +OSCAL_DOCKER := docker compose -f $(OSCAL_DIR)/build/docker-compose.yml -f $(CONTENT_DIR)/docker-compose.yml init-content: ## Initialize content build environment (build Docker image) @echo "Building Docker image for OSCAL content generation..." diff --git a/src/examples/java/README.md b/src/examples/java/README.md index 2a96eecc5..433322814 100644 --- a/src/examples/java/README.md +++ b/src/examples/java/README.md @@ -15,14 +15,14 @@ make build-validations ## Usage -This example uses Maven. You may run directly, or via the provided `docker-compose` configuration. +This example uses Maven. You may run directly, or via the provided `docker compose` configuration. ```bash mvn --help ``` ```bash -docker-compose run example mvn --help +docker compose run example mvn --help ``` ## Developer notes @@ -30,11 +30,11 @@ docker-compose run example mvn --help To run tests: ```bash -docker-compose run example mvn test +docker compose run example mvn test ``` To auto-format code: ```bash -docker-compose run example mvn com.coveo:fmt-maven-plugin:format +docker compose run example mvn com.coveo:fmt-maven-plugin:format ``` diff --git a/src/examples/javascript/README.md b/src/examples/javascript/README.md index b9ae96f03..9feb90cee 100644 --- a/src/examples/javascript/README.md +++ b/src/examples/javascript/README.md @@ -23,7 +23,7 @@ make build-validations To get a bash prompt within the container, run: ```bash -docker-compose run example bash -l +docker compose run example bash -l ``` You may now run and interact with the example code. @@ -33,11 +33,11 @@ You may now run and interact with the example code. To run tests, build the required Schematron XSLT to sef.json files and run the test script: ```bash -docker-compose run example npm run ./test.sh +docker compose run example npm run ./test.sh ``` To auto-format code: ```bash -docker-compose run example npm format +docker compose run example npm format ``` diff --git a/src/examples/module.mk b/src/examples/module.mk index 8881d0e3b..749cb471f 100644 --- a/src/examples/module.mk +++ b/src/examples/module.mk @@ -3,14 +3,14 @@ test-examples: test-example-java test-example-python test-example-javascript ## test-example-java: ## Test example Java project @echo "Verifying Java example..." cd src/examples/java && \ - docker-compose run example mvn test + docker compose run example mvn test test-example-python: ## Test example Python project @echo "Verifying Python example..." cd src/examples/python && \ - docker-compose run example pytest + docker compose run example pytest test-example-javascript: ## Test example Javascript project @echo "Verifying Javascript example..." cd src/examples/javascript && \ - docker-compose run example ./test.sh + docker compose run example ./test.sh diff --git a/src/examples/python/README.md b/src/examples/python/README.md index 1ac9716f9..fa322fd5e 100644 --- a/src/examples/python/README.md +++ b/src/examples/python/README.md @@ -19,7 +19,7 @@ make build-validations To get a bash prompt within the container, run: ```bash -docker-compose run example bash -l +docker compose run example bash -l ``` You may now run and interact with the example code. @@ -29,17 +29,17 @@ You may now run and interact with the example code. To run tests: ```bash -docker-compose run example pytest +docker compose run example pytest ``` To auto-format code: ```bash -docker-compose run example black +docker compose run example black ``` To type-check code: ```bash -docker-compose run example mypy . +docker compose run example mypy . ``` diff --git a/src/validations/CONTRIBUTING.md b/src/validations/CONTRIBUTING.md index 6c1c35863..5facb0528 100644 --- a/src/validations/CONTRIBUTING.md +++ b/src/validations/CONTRIBUTING.md @@ -59,10 +59,10 @@ Using the command with a different version of Saxon HE. *Note that you must down ./bin/validate_with_schematron.sh -f test/demo/FedRAMP-SSP-OSCAL-Template.xml -o ~/dev/report -v 10.8 ``` -Alternatively, you can also use `docker-compose` to execute the validation script, like so: +Alternatively, you can also use `docker compose` to execute the validation script, like so: ```sh -docker-compose run \ +docker compose run \ -w /root/src/validations \ validator \ ./bin/validate_with_schematron.sh -f ./test/demo/FedRAMP-SSP-OSCAL-Template.xml @@ -100,10 +100,10 @@ export TEST_DIR=$(pwd)/report/test The JUnit XML report will be stored in the path set in the `TEST_DIR` environment variable. -Alternatively, you can also use `docker-compose` to execute the test harness, like so: +Alternatively, you can also use `docker compose` to execute the test harness, like so: ```sh -docker-compose run \ +docker compose run \ -w /root/src/validations \ validator \ /root/vendor/xspec/bin/xspec.sh -s -j ./test/test_all.xspec From f4e1f6a0200d4a521c132c6a934aadd5d327ccb9 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Mon, 9 Sep 2024 20:22:08 -0400 Subject: [PATCH 2/3] Update obsolete actions/checkout actions for #643 Not all, but many, actions were pinned to old versions by tag and to an explicit SHA1 hash from the repo that are old enough to cause GHA error notices. Upgraded from these to current SHA1 hash for the most (692973e3d937129bcbf40652eb9f2f61becf3332) for recent v4.1.7 release. > The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/ > The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v2. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ Source: https://github.com/GSA/fedramp-automation/actions/runs/10783353551 --- .github/workflows/content-artifacts.yml | 2 +- .github/workflows/create-release.yml | 2 +- .github/workflows/run-tests.yml | 2 +- .github/workflows/runSchematronValidation.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/content-artifacts.yml b/.github/workflows/content-artifacts.yml index 0b71a7a30..e423225ab 100644 --- a/.github/workflows/content-artifacts.yml +++ b/.github/workflows/content-artifacts.yml @@ -20,7 +20,7 @@ jobs: name: Content Validation Checking, Conversion and Validation runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 with: path: git-content submodules: recursive diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 1a4f56930..e0d173128 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -9,7 +9,7 @@ jobs: steps: # Check-out the repository under $GITHUB_WORKSPACE - - uses: actions/checkout@v2 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - name: Read Node version from .nvmrc run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 4dcfca14c..25b8db90e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -24,7 +24,7 @@ jobs: steps: # Check-out the repository under $GITHUB_WORKSPACE - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - name: Read node version from `.nvmrc` file id: nvmrc diff --git a/.github/workflows/runSchematronValidation.yml b/.github/workflows/runSchematronValidation.yml index 1fcfb1c4c..9ccc86987 100644 --- a/.github/workflows/runSchematronValidation.yml +++ b/.github/workflows/runSchematronValidation.yml @@ -24,7 +24,7 @@ jobs: # Checkout repository and its submodules steps: # Check-out the repository under $GITHUB_WORKSPACE - - uses: actions/checkout@v2 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # Check-out submodules - name: Checkout submodules From e4461b776bcc6b067f20c2134124e97b2e3b016e Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Mon, 9 Sep 2024 20:42:39 -0400 Subject: [PATCH 3/3] Remove `version` from compose files for #643 This directive is now obsolete, causes more noise in the GHA workflow run logs. https://forums.docker.com/t/docker-compose-yml-version-is-obsolete/141313 --- src/content/docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/content/docker-compose.yml b/src/content/docker-compose.yml index a16e64caa..fd0c9cbd0 100644 --- a/src/content/docker-compose.yml +++ b/src/content/docker-compose.yml @@ -1,6 +1,5 @@ # This extends the OSCAL build container which should be located at: # ../../vendor/oscal/build/docker-compose.yml -version: '3' services: cli: volumes: