Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/lectures/disable-submit-button-on-…
Browse files Browse the repository at this point in the history
…invalid-form-add-tooltip
  • Loading branch information
laxerhd authored Feb 18, 2025
2 parents 2765770 + 898d80c commit b630299
Show file tree
Hide file tree
Showing 3,651 changed files with 70,455 additions and 60,761 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
15 changes: 2 additions & 13 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,7 @@ Prerequisites:
4. ...

### Testserver States
> [!NOTE]
> These badges show the state of the test servers.
> Green = Currently available, Red = Currently locked
> Click on the badges to get to the test servers.
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test1)](https://artemis-test1.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test2)](https://artemis-test2.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test3)](https://artemis-test3.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test4)](https://artemis-test4.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test5)](https://artemis-test5.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test6)](https://artemis-test6.artemis.cit.tum.de)
[![](https://byob.yarr.is/ls1intum/Artemis/artemis-test9)](https://artemis-test9.artemis.cit.tum.de)
You can manage test servers using [Helios](https://helios.aet.cit.tum.de/). Check environment statuses in the [environment list](https://helios.aet.cit.tum.de/repo/69562331/environment/list). To deploy to a test server, go to the [CI/CD](https://helios.aet.cit.tum.de/repo/69562331/ci-cd) page, find your PR or branch, and trigger the deployment.

### Review Progress
<!-- Each PR should be reviewed by at least two other developers. The code, the functionality (= manual test) and the exam mode need to be reviewed. -->
Expand All @@ -111,7 +100,7 @@ Prerequisites:
- [ ] Test 2

### Test Coverage
<!-- Please add the test coverages for all changed files modified in this PR here. You can use `supporting_script/generate_code_cov_table/generate_code_cov_table.py` to automatically generate the coverage table from the corresponding artefacts of your branch (follow the ReadMe for setup details). -->
<!-- Please add the test coverages for all changed files modified in this PR here. You can use `supporting_script/code-coverage/generate_code_cov_table/generate_code_cov_table.py` to automatically generate the coverage table from the corresponding artefacts of your branch (follow the ReadMe for setup details). -->
<!-- Alternatively you can execute the tests locally (see build.gradle and package.json) or look into the corresponding artefacts. -->
<!-- The line coverage must be above 90% for changes files, and you must use extensive and useful assertions for server tests and expect statements for client tests. -->
<!-- Note: Confirm in the last column that you have implemented extensive assertions for server tests and expect statements for client tests. -->
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ updates:

# Check for version updates for Python dependencies (coverage)
- package-ecosystem: "pip"
directory: "/supporting_scripts/generate_code_cov_table"
directory: "/supporting_scripts/code-coverage/generate_code_cov_table"
schedule:
interval: "weekly"
reviewers:
Expand Down
1 change: 0 additions & 1 deletion .github/issue-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ programming:
- build plan
- code hint
- \b(?<!\S)git(?!\S)\b
- testwise coverage
- \b(?<!\S)ide(?!\S)\b
- submission policy
- aeolus
Expand Down
196 changes: 90 additions & 106 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ on:
- 'docs/**'
- '.github/**'
- '!.github/workflows/build.yml'
- '!.github/workflows/testserver.yml'
- '!.github/workflows/testserver-deployment.yml'
- '!.github/workflows/staging-deployment.yml'
push:
branches:
- develop
Expand All @@ -31,118 +32,101 @@ on:
types:
- created

# Keep in sync with codeql-analysis.yml and test.yml and analysis-of-endpoint-connections.yml
env:
CI: true
node: 20
java: 21
RAW_URL: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}
# Keep this filename in sync with the filename environment variable (PR_AUTO_BUILD_FILE_NAME) in the testserver-deployment.yml workflow
# and with the build_workflow_name environment variable in the staging-deployment.yml workflow

jobs:

build:
name: Build .war artifact
define-inputs:
name: Define Inputs
runs-on: ubuntu-latest
outputs:
release_upload: ${{ steps.set-upload-release.outputs.release_upload }}
release_url: ${{ steps.set-upload-release.outputs.release_url }}
release_path: ${{ steps.set-upload-release.outputs.release_path }}
release_name: ${{ steps.set-upload-release.outputs.release_name }}
release_type: ${{ steps.set-upload-release.outputs.release_type }}
docker_build: ${{ steps.set-docker-build.outputs.docker_build }}
docker_ref: ${{ steps.set-docker-ref.outputs.docker_ref }}
docker_build_tag: ${{ steps.set-docker-tag.outputs.docker_build_tag }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '${{ env.node }}'
cache: 'npm'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '${{ env.java }}'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Production Build
run: ./gradlew -Pprod -Pwar clean bootWar
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Artemis.war
path: build/libs/Artemis-*.war
- name: Upload Release Artifact
if: github.event_name == 'release' && github.event.action == 'created'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/libs/Artemis-${{ github.event.release.tag_name }}.war
asset_name: Artemis.war
asset_content_type: application/x-webarchive
- name: Set Upload Release Artifact Outputs
id: set-upload-release
run: |
# If event is release created, set the release_upload flag and the release artifact details
if [[ "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == "created" ]]; then
echo "release_upload=true" >> $GITHUB_OUTPUT
echo "release_url=${{ github.event.release.upload_url }}" >> $GITHUB_OUTPUT
echo "release_path=build/libs/Artemis-${{ github.event.release.tag_name }}.war" >> $GITHUB_OUTPUT
echo "release_name=Artemis.war" >> $GITHUB_OUTPUT
echo "release_type=application/x-webarchive" >> $GITHUB_OUTPUT
else
echo "release_upload=false" >> $GITHUB_OUTPUT
fi
docker:
name: Build and Push Docker Image
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'ls1intum/Artemis' }}
runs-on: ubuntu-latest
steps:
- name: Compute Tag
uses: actions/github-script@v7
id: compute-tag
with:
result-encoding: string
script: |
if (context.eventName === "pull_request") {
return "pr-" + context.issue.number;
}
if (context.eventName === "release") {
return "latest";
}
if (context.eventName === "push") {
if (context.ref.startsWith("refs/tags/")) {
return context.ref.slice(10);
- name: Set Docker Build Flag
id: set-docker-build
run: |
if [[ ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'ls1intum/Artemis' }} ]]; then
echo "docker_build=true" >> $GITHUB_OUTPUT
else
echo "docker_build=false" >> $GITHUB_OUTPUT
fi
- name: Set Docker ref
if: ${{ steps.set-docker-build.outputs.docker_build == 'true' }}
id: set-docker-ref
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# Checkout pull request HEAD commit instead of merge commit
# this is done to include the correct branch and git information inside the build
echo "docker_ref=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "push" ]]; then
echo "docker_ref=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Compute Docker Tag
if: ${{ steps.set-docker-build.outputs.docker_build == 'true' }}
uses: actions/github-script@v7
id: compute-tag
with:
result-encoding: string
script: |
if (context.eventName === "pull_request") {
return "pr-" + context.issue.number;
}
if (context.eventName === "release") {
return "latest";
}
if (context.ref === "refs/heads/develop") {
return "develop";
if (context.eventName === "push") {
if (context.ref.startsWith("refs/tags/")) {
return context.ref.slice(10);
}
if (context.ref === "refs/heads/develop") {
return "develop";
}
}
}
return "FALSE";
- name: Git Checkout for PRs
if: ${{ github.event_name == 'pull_request' }}
# Checkout pull request HEAD commit instead of merge commit
# this is done to include the correct branch and git information inside the build
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Git Checkout for push actions
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Git Checkout for push actions
if: ${{ github.event_name == 'release' }}
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Build and Push to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: ${{ steps.compute-tag.outputs.result != 'FALSE' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push to GitHub Container Registry
uses: docker/build-push-action@v5
if: ${{ steps.compute-tag.outputs.result != 'FALSE' }}
with:
# beware that the linux/arm64 build from the registry is using an amd64 compiled .war file as
# the GitHub runners don't support arm64 and QEMU takes too long for emulating the build
platforms: linux/amd64,linux/arm64
file: ./docker/artemis/Dockerfile
context: .
tags: ghcr.io/ls1intum/artemis:${{ steps.compute-tag.outputs.result }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=min
return "FALSE";
- name: Set Docker Tag
id: set-docker-tag
run: |
if [[ ${{ steps.compute-tag.outputs.result != 'FALSE' }} ]]; then
echo "docker_build_tag=${{ steps.compute-tag.outputs.result }}" >> $GITHUB_OUTPUT
fi
# TODO: Push to Docker Hub (develop + tag)
# TODO: Push to Chair Harbour (??)
call-build-workflow:
name: Call Build Workflow
needs: define-inputs
uses: ./.github/workflows/reusable-build.yml
with:
build_war: true
release_upload: ${{ needs.define-inputs.outputs.release_upload == 'true' }}
release_url: ${{ needs.define-inputs.outputs.release_url }}
release_path: ${{ needs.define-inputs.outputs.release_path }}
release_name: ${{ needs.define-inputs.outputs.release_name }}
release_type: ${{ needs.define-inputs.outputs.release_type }}
docker: ${{ needs.define-inputs.outputs.docker_build == 'true' }}
docker_ref: ${{ needs.define-inputs.outputs.docker_ref }}
docker_build_tag: ${{ needs.define-inputs.outputs.docker_build_tag }}
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
# Keep in sync with build.yml and test.yml and analysis-of-endpoint-connections.yml
env:
CI: true
node: 20
node: 22
java: 21


Expand Down
76 changes: 0 additions & 76 deletions .github/workflows/pullrequest-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,79 +18,3 @@ jobs:
token: ${{ secrets.GH_TOKEN_ADD_TO_PROJECT }}
tag: pr-${{ github.event.pull_request.number }}
untagged-older-than: 28

# If a PR is closed the testserver lock should be removed and corresponding badges updated
process_labels:
name: Process labels
runs-on: ubuntu-latest
outputs:
labels: ${{ steps.process.outputs.labels }}
badges: ${{ steps.process.outputs.badges }}
steps:
- name: Process labels
id: process
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
const labelsToRemove = [];
const labelsToProcess = [];
// Get the PR number
const prNumber = context.payload.pull_request.number;
// Iterate through labels on the PR
for (const label of context.payload.pull_request.labels) {
const labelName = label.name;
const regex = /^lock:artemis-test(\d+)$/;
if (regex.test(labelName)) {
// Extract the part after "lock:" using capture groups
const extractedLabel = labelName.match(regex)[1];
labelsToProcess.push(extractedLabel);
labelsToRemove.push(labelName);
}
}
// Do something with the extracted labels
console.log('Badges to process:', labelsToProcess);
console.log('Labels to remove:', labelsToRemove);
// Use the labelsToRemove array to remove the matching labels
core.setOutput('badges', JSON.stringify(labelsToProcess));
core.setOutput('labels', labelsToRemove.join(', '));
remove_labels:
name: Remove labels
needs: process_labels
runs-on: ubuntu-latest
if: ${{ needs.process_labels.outputs.labels != '' }}

steps:
- name: Remove labels
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: ${{ needs.process_labels.outputs.labels }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

update_badges:
name: Update badges
needs: process_labels
runs-on: ubuntu-latest
strategy:
matrix:
badge: ${{ fromJson(needs.process_labels.outputs.badges) }}
if: ${{ needs.process_labels.outputs.labels != '' }}

steps:
- name: Update badge
uses: RubbaBoy/[email protected]
with:
NAME: "artemis-test${{ matrix.badge }}"
LABEL: "artemis-test${{ matrix.badge }}.artemis.cit.tum.de"
STATUS: ${{ github.event.pull_request.head.ref }}
COLOR: green
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 0 additions & 33 deletions .github/workflows/pullrequest-unlabeled.yml

This file was deleted.

Loading

0 comments on commit b630299

Please sign in to comment.