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

Programming exercises: Feature Proposal - Store repository URLs without base path in the database #10318

Open
SimonEntholzer opened this issue Feb 13, 2025 · 0 comments
Labels
component:Programming core Pull requests that affect the corresponding module exercise Pull requests that affect the corresponding module feature-proposal This issue is a feature proposal lecture Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module

Comments

@SimonEntholzer
Copy link
Contributor

Feature Proposal

Spec Version 1.0.0

Context

The Participation table stores the repository URL of the repository, which contains the files.
Image

Problem

  • There is a lot of redundant information, as the basePath is the same for every repository URL.
  • Migrating the server to another domain can break access to repositories.

Motivation

Describe the motivation WHY the problem needs solving. Specify the affected users/roles.

  • Save space in the database
  • Making the stored repository independent of the domain of the Artemis server (e.g. if there's a change from ase.tum.de to tum.de, all the participations in the database need to be migrated, or if. e.g. the Gitlab instance changes location/domain)

Requirements Engineering

Existing (Problematic) Solution / System

Currently the whole repository URL is stored for a participation in the database.

Proposed System

Only store the Path of the repositories in the database.
Reconstruct the full URL from the path, and the server's base path, to provide it to the user.

Requirements

  1. FR: Users see clone URL: Users can still see the complete clone URL in the UI
  2. FR: Store only Path in db: The database column should only contain the repository path, and not the base URL.

Analysis

Analysis Object Model

  • The repositoryUri attribute in participation should be replaced with repositoryPath

System Architecture

  • Make sure, when a participation is loaded, the full clone URL is reconstructed from the path in the database and the servers base URL.

Subsystem Decomposition.

  • When the repository URL is extracted from the user's request to clone/pull/push, extract the path, and pass that further instead of the whole repository URL. (HTTPS: see LocalVCServletService.authenticateAndAuthorizeGitRequest SSH: see SshGitLocationResolverService.resolveRootDirectory)

Persistent Data Management

  • Create a migration to remove all the basepath prefixes from the repository_url column
  • rename the repository_url column to repository_path

UI/UX Design

No changes to the UI

@SimonEntholzer SimonEntholzer added component:Programming feature-proposal This issue is a feature proposal programming Pull requests that affect the corresponding module labels Feb 13, 2025
@github-actions github-actions bot added core Pull requests that affect the corresponding module exercise Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module labels Feb 13, 2025
@SimonEntholzer SimonEntholzer changed the title [Feature Proposal] Store repository URLs without base path in the database Programming exercises: Feature Proposal - Store repository URLs without base path in the database Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:Programming core Pull requests that affect the corresponding module exercise Pull requests that affect the corresponding module feature-proposal This issue is a feature proposal lecture Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module
Projects
None yet
Development

No branches or pull requests

1 participant