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: Add parsing of server sided endpoints #8455

Merged
merged 128 commits into from
Jun 4, 2024

Conversation

Jan-Thurner
Copy link
Contributor

@Jan-Thurner Jan-Thurner commented Apr 21, 2024

Context

This issue builds up on the GitHub action created in this PR. The action identifies the code files for client and server modified in a PR. The gathered Information will be the foundation of the analysis of server-sided endpoints. A concise

Problem

Many Artemis developers have little experience in the field of software development, and the Artemis codebase is extensive and complex. Thus, the code review process is time-consuming, difficult, and error-prone. The time required for purely manual reviewing leads to several disadvantages:

  • Delayed Development: Time-consuming tasks, like making sense of method names, endpoint URIs, and other crucial information on server-sided endpoints, can slow down the development process, potentially delaying the delivery of new features or updates.
  • Reduced Efficiency: Errors that are not discovered during the review process may lead to reduced usability and security concerns. Developers may need to spend additional time fixing mistakes, reducing overall efficiency.

Motivation

To make the review process more efficient for developers and maintainers and reduce the amount of undiscovered issues in the code, the review process needs to be partially automated. The time saved during the review process and the saved time by preventing bugs that need to be identified, debugged, and fixed manually, can be used for improving existing features or even developing new ones.


Requirements Engineering

Existing (Problematic) Solution / System

Currently, the review process is performed manually by multiple developers and maintainers, testing newly developed or modified features and reviewing changes made in the source code. For example, Changes in server-sided URIs that have not been migrated to every REST API call by the client will cause the features left out to malfunction. As there currently is no concise overview of all existing endpoints and REST calls, identifying endpoints in seemingly endless amounts of lines of code is overwhelming and tedious.

Proposed System

The new solution is the extension of a GitHub action. The action will run on every pushed commit and identify new or modified endpoints on the server. The Endpoints will be parsed out utilizing the QDox library. The action will output essential Information regarding the endpoints contained in modified files. The output information contains the endpoint's

  • Request Mapping
  • Name
  • HTTP Method
  • Path
  • Class
  • Line
  • All annotations

Requirements

Functional Requirements:

  1. FR: The GitHub action must display newly created or changed files containing endpoints on the server side.
  2. FR: The GitHub action must display the class RequestMapping if there is one.
  3. FR: The GitHub action must display every endpoint's name
  4. FR: The GitHub action must display every endpoint's HTTP method
  5. FR: The GitHub action must display every endpoint's class
  6. FR: The GitHub action must display every endpoint's line
  7. FR: The GitHub action must display all annotations of every endpoint

Nonfunctional Requirements:

  1. NFR: The action needs to be adaptable to changes in or new types of endpoints within 2 person-hours of work per changed endpoint.
  2. NFR: The action needs to provide the results within 10 Minutes.

Steps for Testing

  1. Push a commit with changed files containing one or more endpoints.
  2. Then take a look at the GitHub workflow and check if the output fulfills the requirements.
  3. Then revert the test changes again.
  4. An up-to-date test commit can be found here: https://github.com/ls1intum/Artemis/actions/runs/9330613868/job/25684362494?pr=8455

Review Progress

  • Code Review 1
  • Code Review 2
image

Also, change a file containing endpoints and one not containing endpoints for testing.
@github-actions github-actions bot added the server Pull requests that update Java code. (Added Automatically!) label Apr 21, 2024
Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

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

Code

Copy link
Contributor

@az108 az108 left a comment

Choose a reason for hiding this comment

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

Code LGTM

Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Code

Copy link
Contributor

@sarpsahinalp sarpsahinalp left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@MarkusPaulsen MarkusPaulsen left a comment

Choose a reason for hiding this comment

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

coderabbitai[bot]
coderabbitai bot previously requested changes Jun 3, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

@krusche krusche changed the title Development: Parsing of server sided endpoints Development: Add parsing of server sided endpoints Jun 4, 2024
@krusche krusche added this to the 7.1.2 milestone Jun 4, 2024
@krusche krusche merged commit 03e2b10 into develop Jun 4, 2024
26 of 36 checks passed
@krusche krusche deleted the development/parsing-of-server-sided-endpoints branch June 4, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-approved The feature maintainer has approved the PR ready for review 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
Status: Merged
Development

Successfully merging this pull request may close these issues.

Parsing of server sided endpoints