-
Notifications
You must be signed in to change notification settings - Fork 1
fix: implement environment cleanup in GitHubEnvironmentSyncService #828
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
base: staging
Are you sure you want to change the base?
Conversation
...ver/src/main/java/de/tum/cit/aet/helios/environment/github/GitHubEnvironmentSyncService.java
Show resolved
Hide resolved
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Added a method to remove environments from the local database that no longer exist in GitHub. Updated the EnvironmentService to call this new method and adjusted variable names for clarity. Added unit tests to ensure correct functionality of the environment deletion process.
c344796 to
d8db989
Compare
|
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. |
Added a method to remove environments from the local database that no longer exist in GitHub. Updated the EnvironmentService to call this new method and adjusted variable names for clarity. Added unit tests to ensure correct functionality of the environment deletion process.
Motivation
When environments are deleted from GitHub, they remain in the Helios local database. This causes inconsistencies between the GitHub repository state and the Helios database, leading to stale environment data that can confuse users and cause issues with environment synchronization.
This change ensures that when environments are synchronized from GitHub, any environments that have been deleted from GitHub are also removed from the local database, maintaining data consistency.
Description
Added environment cleanup functionality to the GitHub environment synchronization process:
New method
removeDeletedEnvironmentsinGitHubEnvironmentSyncService:Updated
EnvironmentService.syncRepositoryEnvironments():Code improvements:
gitHubEnvironmentDtoS→gitHubEnvironmentDtos)Comprehensive unit tests:
Testing Instructions
Prerequisites:
Flow:
Log in to Helios as a Developer or Admin
Navigate to Settings for a repository that has GitHub environments configured
Test environment synchronization with existing environments:
Test deletion of removed environments:
Test deletion of all environments:
Test with empty repository:
Verify logging:
Checklist
General
Server