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

Refactor/adding contribution guide line #15

Merged
merged 3 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug Report
about: Create a report to help us improve NETCore.Keycloak
title: '[BUG] '
labels: 'bug'
assignees: ''
---

## 🐛 Bug Description
<!-- A clear and concise description of what the bug is -->

## 📝 Steps To Reproduce
1.
2.
3.

## ✅ Expected Behavior
<!-- What you expected to happen -->

## ❌ Actual Behavior
<!-- What actually happened -->

## 🔧 Environment
- NETCore.Keycloak Version:
- .NET Version:
- Keycloak Server Version:
- Operating System:

## 📚 Additional Context
<!-- Add any other context about the problem here -->

## 💡 Possible Solution
<!-- If you have suggestions on how to fix the bug -->

## 📸 Screenshots
<!-- If applicable, add screenshots to help explain your problem -->

## 📊 Logs
<!-- If applicable, add relevant log outputs -->
```
[Paste logs here]
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/docs_improvement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Documentation Improvement
about: Suggest improvements to NETCore.Keycloak documentation
title: '[DOCS] '
labels: 'documentation'
assignees: ''
---

## 📚 Documentation Area
<!-- Specify which documentation needs improvement (API docs, README, Wiki, etc.) -->

## 📝 Current Documentation
<!-- Describe what's currently in the documentation -->

## ✨ Proposed Changes
<!-- Describe what should be changed or added -->

## 🎯 Reason for Change
<!-- Why is this change needed? -->

## 📋 Additional Context
<!-- Add any other context about the documentation improvement -->

## ✅ Checklist
- [ ] Checked for existing documentation
- [ ] Provided clear examples (if applicable)
- [ ] Checked for technical accuracy
- [ ] Ensured proper formatting
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Feature Request
about: Suggest a new feature for NETCore.Keycloak
title: '[FEATURE] '
labels: 'enhancement'
assignees: ''
---

## ✨ Feature Description
<!-- A clear and concise description of the feature you're proposing -->

## 🎯 Use Case
<!-- Describe the use case(s) that this feature would address -->

## 💡 Proposed Solution
<!-- Describe your proposed solution and how it would work -->

## 🔄 Alternative Solutions
<!-- Describe any alternative solutions or features you've considered -->

## 📝 Additional Context
<!-- Add any other context, screenshots, or examples about the feature request -->

## ✅ Implementation Checklist
- [ ] Feature design document
- [ ] Unit tests
- [ ] Documentation updates
- [ ] API documentation (if applicable)
- [ ] Example code (if applicable)

## 🔗 Related Issues/PRs
<!-- Link any related issues or pull requests -->
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/refactor_proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Refactor Proposal
about: Propose code refactoring to improve NETCore.Keycloak
title: '[REFACTOR] '
labels: 'refactor'
assignees: ''
---

## 🔄 Refactor Scope
<!-- Describe which part of the codebase needs refactoring -->

## 📝 Current Implementation
<!-- Describe the current implementation and its issues -->

## ✨ Proposed Changes
<!-- Describe your proposed refactoring changes -->

## 🎯 Benefits
<!-- List the benefits of this refactoring -->

## ⚠️ Potential Risks
<!-- Describe any potential risks or challenges -->

## 📋 Implementation Plan
- [ ] Unit tests for new implementation
- [ ] Refactor implementation
- [ ] Update documentation
- [ ] Performance testing (if applicable)
- [ ] Migration guide (if breaking changes)

## 📚 Additional Context
<!-- Add any other context about the refactoring proposal -->
34 changes: 34 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug Fix
about: Submit a bug fix for NETCore.Keycloak
title: '[BUGFIX] '
labels: 'bug'
---

## 🐛 Bug Description
<!-- Link to the bug report issue and briefly describe the bug -->

## 🔧 Fix Description
<!-- Describe your fix and how it addresses the issue -->

## 🔍 Root Cause
<!-- Explain what caused the bug -->

## 🧪 Testing
<!-- Describe how you tested the fix -->

## ✅ Regression Tests
<!-- Describe the tests you've added to prevent regression -->

## 📋 Checklist
- [ ] I have followed the code style guidelines
- [ ] I have added regression tests
- [ ] I have updated documentation if needed
- [ ] I have added/updated XML documentation comments if needed
- [ ] I have verified the fix in my local environment

## 📚 Additional Context
<!-- Add any other context about the fix here -->

## 📸 Screenshots
<!-- If applicable, add screenshots to show the fix -->
34 changes: 34 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Documentation Update
about: Submit documentation changes for NETCore.Keycloak
title: '[DOCS] '
labels: 'documentation'
---

## 📚 Documentation Changes
<!-- Describe the documentation changes made -->

## 🔗 Related Issue
<!-- Link to related documentation issue if applicable -->

## 📋 Type of Change
<!-- What type of documentation change is this? -->
- [ ] New documentation
- [ ] Documentation update
- [ ] Fix typos/errors
- [ ] Improve clarity
- [ ] Add examples
- [ ] Other (please describe)

## ✅ Checklist
- [ ] I have checked for technical accuracy
- [ ] I have tested all code examples (if any)
- [ ] I have checked for proper formatting
- [ ] I have verified all links work
- [ ] I have run spellcheck

## 🖼️ Preview
<!-- If applicable, add screenshots or links to preview the changes -->

## 📝 Additional Notes
<!-- Any additional information that reviewers should know -->
38 changes: 38 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Feature Implementation
about: Submit a new feature to NETCore.Keycloak
title: '[FEATURE] '
labels: 'enhancement'
---

## ✨ Feature Description
<!-- Describe the feature you've implemented -->

## 🔗 Related Issue
<!-- Link to the feature request issue -->

## 🛠️ Implementation Details
<!-- Provide details about your implementation -->

## 🧪 Testing
<!-- Describe the tests you've added -->

## 📚 Documentation
<!-- List documentation changes made -->

## ⚠️ Breaking Changes
<!-- List any breaking changes and migration steps -->

## ✅ Checklist
- [ ] I have followed the code style guidelines
- [ ] I have added unit tests
- [ ] I have updated documentation
- [ ] I have added XML documentation comments
- [ ] I have tested the feature thoroughly
- [ ] I have added example code (if applicable)

## 📸 Screenshots
<!-- If applicable, add screenshots to showcase the feature -->

## 📝 Additional Notes
<!-- Any additional information that reviewers should know -->
37 changes: 37 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/hotfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Hotfix
about: Submit an urgent fix for NETCore.Keycloak
title: '[HOTFIX] '
labels: 'hotfix'
---

## 🚨 Emergency Description
<!-- Describe the critical issue being fixed -->

## 💥 Impact
<!-- Describe the impact of the issue on users -->

## 🔧 Fix Description
<!-- Describe your emergency fix -->

## ⚠️ Risk Assessment
<!-- Assess the risk of this hotfix -->

## 🧪 Testing
<!-- Describe how you tested the fix -->

## ✅ Verification Steps
<!-- Steps for reviewers to verify the fix -->

## 📋 Checklist
- [ ] I have followed the code style guidelines
- [ ] I have added tests
- [ ] I have updated documentation if needed
- [ ] I have tested in production-like environment
- [ ] I have considered potential side effects

## 🔄 Rollback Plan
<!-- Describe how to rollback this change if needed -->

## 📚 Additional Context
<!-- Add any other context about the hotfix here -->
2 changes: 1 addition & 1 deletion .github/workflows/branch_naming_policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Branch naming policy check
run: |
echo "${{ steps.extract_branch.outputs.branch }}"
[[ "${{ steps.extract_branch.outputs.branch }}" =~ ^[a-z0-9_]{5,50}$ ]] || exit 1
[[ "${{ steps.extract_branch.outputs.branch }}" =~ ^(feature|bugfix|hotfix|docs|refactor)/[a-z0-9_]{5,50}$ ]] || exit 1

- name: Close pull request and delete branch
if: failure()
Expand Down
91 changes: 91 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contributing to NETCore.Keycloak

We love your input! We want to make contributing to NETCore.Keycloak as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer

## Development Process

We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

### Branch Naming Convention

All branch names must follow this format:
```
(feature|bugfix|hotfix|docs|refactor)/[a-z0-9_]{5,50}
```

This means:
- Start with one of these prefixes: `feature/`, `bugfix/`, `hotfix/`, `docs/`, `refactor/`
- Followed by a description that:
- Is 5-50 characters long
- Uses only lowercase letters (a-z), numbers (0-9), and underscores (_)
- No spaces, hyphens, or special characters allowed

Examples:
- `feature/add_token_refresh`
- `bugfix/fix_auth_flow_123`
- `hotfix/security_patch_456`
- `docs/update_readme_789`
- `refactor/simplify_code_101`

### Pull Request Process

1. Fork the repo and create your branch from `main` following the branch naming convention
2. Ensure your code follows the existing code style and formatting rules defined in `.editorconfig`
3. Update the documentation if needed
4. Ensure all tests pass
5. Create a Pull Request with a clear title and description

### Code Style Guidelines

We use `.editorconfig` to maintain consistent coding styles. Some key points:
- Use tabs for indentation
- Maximum line length is 120 characters
- UTF-8 encoding
- Trim trailing whitespace
- Insert final newline
- Follow C# naming conventions
- Use proper spacing and bracing rules as defined in `.editorconfig`

#### Documentation Requirements
- All public APIs must be documented using XML documentation comments
- Documentation should follow the standard XML format:
```csharp
/// <summary>
/// Brief description of what the method/class does
/// </summary>
/// <param name="parameterName">Description of the parameter</param>
/// <returns>Description of the return value</returns>
/// <exception cref="ExceptionType">When the exception is thrown</exception>
```
- Include code examples in documentation when the usage is not immediately obvious
- Keep comments up to date with code changes
- Use clear and concise language
- Document non-obvious implementation details or business logic
- Include references to related documentation or external resources when applicable

### Commit Message Guidelines

- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line

### Security

- Never commit sensitive information (API keys, credentials, etc.)
- Follow SAST (Static Application Security Testing) rules defined in `.editorconfig`
- Report security vulnerabilities privately to the maintainers

## License

By contributing, you agree that your contributions will be licensed under the same license as the project.

## Questions?

Don't hesitate to open an issue for any questions or concerns.
2 changes: 1 addition & 1 deletion NETCore.Keycloak.Client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var token = await keycloakClient.Auth.GetClientCredentialsTokenAsync(
var users = await keycloakClient.Users.GetAsync(
"your-realm",
token.AccessToken,
new KcUserFilter { MaxResults = 10 });
new KcUserFilter { Max = 10 });
```
## 📄 License

Expand Down
Loading
Loading