-
Notifications
You must be signed in to change notification settings - Fork 1
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
Dynamic Configuration with Admin Page + Artemis Teams #124
Conversation
server/application-server/src/main/java/de/tum/in/www1/hephaestus/admin/AdminService.java
Outdated
Show resolved
Hide resolved
server/application-server/src/main/java/de/tum/in/www1/hephaestus/admin/AdminService.java
Outdated
Show resolved
Hide resolved
server/application-server/src/main/java/de/tum/in/www1/hephaestus/admin/AdminService.java
Outdated
Show resolved
Hide resolved
server/application-server/src/main/java/de/tum/in/www1/hephaestus/admin/AdminService.java
Outdated
Show resolved
Hide resolved
server/application-server/src/main/java/de/tum/in/www1/hephaestus/admin/AdminService.java
Outdated
Show resolved
Hide resolved
...application-server/src/main/java/de/tum/in/www1/hephaestus/gitprovider/team/TeamService.java
Outdated
Show resolved
Hide resolved
...application-server/src/main/java/de/tum/in/www1/hephaestus/gitprovider/team/TeamService.java
Outdated
Show resolved
Hide resolved
...pplication-server/src/main/java/de/tum/in/www1/hephaestus/syncing/GitHubDataSyncService.java
Outdated
Show resolved
Hide resolved
@@ -175,7 +178,7 @@ private String[] getSubjects() { | |||
.map(String::toLowerCase) | |||
.toArray(String[]::new); | |||
|
|||
return Arrays.stream(repositoriesToMonitor) | |||
return adminService.getAdminConfig().getRepositoriesToMonitor().stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in NatsConsumerService
are not sufficient to for NATS to send messages for dynamically changed repos during runtime. It runs once on startup and any further changes adding or removing a repo to monitor will not work as expected.
I think that we have to use consumerContext.getConsumerInfo().getConsumerConfiguration()
and update the filterSubjects
once the monitored repos change with streamContext.createOrUpdateConsumer
.
Alternatively, we can also move this dynamic configuration part of repos to monitor to a follow-up PR and remove it from this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Implemented this in d8cd507.
I added the AdminConfigChangedEvent
, which gets emitted when the repositories are updated. The NatsConsumerService
now listens for this event and updates the consumer accordingly. Unfortunately, I am getting NATS timeouts when updating the consumer - not sure if it's a Problem with my code or the server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try to take over this part and investigate 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here also the review for the client code. I think we still have to implement a lot of things in this PR before we should merge it.
Please get more familiar with tanstack query, especially in regards to mutations:
https://tanstack.com/query/latest/docs/framework/angular/guides/mutations
There is also a page on optimistic updates that might be of interest:
https://tanstack.com/query/latest/docs/framework/angular/guides/optimistic-updates
server/application-server/src/main/resources/db/changelog/1731511193057_changelog.xml
Outdated
Show resolved
Hide resolved
webapp/src/libs/ui/ui-button-helm/src/lib/hlm-button.directive.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will merge it for now, we can do the remaining things in a follow-up
Motivation
To accomodate for long-running production deployments, we want to be able to change the application configuation during runtime while keeping it persistent.
Instead of separating the leaderboard via repositories, we want to group users teams to acknowledge cross-repository development.
Description
/admin
/admin/users
Follow-Ups
Refer to #160
Testing Instructions
application-server
andwebapp
application-server
and control if your changes were persistedScreenshots (if applicable)
Checklist
General
Client (if applicable)
Server (if applicable)