Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/mvnw text eol=lf
*.cmd text eol=crlf
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
**Repository:** `management-node`
**Description:** `Details steps and information required to report issues with the software`
**SPDX-License-Identifier:** OGL-UK-3.0

---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
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.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Repository:** `management-node`
**Description:** `Details steps and information required to request new features within the software`
**SPDX-License-Identifier:** OGL-UK-3.0

---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
32 changes: 32 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Sensitive Credential Checks

- [ ] As the author of these changes, I have checked for any sensitive credentials prior to this review being requested.
- [ ] As a reviewer of these changes, I have checked for any sensitive credentials prior to approving this merge.

<!--- When merging the branch to dev please use the SQUASH AND MERGE --->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## Description

- Describe your changes in detail

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran. -->
<!--- How does your change affect other areas of the code, etc. -->

## Screenshots (if appropriate):

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] It contains only changes required by issue (does not contain other PR)
- [ ] Includes link to an issue (if apply)
- [ ] I have added tests to cover my changes.

76 changes: 76 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# SPDX-License-Identifier: Apache-2.0
# © Crown Copyright 2025. This work has been developed by the National Digital Twin Programme
# and is legally attributed to the Department for Business and Trade (UK) as the governing entity.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

name: Automated tests

on:
push:
branches:
- 'develop'
- 'main'
pull_request:
branches:
- 'develop'
- 'main'
workflow_call:

permissions:
contents: read

env:
MAVEN_CLI_OPTS: "--batch-mode --no-transfer-progress"

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: maven
server-password: 'GH_PACKAGES_PAT'
- name: Build and Test
env:
GH_PACKAGES_PAT: ${{ secrets.GH_PACKAGES_PAT }}
run: ./mvnw $MAVEN_CLI_OPTS verify
- name: Upload JaCoCo HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: target/site/jacoco
if-no-files-found: warn
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: maven
server-password: 'GH_PACKAGES_PAT'
- name: Lint
env:
GH_PACKAGES_PAT: ${{ secrets.GH_PACKAGES_PAT }}
run: ./mvnw $MAVEN_CLI_OPTS spotless:check

127 changes: 127 additions & 0 deletions .github/workflows/oss-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# SPDX-License-Identifier: Apache-2.0
# © Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity.

name: Run OSS check helper

on:
workflow_dispatch:

permissions:
contents: read

jobs:
oss-checks:
runs-on: ubuntu-latest

steps:
- name: Fetch GitHub App token for target repo
id: target_token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.OSPO_WORKFLOW_APP_ID }}
private-key: ${{ secrets.OSPO_WORKFLOW_PRIVATE_KEY }}
permission-contents: read

- name: Fetch GitHub App token for OSPO source repo (read-only)
id: ospo_token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.OSPO_WORKFLOW_APP_ID }}
private-key: ${{ secrets.OSPO_WORKFLOW_PRIVATE_KEY }}
owner: National-Digital-Twin
repositories: ospo-resources
permission-contents: read

- name: Checkout target repository
uses: actions/checkout@v5
with:
token: ${{ steps.target_token.outputs.token }}

- name: Checkout OSPO source repository
uses: actions/checkout@v5
with:
repository: National-Digital-Twin/ospo-resources
path: ospo-resources
token: ${{ steps.ospo_token.outputs.token }}

- name: Checkout archetypes source repository
uses: actions/checkout@v5
with:
repository: National-Digital-Twin/archetypes
path: archetypes

- name: Test for presence of OSS files and variation from templated content
run: |
missing_files=()
unchanged_files=()

while IFS= read -r file || [ -n "$file" ]; do
# Skip comments and empty lines
if [[ -z "$file" || "$file" == \#* ]]; then
continue
fi

target_path="$file"
archetypes_path="archetypes/$file"

if [ ! -f "$target_path" ]; then
echo "Missing OSS file in target repository: $target_path"
missing_files+=("$file")
elif cmp -s "$target_path" "$archetypes_path"; then
echo "OSS file unchanged from archetypes template: $target_path"
unchanged_files+=("$file")
else
echo "OSS file present and different from the archetypes template: $target_path"
fi
done < ospo-resources/oss-checklist-files.txt

echo ""
if [ ${#missing_files[@]} -ne 0 ]; then
echo "The following OSS required files are missing:"
printf '%s\n' "${missing_files[@]}"
fi

if [ ${#unchanged_files[@]} -ne 0 ]; then
echo "The following OSS required files are unchanged from the archetypes template:"
printf '%s\n' "${unchanged_files[@]}"
fi

if [ ${#missing_files[@]} -ne 0 ] || [ ${#unchanged_files[@]} -ne 0 ]; then
echo "OSS required file check failed."
exit 1
else
echo "All OSS files are present and have been updated from their original templated content."
fi

- name: Check GitHub template files are present
run: |
echo "Checking for pull request and issue template files"

missing_templates=()

files_to_check=(
".github/PULL_REQUEST_TEMPLATE.md"
".github/ISSUE_TEMPLATE/bug_report.md"
".github/ISSUE_TEMPLATE/feature_request.md"
)

for file in "${files_to_check[@]}"; do
if [ ! -f "$file" ]; then
missing_templates+=("$file")
fi
done

if [ ${#missing_templates[@]} -ne 0 ]; then
echo ""
echo "Required GitHub template files not found:"
printf ' - %s\n' "${missing_templates[@]}"
echo ""
echo "These files help improve project collaboration and are considered best practice."
echo "These need to be included in repository contents to improve the developer and repository consumer experience."

# Fail the job
echo "Missing required GitHub template files."
exit 1
else
echo "Required pull request and issue template files present."
fi
Loading
Loading