Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bugfix/fix-manage-lecture-and-co…
Browse files Browse the repository at this point in the history
…urse-manage-authorities' into bugfix/fix-manage-lecture-and-course-manage-authorities
  • Loading branch information
JohannesStoehr committed Oct 20, 2023
2 parents 2b7cc73 + 9650fb6 commit 0d193b1
Show file tree
Hide file tree
Showing 79 changed files with 2,804 additions and 208 deletions.
29 changes: 21 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
<!-- If it's only a small change, testing it locally is acceptable and you may remove the first checkmark. If you are unsure, please test on the test servers. -->
- [ ] I tested **all** changes and their related features with **all** corresponding user types on a test server.
- [ ] This is a small issue that I tested locally and was confirmed by another developer on a test server.
- [ ] Language: I followed the [guidelines for inclusive, diversity-sensitive, and appreciative language](https://ls1intum.github.io/Artemis/dev/guidelines/language-guidelines/).
- [ ] I chose a title conforming to the [naming conventions for pull requests](https://ls1intum.github.io/Artemis/dev/development-process/#naming-conventions-for-github-pull-requests).
- [ ] Language: I followed the [guidelines for inclusive, diversity-sensitive, and appreciative language](https://docs.artemis.cit.tum.de/dev/guidelines/language-guidelines/).
- [ ] I chose a title conforming to the [naming conventions for pull requests](https://docs.artemis.cit.tum.de/dev/development-process/#naming-conventions-for-github-pull-requests).
#### Server
- [ ] **Important**: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
- [ ] I followed the [coding and design guidelines](https://ls1intum.github.io/Artemis/dev/guidelines/server/).
- [ ] I followed the [coding and design guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/server/).
- [ ] I added multiple integration tests (Spring) related to the features (with a high test coverage).
- [ ] I added pre-authorization annotations according to the [guidelines](https://ls1intum.github.io/Artemis/dev/guidelines/server/#rest-endpoint-best-practices-for-authorization) and checked the course groups for all new REST Calls (security).
- [ ] I added pre-authorization annotations according to the [guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/server/#rest-endpoint-best-practices-for-authorization) and checked the course groups for all new REST Calls (security).
- [ ] I documented the Java code using JavaDoc style.
#### Client
- [ ] **Important**: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
- [ ] I followed the [coding and design guidelines](https://ls1intum.github.io/Artemis/dev/guidelines/client/).
- [ ] Following the [theming guidelines](https://ls1intum.github.io/Artemis/dev/guidelines/client-design/), I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
- [ ] I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the [test guidelines](https://ls1intum.github.io/Artemis/dev/guidelines/client-tests/).
- [ ] I followed the [coding and design guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client/).
- [ ] Following the [theming guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client-design/), I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
- [ ] I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the [test guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client-tests/).
- [ ] I added `authorities` to all new routes and checked the course groups for displaying navigation elements (links, buttons).
- [ ] I documented the TypeScript code using JSDoc style.
- [ ] I added multiple screenshots/screencasts of my UI changes.
Expand Down Expand Up @@ -57,9 +57,22 @@ Prerequisites:

1. Log in to Artemis
2. Participate in the exam as a student
3. Make sure that the UI of the programming exercise in the exam mode stays unchanged. You can use the [exam mode documentation](https://ls1intum.github.io/Artemis/user/exam_mode/) as reference.
3. Make sure that the UI of the programming exercise in the exam mode stays unchanged. You can use the [exam mode documentation](https://docs.artemis.cit.tum.de/user/exam_mode/) as reference.
4. ...

### Testserver States
> [!NOTE]
> These badges show the state of the test servers.
> Green = Currently available, Red = Currently locked
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test1)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test2)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test3)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test4)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test5)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test6)
![](https://byob.yarr.is/ls1intum/Artemis/artemis-test9)

### Review Progress
<!-- Each Pull Request should be reviewed by at least two other developers. The code, the functionality (= manual test) and the exam mode need to be reviewed. -->
<!-- The reviewer or author check the following boxes depending on what was reviewed or tested. All boxes should be checked before merge. -->
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- 'docs/**'
- '.github/**'
- '!.github/workflows/build.yml'
- '!.github/workflows/testserver.yml'
push:
branches:
- develop
Expand Down
42 changes: 33 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,45 @@ jobs:
build-command: make html dirhtml
- uses: actions/upload-artifact@v3
with:
name: Documentation
name: documentation
path: docs/_build/html/
- uses: actions/upload-pages-artifact@v2
with:
path: docs/_build/dirhtml/

# Deployment job
deploy:
if: github.ref == 'refs/heads/develop'
environment:
name: github-pages
url: "https://ls1intum.github.io/Artemis"
name: documentation
url: "https://docs.artemis.cit.tum.de"
runs-on: ubuntu-latest
needs: docs
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: documentation
path: public
- name: Copy site to server
uses: appleboy/scp-action@master
with:
host: docs.artemis.cit.tum.de
username: ${{ secrets.DOCS_SSH_USER }}
key: ${{ secrets.DOCS_SSH_PRIVATE }}
proxy_host: ${{ secrets.PROXY_HOST }}
proxy_username: ${{ secrets.PROXY_USERNAME }}
proxy_key: ${{ secrets.PROXY_KEY }}
proxy_port: ${{ secrets.PROXY_PORT }}
source: "public"
target: ${{ secrets.DOCS_HOME }}
- name: Move site to www
uses: appleboy/ssh-action@master
with:
host: docs.artemis.cit.tum.de
username: ${{ secrets.DOCS_SSH_USER }}
key: ${{ secrets.DOCS_SSH_PRIVATE }}
proxy_host: ${{ secrets.PROXY_HOST }}
proxy_username: ${{ secrets.PROXY_USERNAME }}
proxy_key: ${{ secrets.PROXY_KEY }}
proxy_port: ${{ secrets.PROXY_PORT }}
script: |
rm -rf ${{ secrets.DOCS_WWW }}/*
mv -f public/* ${{ secrets.DOCS_WWW }}/
87 changes: 72 additions & 15 deletions .github/workflows/pullrequest-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,78 @@ jobs:
tag: pr-${{ github.event.pull_request.number }}
untagged-older-than: 28

# If a PR is closed it should no longer lock any testservers
remove-testserver-locks:
# 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:
- uses: actions-ecosystem/action-remove-labels@v1
- name: Process labels
id: process
uses: actions/github-script@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: |
lock:artemis-test1
lock:artemis-test2
lock:artemis-test3
lock:artemis-test4
lock:artemis-test5
lock:artemis-test6
lock:artemis-test7
lock:artemis-test8
lock:artemis-test9
lock:artemis-test10
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 }}
32 changes: 32 additions & 0 deletions .github/workflows/pullrequest-unlabeled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Pull Request Label Removal

on:
pull_request_target:
types:
- unlabeled

jobs:
update_badges:
name: Update test server badges
runs-on: ubuntu-latest

steps:
- name: Get badge id
id: env
uses: actions/github-script@v6
with:
script: |
const labelName = context.payload.label.name;
const badge = labelName.replace(/^lock:artemis-test/, '');
core.setOutput('BADGE', badge);
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update badge
uses: RubbaBoy/[email protected]
with:
NAME: "artemis-test${{ steps.env.outputs.BADGE }}"
LABEL: "artemis-test${{ steps.env.outputs.BADGE }}.artemis.cit.tum.de"
STATUS: ${{ github.event.pull_request.head.ref }}
COLOR: green
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 0d193b1

Please sign in to comment.