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

Dynamic Configuration with Admin Page + Artemis Teams #124

Open
wants to merge 39 commits into
base: develop
Choose a base branch
from

Conversation

GODrums
Copy link
Contributor

@GODrums GODrums commented Oct 20, 2024

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

  • Dynamic Configuration
    • Add persistent entity for application (server) config
    • Endpoints to access config in client
    • Rework meta endpoint with dynamic config
  • Admin Page /admin
    • Display and edit current config values
    • Rework UI elements with Spartan
    • Create nav-bar / side-menu for admin sub-pages
  • Artemis Teams
    • Create Team entities with dynamic members
    • Allow re-assigning members in admin page /admin/users
    • UI for adding / deleting teams
    • Add teams-filter to leaderboard
    • Automatic team assignments via PR activity

Follow-Ups

Refer to #160

Testing Instructions

  1. Start the application-server and webapp
  2. Login with your Github account (make sure it has the 'Admin'-role in Keycloak)
  3. Click on "Admin" in the top nav-bar
  4. Try changing some of the values in the admin area, such as the list of monitoried repositories
  5. Restart the application-server and control if your changes were persisted

Screenshots (if applicable)

image

Checklist

General

  • PR title is clear and descriptive
  • PR description explains the purpose and changes
  • Code follows project coding standards
  • Self-review of the code has been done
  • Changes have been tested locally
  • Screenshots have been attached (if applicable)
  • Documentation has been updated (if applicable)

Client (if applicable)

  • UI changes look good on all screen sizes and browsers
  • No console errors or warnings
  • User experience and accessibility have been tested
  • Added Storybook stories for new components
  • Components follow design system guidelines (if applicable)

Server (if applicable)

  • Code is performant and follows best practices
  • No security vulnerabilities introduced
  • Proper error handling has been implemented
  • Added tests for new functionality
  • Changes have been tested in different environments (if applicable)

@GODrums GODrums self-assigned this Oct 20, 2024
@github-actions github-actions bot added feature size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 20, 2024
@github-actions github-actions bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Oct 20, 2024
@GODrums GODrums marked this pull request as draft October 21, 2024 00:43
@github-actions github-actions bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Oct 21, 2024
@GODrums GODrums changed the title WIP: Dynamic Configuration with Admin Page + Artemis Teams Dynamic Configuration with Admin Page + Artemis Teams Oct 25, 2024
Copy link
Contributor

@iam-flo iam-flo left a comment

Choose a reason for hiding this comment

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

Too large to review

<div class="flex flex-col items-start gap-4">
<div class="w-1/2">
<h2 class="text-lg font-semibold mb-2">Repositories to monitor:</h2>
<textarea hlmInput [formControl]="repositoriesForm" class="block size-fit" style="field-sizing: content"></textarea>
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont like the textfield. Its is small and not easy to use, maybe we could have the repositories in a list of textfields, where you can edit each

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I should refactor this. At this point the PR is huge again, and there's so much stuff that could still be improved.

}
];

@Component({
Copy link
Contributor

Choose a reason for hiding this comment

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

if we cant edit the teams color, why have it in the table

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it should probably be editable.
I personally would prefer doing follow-up PRs for stuff like this to avoid keeping the same PR open for many weeks.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes thats fine, then we just need to collect all points in a new issue so we dont forget some. :)

<hlm-td class="font-medium tabular-nums flex gap-4" *brnCellDef="let element">
@for (team of element.teams; track team) {
@let label = { id: team.id, name: team.name, color: team.color ?? '69feff' };
<app-github-label [label]="label" [isLoading]="this.isLoading()" />
Copy link
Contributor

Choose a reason for hiding this comment

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

label maybe clickable for removal

@iam-flo
Copy link
Contributor

iam-flo commented Nov 11, 2024

We also need a LiquiBase:diff changeLog I think.

@GODrums
Copy link
Contributor Author

GODrums commented Nov 11, 2024

We also need a LiquiBase:diff changeLog I think.

Could you give me a quick overview for the workflow regarding Liquibase?

I assume npm run db:changelog:diff is required for the merge, but does that file need to be commited too or is everything executed on the prod-server?

@FelixTJDietrich
Copy link
Collaborator

We also need a LiquiBase:diff changeLog I think.

Could you give me a quick overview for the workflow regarding Liquibase?

I assume npm run db:changelog:diff is required for the merge, but does that file need to be commited too or is everything executed on the prod-server?

This file should be renamed and commited + added to the history. Please compare it with the Artemis codebase. If we don't commit it the server will not update its schema. In the future we can squash the changelog again if it gets too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application-server client enhancement New feature or request feature intelligence-service size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants