Contributing - DrHazemAli/AzureSoraSDK GitHub Wiki
Thank you for your interest in contributing to AzureSoraSDK! This guide will help you get started.
By participating in this project, you agree to abide by our Code of Conduct:
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive criticism
- Accept feedback gracefully
- Search existing issues to avoid duplicates
-
Create a new issue with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- SDK version and .NET version
- Code samples (without sensitive data)
- Check existing requests first
- Open a discussion to gauge interest
-
Create an issue with:
- Use case description
- Proposed API design
- Examples of how it would be used
# Fork on GitHub, then:
git clone https://github.com/your-username/AzureSoraSDK.git
cd AzureSoraSDK
git remote add upstream https://github.com/DrHazemAli/AzureSoraSDK.git
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-description
Follow our coding standards:
- Use meaningful variable and method names
- Add XML documentation comments
- Follow C# naming conventions
- Keep methods small and focused
[Fact]
public async Task YourMethod_WithCondition_ShouldBehaveExpected()
{
// Arrange
var client = CreateTestClient();
// Act
var result = await client.YourMethod();
// Assert
result.Should().NotBeNull();
}
dotnet test
git add .
git commit -m "feat: add support for custom video styles"
# or
git commit -m "fix: handle null prompt gracefully"
Follow conventional commits:
-
feat:
New feature -
fix:
Bug fix -
docs:
Documentation changes -
test:
Test additions/changes -
refactor:
Code refactoring -
chore:
Build/tooling changes
git push origin feature/your-feature-name
Then create a Pull Request on GitHub.
- .NET 6.0 SDK or higher
- Visual Studio 2022 or VS Code
- Git
dotnet build
# Run all tests
dotnet test
# Run with coverage
dotnet test --collect:"XPlat Code Coverage"
# Run specific tests
dotnet test --filter "FullyQualifiedName~SoraClientTests"
We use .editorconfig for consistent styling. Most IDEs will automatically apply these rules.
Key conventions:
- 4 spaces for indentation
- Opening braces on new line
-
var
for obvious types - Explicit types for ambiguous cases
Example:
public class VideoService
{
private readonly ISoraClient _client;
public VideoService(ISoraClient client)
{
_client = client ?? throw new ArgumentNullException(nameof(client));
}
public async Task<string> GenerateVideoAsync(string prompt)
{
if (string.IsNullOrWhiteSpace(prompt))
{
throw new ArgumentException("Prompt cannot be empty", nameof(prompt));
}
var jobId = await _client.SubmitVideoJobAsync(
"A sunset scene",
1280,
720,
nSeconds: 10);
return jobId;
}
}
Use conventional commit format:
feat: add batch video generation support
fix: correct URL format for API endpoints
docs: update configuration examples
Include:
- What changed
- Why it changed
- How to test it
- Related issue numbers
Template:
## Description
Brief description of changes
## Motivation
Why these changes are needed
## Testing
How to test these changes
Fixes #123
- Tests pass locally
- New tests added for new features
- Documentation updated
- CHANGELOG.md updated
- No breaking changes (or documented)
/// <summary>
/// Submits a video generation job to Azure OpenAI.
/// </summary>
/// <param name="prompt">The text prompt describing the video</param>
/// <param name="width">Video width in pixels (must be divisible by 8)</param>
/// <returns>The job ID for tracking the generation progress</returns>
/// <exception cref="SoraValidationException">Thrown when parameters are invalid</exception>
public async Task<string> SubmitVideoJobAsync(
string prompt,
int width,
int height,
int nSeconds)
{
// Implementation
}
When adding features, update relevant wiki pages:
- API Reference for new methods
- Configuration for new options
- Examples for usage scenarios
- Troubleshooting for common issues
- Update version in
.csproj
files - Update CHANGELOG.md
- Create a release tag
- Package will be automatically published to NuGet
- Discord: Join our community
- Discussions: Use GitHub Discussions
- Email: [email protected]
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes
- Given credit in documentation
By contributing, you agree that your contributions will be licensed under the MIT License.
Every contribution helps make AzureSoraSDK better. We appreciate your time and effort!