-
Notifications
You must be signed in to change notification settings - Fork 1
🚀 GitHub Code of Conduct Integration #4
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: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Daniel Ntege <[email protected]>
Signed-off-by: Daniel Ntege <[email protected]>
Signed-off-by: Daniel Ntege <[email protected]>
… and add GitHubClient implementation Signed-off-by: Daniel Ntege <[email protected]>
…perations for violation reports Signed-off-by: Daniel Ntege <[email protected]>
…d reporting functionalities; add AnalysisController, ConfigurationController, and ViolationReportController skeletons. Signed-off-by: Daniel Ntege <[email protected]>
src/main/java/com/openelements/conduct/api/dto/ViolationReportDto.java
Outdated
Show resolved
Hide resolved
src/main/java/com/openelements/conduct/api/dto/ViolationReportDto.java
Outdated
Show resolved
Hide resolved
src/main/java/com/openelements/conduct/api/dto/ViolationReportDto.java
Outdated
Show resolved
Hide resolved
src/main/java/com/openelements/conduct/controller/ViolationReportController.java
Show resolved
Hide resolved
src/main/java/com/openelements/conduct/integration/github/GitHubClient.java
Show resolved
Hide resolved
src/main/java/com/openelements/conduct/repository/ViolationReport.java
Outdated
Show resolved
Hide resolved
src/main/java/com/openelements/conduct/repository/ViolationReport.java
Outdated
Show resolved
Hide resolved
src/main/java/com/openelements/conduct/repository/ViolationReport.java
Outdated
Show resolved
Hide resolved
…gedResponse, TrendAnalysis, and ViolationReportDto Signed-off-by: Daniel Ntege <[email protected]>
hendrikebbers
left a comment
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.
Let's remove the TrendDto and Endpoint. The rest is really great!
| ); | ||
| } | ||
|
|
||
| public TrendSummaryDto generateTrendSummary() { |
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 like the AnalysisDto and assume that the containing numbers can be helpful. The TrendSummaryDto currently looks not that useful to me. I believe the best is to remove it for now and only use the AnalysisDto until we have a clear idea about trend analysis
…lysis, and ViolationReportDto; implement AnalysisController and ConfigurationController with endpoints for analysis and configuration retrieval, including validation logic. Signed-off-by: Daniel Ntege <[email protected]>
…lation reports and statistics; update ViolationReportService to fix message retrieval; add repository and API configuration properties. Signed-off-by: Daniel Ntege <[email protected]>
…nts as owner and Conduct-Guardian as repository Signed-off-by: Daniel Ntege <[email protected]>
…alysisService for new metrics and trends; implement TrendSummaryDto; modify ViolationReport and ViolationReportService for record usage; enhance AnalysisController for trend retrieval. Signed-off-by: Daniel Ntege <[email protected]>
…ntroller Signed-off-by: Daniel Ntege <[email protected]>
…te ViolationReportController to handle missing severity parameter in report retrieval. Signed-off-by: Daniel Ntege <[email protected]>
…oved pagination handling Signed-off-by: Daniel Ntege <[email protected]>
… to ensure default values are set correctly Signed-off-by: Daniel Ntege <[email protected]>
…oller Signed-off-by: Daniel Ntege <[email protected]>
…and AnalysisService` Signed-off-by: Daniel Ntege <[email protected]>
âś… Summary
This pull request implements support for dynamically retrieving a
CODE_OF_CONDUCT.mdfile directly from a specified GitHub repository. The system fetches, decodes, and serves the Code of Conduct at runtime using the GitHub REST API and integrates it into theCodeOfConductProviderinterface.📦 Key Features
Environment-based GitHub integration
Easily toggle this feature via the
guardian.integration.github.coc.enabledproperty.Customizable repository source
Configure the GitHub
ownerandrepothrough environment variables.Branch fallback logic
Searches for the CoC file across common branches (
main,master,staging) and.githubdirectory.Secure GitHub token support
Optional GitHub token support via
guardian.integration.github.coc.tokenfor private repositories or rate limit handling.Filename pattern recognition
Looks for multiple common variants of the CoC filename.
Pluggable
CodeOfConductProviderAutomatically overrides the default provider when the feature is enabled.
🛠️ New Files Added
GitHubClient.java– Interface for interacting with GitHub API.GitHubClientImpl.java– REST-based implementation usingRestTemplate.GitHubCodeOfConductProvider.java– Main class that locates, fetches, and decodes the CoC file.GitHubConfig.java– Spring configuration with conditional bean loading.⚙️ Configuration (
application.properties)