diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 521529f2d0..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: 'Kind: Bug' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 6c95a9d09b..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: 'Kind: Enhancement' -assignees: '' ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Eg. As a user of OpenSCD I want to ... - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Requirements** -What are the minimal requirements you need to have for this feature wish - -**Suggestions for a specific user interaction** -Have a specific UI gesture in mind? If you want to discuss this first, please provide your suggestion in the discussions field. - -**Additional information** -For further reading including e.g parts of IEC 61850, Tissues or other sources that triggered your feature wish - -**Test Files** -If possible provide a file that can be used to test the feature and explain what is the outcome of the test with the test file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 30b6f26b0a..0000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alliander N.V. -# -# SPDX-License-Identifier: Apache-2.0 - -version: 2 - -updates: - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - open-pull-requests-limit: 5 - - package-ecosystem: "docker" - directory: "packages/compas-open-scd/" - schedule: - interval: "daily" - open-pull-requests-limit: 5 diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index 334fc8dd55..0000000000 --- a/.github/release.yml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alliander N.V. -# -# SPDX-License-Identifier: Apache-2.0 - -changelog: - exclude: - labels: - - wontfix - - duplicate - - invalid - categories: - - title: New Features - labels: - - enhancement - - title: Bugfixes - labels: - - bug - - title: Tooling changes - labels: - - tooling - - title: Dependency updates - labels: - - dependencies - - title: Other Changes - labels: - - "*" diff --git a/.github/workflows/automate-projects.yml b/.github/workflows/automate-projects.yml deleted file mode 100644 index ec1a05dde5..0000000000 --- a/.github/workflows/automate-projects.yml +++ /dev/null @@ -1,28 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alliander N.V. -# -# SPDX-License-Identifier: Apache-2.0 - -name: Add issues and pull request to project boards - -on: [ issues, pull_request, pull_request_target ] - -jobs: - github-actions-automate-projects: - runs-on: ubuntu-latest - - if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} - steps: - - name: add-new-issues-to-organization-based-project-column - if: github.event_name == 'issues' && github.event.action == 'opened' - uses: alex-page/github-project-automation-plus@v0.9.0 - with: - project: CoMPAS Issues Overview Board - column: To do - repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} - - name: add-new-pull-request-to-organization-based-project-column - if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' - uses: alex-page/github-project-automation-plus@v0.9.0 - with: - project: CoMPAS Pull Request Overview Board - column: To do - repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml deleted file mode 100644 index ae47da8148..0000000000 --- a/.github/workflows/build-project.yml +++ /dev/null @@ -1,62 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alliander N.V. -# -# SPDX-License-Identifier: Apache-2.0 - -name: Build Project - -on: - push: - branches: - - '**' - pull_request: - branches: - - 'main' - -jobs: - build: - name: Build - runs-on: ubuntu-latest - timeout-minutes: 45 - - steps: - - name: Checkout - uses: actions/checkout@v4.1.4 - - - name: Cache Docker Register - if: ${{ github.event_name == 'pull_request' }} - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} - - - name: Set up Docker Buildx - id: buildx - if: ${{ github.event_name == 'pull_request' }} - uses: docker/setup-buildx-action@v3 - - name: Use Node.js 18.x - uses: actions/setup-node@v4 - with: - node-version: '18.x' - - - name: Test application with npm - timeout-minutes: 45 - if: ${{ github.event_name == 'push' }} - run: | - npm ci - npm run-script build - cd packages/compas-open-scd - npm run-script test - - - name: Build application with npm - if: ${{ github.event_name == 'pull_request' }} - timeout-minutes: 45 - run: | - npm ci - npm run-script build - - name: Build docker image - if: ${{ github.event_name == 'pull_request' }} - uses: docker/build-push-action@v5 - with: - # Set the context to use the packages/compas-open-scd directory and not execute it's own git checkout. - context: packages/compas-open-scd - push: false diff --git a/.github/workflows/release-project.yml b/.github/workflows/release-project.yml deleted file mode 100644 index 3a8e7f96e0..0000000000 --- a/.github/workflows/release-project.yml +++ /dev/null @@ -1,58 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Alliander N.V. -# -# SPDX-License-Identifier: Apache-2.0 - -name: Release Project - -on: - release: - types: [released] - -jobs: - push_to_registry: - name: Build and publish - runs-on: ubuntu-latest - timeout-minutes: 45 - - steps: - - name: Checkout - uses: actions/checkout@v4.1.4 - - - name: Cache Docker Register - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} - - - name: Extract tag name - id: extract_tagname - shell: bash - # Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/. - run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})" - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_TOKEN }} - - name: Use Node.js 18.x - uses: actions/setup-node@v4 - with: - node-version: '18.x' - - - name: Build application with npm - run: | - npm ci - npm run-script build - - name: Build and push docker image to Docker Hub - uses: docker/build-push-action@v5 - with: - # Set the context to use the packages/compas-open-scd directory and not execute it's own git checkout. - context: packages/compas-open-scd - push: true - # Tag the images using the tagname and also latest. - tags: | - lfenergy/compas-open-scd:${{ steps.extract_tagname.outputs.tagname }} - lfenergy/compas-open-scd:latest diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml deleted file mode 100644 index 9490538e96..0000000000 --- a/.github/workflows/stale-issues.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This workflow labels stale issues. -# -# For more information, see: -# https://github.com/actions/stale -name: Mark stale issues - -on: - workflow_dispatch: - schedule: - - cron: '0 19 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - permissions: - issues: write - - steps: - - uses: actions/stale@v9 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - days-before-stale: 60 - days-before-close: -1 - days-before-pr-stale: -1 - days-before-pr-close: -1 - - stale-issue-label: 'stale' - stale-issue-message: | - Hello there, - - Thank you for opening this issue! We appreciate your interest in our project. - However, it seems that this issue hasn't had any activity for a while. To ensure that our issue tracker remains organized and efficient, we occasionally review and address stale issues. - - If you believe this issue is still relevant and requires attention, please provide any additional context, updates, or details that might help us understand the problem better. - Feel free to continue the conversation here. - - If the issue is no longer relevant, you can simply close it. If you're uncertain, you can always reopen it later. - - Remember, our project thrives on community contributions, and your input matters. We're here to collaborate and improve. - Thank you for being part of this journey! - - - diff --git a/.github/workflows/sync-fork.yml b/.github/workflows/sync-fork.yml new file mode 100644 index 0000000000..42ba380546 --- /dev/null +++ b/.github/workflows/sync-fork.yml @@ -0,0 +1,89 @@ +name: Sync fork + +on: + workflow_dispatch: {} + schedule: + - cron: "15 3 * * *" # Run every day at 3:15 UTC + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout fork's default branch + uses: actions/checkout@v4 + with: + fetch-depth: 0 + path: "fork" + token: ${{ secrets.GH_PAT }} + - name: Checkout fork's configuration branch + uses: actions/checkout@v4 + with: + path: "configuration" + ref: "renovate-and-workflow-files" + token: ${{ secrets.GH_PAT }} + - name: Determine Upstream clone URL + id: upstream-repo-clone-url + uses: actions/github-script@v7 + with: + script: | + const { data } = await github.rest.repos.get({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + if (data.fork) { + return data.parent.clone_url; + } else { + throw new Error('This repository is not a fork.'); + } + result-encoding: string + - name: Determine Upstream default branch + id: upstream-repo-default-branch + uses: actions/github-script@v7 + with: + script: | + const { data } = await github.rest.repos.get({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + if (data.fork) { + return data.parent.default_branch; + } else { + throw new Error('This repository is not a fork.'); + } + result-encoding: string + - name: Sync fork with upstream + run: | + set -ex + cd fork + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git remote add upstream ${{ steps.upstream-repo-clone-url.outputs.result }} + git fetch upstream ${{ steps.upstream-repo-default-branch.outputs.result }} + UPSTREAM_MOST_RECENT_COMMIT_HASH=$(git log upstream/${{ steps.upstream-repo-default-branch.outputs.result }} -n 1 --format="%H") + PREVIOUS_SYNC_COMMIT_HASH=$(cat ../configuration/upstream_commit_hash) + if [ "$PREVIOUS_SYNC_COMMIT_HASH" = "$UPSTREAM_MOST_RECENT_COMMIT_HASH" ]; then + echo "No need to sync, already up-to-date" + exit 0 + fi + + git reset --hard upstream/${{ steps.upstream-repo-default-branch.outputs.result }} + # Enforce the usage of our own config (renovate.json5) + git rm renovate.json* || true + # Avoid problems where an existing .gitignore file would prevent committing our configuration files + git rm .gitignore || true + # Delete existing workflows, we don't need to run them in our fork + rm -rf .github || true + # Instead of using "cp -r", rsync allows us to exclude the .git directory + rsync -av --exclude '.git' ../configuration/ . + rm upstream_commit_hash + git add . + git commit -m "add Renovate and custom workflow files" + git push --force-with-lease + + cd ../configuration + # git config user.name "github-actions[bot]" + # git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + echo $UPSTREAM_MOST_RECENT_COMMIT_HASH > upstream_commit_hash + git add upstream_commit_hash + git commit -m "update commit hash to $UPSTREAM_MOST_RECENT_COMMIT_HASH" + git push diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml deleted file mode 100644 index d5ba8021ba..0000000000 --- a/.github/workflows/test-and-build.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Test and Build -on: pull_request - -jobs: - test-and-build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.1.4 - - - name: Use Node.js 18.x - uses: actions/setup-node@v4 - with: - node-version: "18.x" - - - name: Install and Test OpenSCD - run: | - npm ci - npm run-script build - cd packages/compas-open-scd - npm run-script test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 751830b3dd..0000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Test -on: - push: - branches-ignore: - - main - paths: - - packages/** - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.1.4 - - - name: Use Node.js 18.x - uses: actions/setup-node@v4 - with: - node-version: "18.x" - - - name: Install and Test - run: | - npm ci - npm run-script build - cd packages/compas-open-scd - npm run-script test diff --git a/.github/workflows/trivy-dependencies-submission.yml b/.github/workflows/trivy-dependencies-submission.yml new file mode 100644 index 0000000000..71f59af7e3 --- /dev/null +++ b/.github/workflows/trivy-dependencies-submission.yml @@ -0,0 +1,27 @@ +name: SBOM upload from Trivy + +on: + workflow_dispatch: {} + schedule: + - cron: "0 9 */5 * *" # Run every fifth day at 9 AM UTC + +jobs: + SBOM-upload: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Run Trivy vulnerability scanner in repo mode + uses: aquasecurity/trivy-action@0.23.0 + with: + scan-type: 'fs' + ignore-unfixed: true + format: 'github' + output: 'trivy-results.gsbom' + github-pat: ${{ secrets.GITHUB_TOKEN }} # this causes a curl call to upload the snapshot + + - name: Upload report file + uses: actions/upload-artifact@v4 + with: + name: trivy-results + path: trivy-results.gsbom diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 10dd2cb905..0000000000 --- a/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -## editors -/.idea -/.vscode - -## system files -.DS_Store - -## npm -node_modules/ -/npm-debug.log - -## testing -/coverage/ - -# build -/locales.ts -/locales -/dist -/custom-elements.json -/.tsbuildinfo -/.rollup.cache -/build - -# lerna -/lerna-debug.log - -.nx/cache diff --git a/package-lock.json b/package-lock.json index 2869bc6f78..f8c4ba171c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5053,9 +5053,10 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "16.18.60", - "dev": true, - "license": "MIT" + "version": "16.18.104", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.104.tgz", + "integrity": "sha512-OF3keVCbfPlkzxnnDBUZJn1RiCJzKeadjiW0xTEb0G1SUJ5gDVb3qnzZr2T4uIFvsbKJbXy1v2DN7e2zaEY7jQ==", + "dev": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.3", @@ -22009,7 +22010,7 @@ } }, "packages/compas-open-scd": { - "version": "0.33.0-6", + "version": "0.35.0-1", "license": "Apache-2.0", "dependencies": { "@material/mwc-dialog": "0.22.1", @@ -22093,7 +22094,7 @@ "@open-wc/eslint-config": "^7.0.0", "@open-wc/testing": "next", "@rollup/plugin-typescript": "^9.0.2", - "@types/node": "^18.11.9", + "@types/node": "^16.18.60", "@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/parser": "^5.30.7", "@web/dev-server": "^0.1.32", @@ -28161,7 +28162,7 @@ "@open-wc/lit-helpers": "^0.5.1", "@open-wc/testing": "next", "@rollup/plugin-typescript": "^9.0.2", - "@types/node": "^18.11.9", + "@types/node": "^16.18.60", "@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/parser": "^5.30.7", "@web/dev-server": "^0.1.32", @@ -28310,8 +28311,7 @@ } }, "@types/node": { - "version": "18.19.40", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.40.tgz", + "version": "https://registry.npmjs.org/@types/node/-/node-18.19.40.tgz", "integrity": "sha512-MIxieZHrm4Ee8XArBIc+Or9HINt2StOmCbgRcXGSJl8q14svRvkZPe7LJq9HKtTI1SK3wU8b91TjntUm7T69Pg==", "dev": true, "requires": { @@ -30749,7 +30749,9 @@ "dev": true }, "@types/node": { - "version": "16.18.60", + "version": "16.18.104", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.104.tgz", + "integrity": "sha512-OF3keVCbfPlkzxnnDBUZJn1RiCJzKeadjiW0xTEb0G1SUJ5gDVb3qnzZr2T4uIFvsbKJbXy1v2DN7e2zaEY7jQ==", "dev": true }, "@types/normalize-package-data": { diff --git a/packages/core/package.json b/packages/core/package.json index e8e82355ba..a478e4a082 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -46,7 +46,7 @@ "@open-wc/eslint-config": "^7.0.0", "@open-wc/testing": "next", "@rollup/plugin-typescript": "^9.0.2", - "@types/node": "^18.11.9", + "@types/node": "^16.18.60", "@typescript-eslint/eslint-plugin": "^5.30.7", "@typescript-eslint/parser": "^5.30.7", "@web/dev-server": "^0.1.32", diff --git a/renovate.json5 b/renovate.json5 new file mode 100644 index 0000000000..53fe2ac327 --- /dev/null +++ b/renovate.json5 @@ -0,0 +1,12 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended", + ":disableRateLimiting" + ], + "labels": ["dependencies", "depManager:{{{manager}}}"], + "vulnerabilityAlerts": { + "labels": ["security", "dependencies", "depManager:{{{manager}}}"], + }, + "forkProcessing": "enabled" +}