Skip to content

Commit

Permalink
Development: Remove label based deployment logic and transition to He…
Browse files Browse the repository at this point in the history
…lios (#10260)
  • Loading branch information
egekocabas authored Feb 4, 2025
1 parent f77fb84 commit b015d33
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 502 deletions.
13 changes: 1 addition & 12 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 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.

28 changes: 0 additions & 28 deletions .github/workflows/testserver-locks.yml

This file was deleted.

Loading

0 comments on commit b015d33

Please sign in to comment.