🚀 GitHub Code of Conduct Integration#4
Open
danielmarv wants to merge 17 commits intoOpenElements:mainfrom
Open
🚀 GitHub Code of Conduct Integration#4danielmarv wants to merge 17 commits intoOpenElements:mainfrom
danielmarv wants to merge 17 commits intoOpenElements:mainfrom
Conversation
Signed-off-by: Daniel Ntege <danientege785@gmail.com>
Signed-off-by: Daniel Ntege <danientege785@gmail.com>
Signed-off-by: Daniel Ntege <danientege785@gmail.com>
… and add GitHubClient implementation Signed-off-by: Daniel Ntege <danientege785@gmail.com>
…perations for violation reports Signed-off-by: Daniel Ntege <danientege785@gmail.com>
…d reporting functionalities; add AnalysisController, ConfigurationController, and ViolationReportController skeletons. Signed-off-by: Daniel Ntege <danientege785@gmail.com>
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 <danientege785@gmail.com>
Member
hendrikebbers
left a comment
There was a problem hiding this comment.
Let's remove the TrendDto and Endpoint. The rest is really great!
| ); | ||
| } | ||
|
|
||
| public TrendSummaryDto generateTrendSummary() { |
Member
There was a problem hiding this comment.
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 <danientege785@gmail.com>
…lation reports and statistics; update ViolationReportService to fix message retrieval; add repository and API configuration properties. Signed-off-by: Daniel Ntege <danientege785@gmail.com>
…nts as owner and Conduct-Guardian as repository Signed-off-by: Daniel Ntege <danientege785@gmail.com>
…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 <danientege785@gmail.com>
…ntroller Signed-off-by: Daniel Ntege <danientege785@gmail.com>
…te ViolationReportController to handle missing severity parameter in report retrieval. Signed-off-by: Daniel Ntege <danientege785@gmail.com>
…oved pagination handling Signed-off-by: Daniel Ntege <danientege785@gmail.com>
… to ensure default values are set correctly Signed-off-by: Daniel Ntege <danientege785@gmail.com>
…oller Signed-off-by: Daniel Ntege <danientege785@gmail.com>
…and AnalysisService` Signed-off-by: Daniel Ntege <danientege785@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ 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)