diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index ef90c9c..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,2 +0,0 @@ -# Hardware Management Team Members and Administrators -* @Cray-HPE/hardware-management @Cray-HPE/hardware-management-admin diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 10228c1..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,58 +0,0 @@ -### Summary and Scope - -EXPLAIN WHY THIS PR IS NECESSARY. WHAT IS IMPACTED? -IS THIS A NEW FEATURE OR CRITICAL BUG FIX? SUMMARIZE WHAT CHANGED. - -DOES THIS CHANGE INVOLVE ANY SCHEME CHANGES? Y/N - -REMINDER: HAVE YOU INCREMENTED VERSION NUMBERS? E.G., .spec, Chart.yaml, .version, CHANGELOG.md - -REMINDER 2: HAVE YOU UPDATED THE COPYRIGHT PER hpe GUIDELINES: (C) Copyright 2014-2021 Hewlett Packard Enterprise Development LP ? Y/N - -### Issues and Related PRs - -LIST AND CHARACTERIZE RELATIONSHIP TO JIRA ISSUES AND OTHER PULL REQUESTS. BE SURE LIST DEPENDENCIES. - -* Resolves CASM-XYZ -* Change will also be needed in `` -* Future work required by CASM-ABC -* Merge with `` -* Merge before `` -* Merge after `` - -### Testing - -LIST THE ENVIRONMENTS IN WHICH THESE CHANGES WERE TESTED. - -Tested on: - -* `` -* Craystack -* CMS base-box -* Virtual Shasta - -Were the install/upgrade based validation checks/tests run?(goss tests/install-validation doc) -Were continuous integration tests run? Y/N If not, Why? -Was an Upgrade tested? Y/N If not, Why? -Was a Downgrade tested? Y/N If not, Why? -If schema changes were part of this change, how were those handled in your upgrade/downgrade testing? - -WHAT WAS THE EXTENT OF TESTING PERFORMED? MANUAL VERSUS AUTOMATED TESTS (UNIT/SMOKE/OTHER) -HOW WERE CHANGES VERIFIED TO BE SUCCESSFUL? - -### Risks and Mitigations - -HAS A SECURITY AUDIT BEEN RUN? (./runSnyk.sh) -ARE THERE KNOWN ISSUES WITH THESE CHANGES? -ANY OTHER SPECIAL CONSIDERATIONS? - -INCLUDE THE FOLLOWING ITEMS THAT APPLY. LIST ADDITIONAL ITEMS AND PROVIDE MORE DETAILED INFORMATION AS APPROPRIATE. - -Requires: - -* Additional testing on bare-metal -* Compute nodes -* 3rd party software -* Broader integration testing -* Fresh install -* Platform upgrade diff --git a/.github/workflows/build_and_release_ct_image.yaml b/.github/workflows/build_and_release_ct_image.yaml deleted file mode 100644 index 8e9040c..0000000 --- a/.github/workflows/build_and_release_ct_image.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: Build and Publish CT Docker Images -on: - - push # Perform a build of the contents from the branch - - pull_request # Perform a build after merging with the target branch - - workflow_dispatch -jobs: - build_and_release: - uses: Cray-HPE/hms-build-image-workflows/.github/workflows/build_and_release_image.yaml@v2 - with: - image-name: cray-bss-hmth-test - docker-build-file: test/ct/Dockerfile #the test/ct/Dockerfile is what we want! - docker-build-context: test/ct - enable-pr-comment: true - secrets: inherit diff --git a/.github/workflows/build_and_release_image.yaml b/.github/workflows/build_and_release_image.yaml deleted file mode 100644 index ea25a3a..0000000 --- a/.github/workflows/build_and_release_image.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: Build and Publish Service Docker Images -on: - - push # Perform a build of the contents from the branch - - pull_request # Perform a build after merging with the target branch - - workflow_dispatch -jobs: - build_and_release: - uses: Cray-HPE/hms-build-image-workflows/.github/workflows/build_and_release_image.yaml@v2 - with: - image-name: cray-bss - enable-pr-comment: true - secrets: inherit diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml new file mode 100644 index 0000000..23daa39 --- /dev/null +++ b/.github/workflows/build_release.yml @@ -0,0 +1,64 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Release with goreleaser + +on: + push: + tags: + - v* +permissions: write-all # Necessary for creating containers + +jobs: + + build: + runs-on: ubuntu-latest + + steps: + - name: Set up Go 1.21 + uses: actions/setup-go@v5 + with: + go-version: 1.21 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Docker Login + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-tags: 1 + fetch-depth: 1 + - name: Unit Tests + run: go test -v ./... + - name: Release with goreleaser + uses: goreleaser/goreleaser-action@v5 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + version: latest + args: release --clean + id: goreleaser + - name: Process goreleaser output + id: process_goreleaser_output + run: | + echo "const fs = require('fs');" > process.js + echo 'const artifacts = ${{ steps.goreleaser.outputs.artifacts }}' >> process.js + echo "const firstNonNullDigest = artifacts.find(artifact => artifact.extra && artifact.extra.Digest != null)?.extra.Digest;" >> process.js + echo "console.log(firstNonNullDigest);" >> process.js + echo "fs.writeFileSync('digest.txt', firstNonNullDigest);" >> process.js + node process.js + echo "digest=$(cat digest.txt)" >> $GITHUB_OUTPUT + - name: Attest Binaries + uses: github-early-access/generate-build-provenance@main + with: + subject-path: dist/bss + - name: generate build provenance + uses: github-early-access/generate-build-provenance@main + with: + subject-name: ghcr.io/openchami/ochami-init + subject-digest: ${{ steps.process_goreleaser_output.outputs.digest }} + push-to-registry: true \ No newline at end of file diff --git a/.github/workflows/run_ct_test.yaml b/.github/workflows/run_ct_test.yaml deleted file mode 100644 index eec670a..0000000 --- a/.github/workflows/run_ct_test.yaml +++ /dev/null @@ -1,8 +0,0 @@ -name: Run CT Tests -on: [push, pull_request, workflow_dispatch] -jobs: - run_ct_test: - uses: Cray-HPE/hms-build-image-workflows/.github/workflows/run_ct_test.yaml@v2 - with: - runs-on: ubuntu-latest - secrets: inherit diff --git a/.github/workflows/run_open-api-tavern-coverage.yaml b/.github/workflows/run_open-api-tavern-coverage.yaml deleted file mode 100644 index 21da9a0..0000000 --- a/.github/workflows/run_open-api-tavern-coverage.yaml +++ /dev/null @@ -1,14 +0,0 @@ -name: Run Open-API Tavern Coverage -on: - - push # Perform a build of the contents from the branch - - pull_request # Perform a build after merging with the target branch - - workflow_dispatch -jobs: - build_and_release: - uses: Cray-HPE/open-api-tavern-coverage/.github/workflows/run_open-api-tavern-coverage.yaml@v2 - #the v1 tag exists now - with: - open-api-file: "api/swagger.yaml" - tavern-file-dir: "test/ct/api" - api-target-urls: "{bss_base_url}" - secrets: inherit diff --git a/.github/workflows/run_unit_test.yaml b/.github/workflows/run_unit_test.yaml deleted file mode 100644 index 611d60b..0000000 --- a/.github/workflows/run_unit_test.yaml +++ /dev/null @@ -1,8 +0,0 @@ -name: Run Unit Tests -on: [push, pull_request, workflow_dispatch] -jobs: - run_unit_test: - uses: Cray-HPE/hms-build-image-workflows/.github/workflows/run_unit_test.yaml@v2 - with: - runs-on: ubuntu-latest - secrets: inherit diff --git a/.github/workflows/unit_test.yaml b/.github/workflows/unit_test.yaml new file mode 100644 index 0000000..d7825e7 --- /dev/null +++ b/.github/workflows/unit_test.yaml @@ -0,0 +1,21 @@ + name: Run Unit Tests + on: [push, pull_request] + + jobs: + build: + defaults: + run: + working-directory: ./cmd/boot-script-service + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + - name: Install dependencies + run: go get . + - name: Test with the Go CLI + run: go test + \ No newline at end of file diff --git a/cmd/boot-script-service/main.go b/cmd/boot-script-service/main.go index 5714027..ddf3918 100644 --- a/cmd/boot-script-service/main.go +++ b/cmd/boot-script-service/main.go @@ -173,7 +173,7 @@ func sqlDefaultRetryConfig() (retryCount uint64, retryWait uint64, err error) { if envRetryCount != "" { retryCount, err = strconv.ParseUint(envRetryCount, 10, 64) if err != nil { - err = fmt.Errorf("ERROR: unable to parse SQL_RETRY_COUNT environment variable: ", err) + err = fmt.Errorf("ERROR: unable to parse SQL_RETRY_COUNT environment variable: %v", err) return kvDefaultRetryCount, kvDefaultRetryWait, err } } @@ -182,7 +182,7 @@ func sqlDefaultRetryConfig() (retryCount uint64, retryWait uint64, err error) { if envRetryWait != "" { retryWait, err = strconv.ParseUint(envRetryWait, 10, 64) if err != nil { - err = fmt.Errorf("ERROR: unable to parse SQL_RETRY_WAIT environment variable: ", err) + err = fmt.Errorf("ERROR: unable to parse SQL_RETRY_WAIT environment variable: %v", err) return kvDefaultRetryWait, kvDefaultRetryWait, err } }