Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Fix GitLab CI Setup #8023

Merged
merged 29 commits into from
Apr 3, 2024
Merged

Development: Fix GitLab CI Setup #8023

merged 29 commits into from
Apr 3, 2024

Conversation

bensofficial
Copy link
Member

@bensofficial bensofficial commented Feb 12, 2024

Checklist

General

Server

Changes affecting Programming Exercises

  • I tested all changes and their related features with all corresponding user types on a test server configured with Gitlab and GitLab CI.

Motivation and Context

Experimental support for GitLab CI was introduced with #6044 quite a time ago.

Since then, different changes in Artemis and in GitLab itself made the implementation and documentation outdated. As we are further developing the integration of GitLab CI into Artemis, this PR cleans up the code and provides a working setup.

Description

  • Removed duplicated config options from docker compose file
  • Updated documentation
  • Removed gitlab profile from migration which only targets Jenkins
  • Set features correctly
  • Add yml to the end of the build plan URL
  • Improved the generation of the build plan id

Steps for Testing

There is no testing setup for GitLab CI yet. Thus you cannot test the code yourself (unless you want to set it up locally).

I tested the changes locally and on the (not ready to use) GitLab CI test server.

So, please only review the code!

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Summary by CodeRabbit

  • Documentation
    • Updated setup instructions for GitLab and GitLab Runner, including detailed steps for configuration and runner registration.
  • Refactor
    • Improved readability and consistency in GitHub actions scripts.
    • Adjusted logic for setting programming language features in GitLab CI.
    • Introduced enhancements in GitLab CI configuration, including a method for generating unique build plan IDs.

@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) documentation docker labels Feb 12, 2024
Copy link

⚠️ Unable to deploy to test servers ⚠️

The docker build needs to run through before deploying.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Feb 12, 2024
@bensofficial bensofficial removed the deployment-error Added by deployment workflows if an error occured label Feb 12, 2024
Copy link

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.

@github-actions github-actions bot added the stale label Mar 26, 2024
@bensofficial bensofficial marked this pull request as ready for review April 2, 2024 15:58
@bensofficial bensofficial requested a review from a team as a code owner April 2, 2024 15:58
Copy link

coderabbitai bot commented Apr 2, 2024

Walkthrough

This update introduces changes aimed at improving the integration and setup processes with GitLab and GitLab Runner, refining programming language feature settings, and enhancing deployment configurations. It includes updates for setting up GitLab CI, removing a specific profile for migration, adjusting programming language features, and extending GitLab CI service functionalities with new constants and methods for build plan management.

Changes

Files Summary
.github/workflows/testserver.yml
src/main/java/de/tum/in/www1/artemis/service/connectors/gitlabci/GitLabCIService.java
Added artemis-test10 environment configuration in GitHub actions script and the GITLAB_CI_FILE_EXTENSION constant; updated methods for build plan management.
docs/dev/setup/gitlabci-gitlab.rst Updated GitLab and GitLab Runner setup instructions, including modifications for host file entries, starting processes, obtaining credentials, allowing outbound requests, and runner registration.
src/main/java/de/tum/in/www1/artemis/config/migration/entries/MigrationEntry20230808_203400.java
src/main/java/de/tum/in/www1/artemis/service/connectors/gitlabci/GitLabCIProgrammingLanguageFeatureService.java
Removed "gitlab" from MIGRATABLE_PROFILES list and adjusted boolean values for programming language features for EMPTY and JAVA.

Possibly related issues

  • Progamming exercises, Gitlab/Jenkins: 6.5.0 migration does not remove webhooks of student repos #7233: The enhancements in GitLab CI service configuration and programming language feature adjustments might indirectly support resolving issues with job folder fetching in Jenkins and handling webhooks in GitLab, especially if these configurations impact the build process and webhook management.
  • Missing Build plans of imported exercise #7439: The updates in GitLab CI configuration and the new method for generating build plan IDs could potentially address inconsistencies with imported exercises and missing build plans by ensuring more reliable and identifiable connections between Artemis and GitLab CI, thus possibly mitigating issues related to exercise import and build plan management.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@bensofficial bensofficial requested review from krusche, Mtze and Hialus April 2, 2024 16:56
@bensofficial bensofficial added this to the 7.0.0 milestone Apr 2, 2024
Hialus
Hialus previously approved these changes Apr 2, 2024
Copy link
Member

@Hialus Hialus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good, I just left one question.

docs/dev/setup/gitlabci-gitlab.rst Show resolved Hide resolved
docs/dev/setup/gitlabci-gitlab.rst Outdated Show resolved Hide resolved
Add link to GitLab Runner Registration UI

Co-authored-by: Benedikt Fein <b-fein@users.noreply.github.com>
@bensofficial
Copy link
Member Author

@b-fein @Hialus Thank you for your reviews. I implemented your suggestions.

@krusche krusche merged commit 45ba674 into develop Apr 3, 2024
29 of 33 checks passed
@krusche krusche deleted the fix/gitlab-ci-setup branch April 3, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker documentation ready to merge server Pull requests that update Java code. (Added Automatically!) too-long-open !!! This is an antipattern, we should aim for small PRs that are only open for a short time !!!
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants