diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..ed298dc --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,96 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in the Cloudness community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +**Examples of behavior that contributes to a positive environment:** + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +- Focusing on what is best not just for us as individuals, but for the overall community +- Using welcoming and inclusive language +- Being patient with newcomers and helping them get started + +**Examples of unacceptable behavior:** + +- The use of sexualized language or imagery, and sexual attention or advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission +- Sustained disruption of discussions, issues, or pull requests +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders and maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, including: + +- GitHub repositories (issues, pull requests, discussions, code reviews) +- Official communication channels (Discord, Slack, mailing lists) +- Community events and meetups (virtual or in-person) +- Social media interactions when representing the project +- One-on-one communications related to community business + +This Code of Conduct also applies when an individual is officially representing the community in public spaces. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement: + +- **GitHub Issues**: [cloudness-io/cloudness/issues](https://github.com/cloudness-io/cloudness/issues) (for public reports) +- **GitHub Discussions**: [cloudness-io/cloudness/discussions](https://github.com/cloudness-io/cloudness/discussions) (for community discussion) +- **Email**: For private reports, contact the maintainers directly through GitHub + +All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Appeals + +If you believe you have been unfairly warned or banned, you may appeal the decision by contacting a different community leader with a concise description of your grievance. Appeals will be reviewed by maintainers not involved in the original decision. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html). + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..988727a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,329 @@ +# Contributing to Cloudness + +Thank you for your interest in contributing to Cloudness! We welcome contributions from the community and are grateful for your support. + +## Code of Conduct + +This project adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers. + +## How Can I Contribute? + +### Reporting Bugs + +Before creating bug reports, please check the [issue tracker](https://github.com/cloudness-io/cloudness/issues) to avoid duplicates. When you create a bug report, include as many details as possible: + +- **Use a clear and descriptive title** +- **Describe the exact steps to reproduce the problem** +- **Provide specific examples** (code snippets, screenshots, etc.) +- **Describe the behavior you observed and what you expected** +- **Include your environment details** (OS, Go version, Kubernetes version, etc.) + +**Bug Report Template:** + +```markdown +**Description:** +A clear description of the bug. + +**Steps to Reproduce:** +1. Go to '...' +2. Click on '...' +3. See error + +**Expected Behavior:** +What you expected to happen. + +**Actual Behavior:** +What actually happened. + +**Environment:** +- OS: [e.g., Ubuntu 22.04] +- Go Version: [e.g., 1.21.5] +- Cloudness Version: [e.g., v1.0.0] +- Kubernetes Version: [e.g., 1.28.0] + +**Additional Context:** +Add any other context, logs, or screenshots. +``` + +### Suggesting Enhancements + +Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion: + +- **Use a clear and descriptive title** +- **Provide a detailed description of the suggested enhancement** +- **Explain why this enhancement would be useful** +- **List examples of how it would be used** + +### Pull Requests + +We actively welcome your pull requests: + +1. **Fork the repository** and create your branch from `main` +2. **Follow the development setup** outlined below +3. **Make your changes** following our coding standards +4. **Add tests** if applicable +5. **Ensure all tests pass** +6. **Update documentation** if needed +7. **Submit a pull request** + +**Pull Request Guidelines:** + +- Keep PRs focused on a single feature or bug fix +- Write clear, descriptive commit messages +- Reference related issues in your PR description +- Ensure CI checks pass +- Request review from maintainers +- Be responsive to feedback + +## Development Setup + +### Prerequisites + +- Go 1.21 or higher +- Node.js (latest stable version) +- Docker (for local testing) +- Kubernetes cluster (for integration testing) +- PostgreSQL (for local development) + +### Setup Steps + +1. **Clone the repository:** + +```bash +git clone https://github.com/cloudness-io/cloudness.git +cd cloudness +``` + +1. **Install dependencies:** + +```bash +make dep +make tools +``` + +1. **Build the project:** + +```bash +make build +``` + +1. **Set up PostgreSQL:** + +```bash +docker run --name cloudness-pg \ + -e POSTGRES_PASSWORD=postgrespwd \ + -e POSTGRES_USER=cloudnessusr \ + -p 5432:5432 \ + -d postgres:latest +``` + +1. **Configure environment:** + +Create a `.env` file in the project root: + +```bash +CLOUDNESS_DATABASE_DRIVER=postgres +CLOUDNESS_DATABASE_HOST=localhost +CLOUDNESS_DATABASE_PORT=5432 +CLOUDNESS_DATABASE_NAME=cloudness +CLOUDNESS_DATABASE_USER=cloudnessusr +CLOUDNESS_DATABASE_PASSWORD=postgrespwd +CLOUDNESS_DEBUG=true +``` + +1. **Run the application:** + +```bash +./cloudness server .env +``` + +1. **Access the UI:** + +Open your browser at `http://localhost:8000` + +## Coding Standards + +### Go Code + +- Follow [Effective Go](https://golang.org/doc/effective_go.html) guidelines +- Use `gofmt` to format your code +- Run `go vet` to catch common mistakes +- Use meaningful variable and function names +- Add comments for exported functions and complex logic +- Keep functions small and focused + +**Example:** + +```go +// ProcessDeployment handles the deployment of an application to Kubernetes. +// It validates the deployment spec, creates necessary resources, and monitors +// the deployment status. +func ProcessDeployment(ctx context.Context, spec *DeploymentSpec) error { + if err := spec.Validate(); err != nil { + return fmt.Errorf("invalid deployment spec: %w", err) + } + + // Implementation... + return nil +} +``` + +### Frontend Code + +- Follow [Templ](https://templ.guide/) best practices for Go templates +- Use `templ fmt` to format template files +- Write semantic HTML in templ components +- Use Tailwind CSS utility classes consistently +- Keep components small and reusable +- Use Alpine.js for interactive elements when needed + +**Example:** + +```templ +package components + +import "github.com/cloudness-io/cloudness/types" + +// DeploymentCard renders a deployment card component +templ DeploymentCard(deployment *types.Deployment) { +
+

{ deployment.Name }

+

{ deployment.Status }

+
+} +``` + +### Commit Messages + +Use clear and meaningful commit messages following the [Conventional Commits](https://www.conventionalcommits.org/) format: + +``` +(): + + + +