Artemis
Artemis copied to clipboard
`Programming exercises`: Build Plan API
Checklist
General
- [ ] 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.
- [x] Language: I followed the guidelines for inclusive, diversity-sensitive, and appreciative language.
- [x] I chose a title conforming to the naming conventions for pull requests.
Server
- [x] I followed the coding and design guidelines.
- [x] I added multiple integration tests (Spring) related to the features (with a high test coverage).
- [x] I added
@PreAuthorize
and checked the course groups for all new REST Calls (security). - [x] I implemented the changes with a good performance and prevented too many database calls.
- [ ] I documented the Java code using JavaDoc style.
Changes affecting Programming Exercises
- [ ] I tested all changes and their related features with all corresponding user types on Test Server 1 (Atlassian Suite).
- [ ] I tested all changes and their related features with all corresponding user types on Test Server 2 (Jenkins and Gitlab).
Motivation and Context
In GitLab CI the build configuration can be an external URL (https://docs.gitlab.com/ee/ci/pipelines/settings.html#specify-a-custom-cicd-configuration-file). This PR adds the corresponding API endpoint to access the build plan for a programming exercise.
Description
- Database change according to #5259
- On creation of a programming exercise the corresponding template build plan is added to the exercise. In GitLab CI the URL to the new API endpoint is stored. For each execution of the CI the build plan is fetched from the API.
Steps for Testing
! Please test this PR locally !
Prerequisites:
- Local GitLab instance with a Runner (See #4881 for setup)
- MySQL database
- Generate a personal access token with all scopes under http://localhost/-/profile/personal_access_tokens
- Create
application-local.yml
and adapt the password and the access token
artemis:
course-archives-path: ./exports/courses
repo-clone-path: ./repos
repo-download-clone-path: ./repos-download
encryption-password: artemis_admin # LEGACY: arbitrary password for encrypting database values
bcrypt-salt-rounds: 11 # The number of salt rounds for the bcrypt password hashing. Lower numbers make it faster but more unsecure and vice versa.
# Please use the bcrypt benchmark tool to determine the best number of rounds for your system. https://github.com/ls1intum/bcrypt-Benchmark
user-management:
use-external: false
internal-admin:
username: artemis_admin
password: artemis_admin
accept-terms: false
login:
account-name: TUM
version-control:
url: http://172.17.0.1:80
user: root
password: artemis_admin # Change here!
token: artemis-gitlab-token # Change here!
git:
name: Artemis
email: [email protected]
server:
port: 8080
url: http://172.17.0.1:8080 # `http://host.docker.internal:8080` for Windows
- Start Artemis with the
gitlabci
profile. UseArtemis (Server, GitLabCI & Gitlab)
in IntelliJ. - Open Artemis in your browser and create a new course.
- Generate a new programming exercise (with default configuration).
- Open the template, solution and test repository. In the template and solution repository CI should be enabled and configured. Go to
Settings
>CI/CD
>General Pipelines
and open the URL fromCI/CD configuration file
. This should be one of the template build configurations (Java, Empty) - Create another exercise with the same programming language. Check in the database, that the build plan is stored only once and referenced by both exercises (
SELECT p.id, p.build_plan_id FROM programming_exercise_details p;
andSELECT * FROM build_plan;
). - Push a change to the template or solution repository. Make sure GitLab CI successfully fetched the build plan from the API.
Review Progress
Code Review
- [ ] Review 1
- [ ] Review 2
Manual Tests
- [ ] Test 1
- [ ] Test 2
Test Coverage
Class/File | Branch | Line |
---|
@jpbernius @Mtze The PR is now ready for review.
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.