Compare commits

...
3 Commits
6 changed files with 17 additions and 641 deletions

No files matched your search

+2 -84
View File
@@ -1,86 +1,4 @@
# Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our 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 for our community include:
- **Being respectful and inclusive** of differing viewpoints and experiences
- **Accepting constructive criticism** gracefully
- **Focusing on what is best** for the community
- **Showing empathy** towards other community members
- **Being collaborative** and helping others learn and grow
- **Using welcoming and inclusive language** in all interactions
Examples of unacceptable behavior include:
- **Harassment** in any form, including sexual harassment
- **Trolling, insulting, or derogatory comments** and personal or political attacks
- **Public or private harassment** of any kind
- **Publishing others' private information** without explicit permission
- **Conduct that could reasonably be considered inappropriate** in a professional setting
- **Dismissing or attacking inclusion-oriented requests** or concerns
## Enforcement Responsibilities
Community leaders 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 with this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at **conduct@kingsrook.com**. 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.
## 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). Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
## Contact Information
- **Code of Conduct Issues**: conduct@kingsrook.com
- **General Contact**: contact@kingsrook.com
- **Company**: Kingsrook, LLC
- **Website**: https://qrun.io
---
**Thank you for helping create a welcoming and inclusive community!** 🌟
See Project level [Code of Conduct](https://github.com/Kingsrook/qqq/blob/develop/CODE_OF_CONDUCT.md)
+2 -306
View File
@@ -1,307 +1,3 @@
# Code Style Guide
This document outlines the coding standards and style guidelines for QQQ Orb development.
## 🎯 Overview
QQQ Orb follows consistent coding standards to ensure maintainability, readability, and reliability across all components.
## 📁 File Organization
### Directory Structure
```
src/
├── @orb.yml # Main orb definition
├── commands/ # Reusable commands
├── jobs/ # Complete workflow jobs
├── scripts/ # Shell scripts
├── executors/ # Execution environments
└── examples/ # Usage examples
```
### Naming Conventions
- **Files**: Use lowercase with underscores (`mvn_build.yml`)
- **Directories**: Use lowercase with underscores (`commands/`)
- **Variables**: Use uppercase with underscores (`MAVEN_USERNAME`)
- **Functions**: Use lowercase with underscores (`calculate_version`)
## 🔧 YAML Configuration
### General Guidelines
- **Indentation**: Use 2 spaces (no tabs)
- **Line Length**: Maximum 120 characters
- **Quotes**: Use single quotes for strings when possible
- **Comments**: Use `#` for comments, explain complex logic
### Orb Definition Structure
```yaml
# @orb.yml
version: 2.1
description: >
Brief description of the orb's purpose.
display:
home_url: "https://www.qrun.io"
source_url: "https://github.com/Kingsrook/qqq-orb"
orbs:
dependency-orb: circleci/dependency@1.0.0
```
### Command Structure
```yaml
# commands/example_command.yml
description: "Brief description of what this command does"
parameters:
param1:
type: string
default: "default_value"
description: "Parameter description"
steps:
- run:
name: "Step Name"
command: |
echo "Command content"
# Additional commands
```
### Job Structure
```yaml
# jobs/example_job.yml
description: "Brief description of what this job does"
executor: default
parameters:
param1:
type: string
default: "default_value"
description: "Parameter description"
steps:
- checkout
- qqq-orb/example-command:
param1: << parameters.param1 >>
```
## 🐚 Shell Scripts
### General Guidelines
- **Shebang**: Always use `#!/bin/bash`
- **Error Handling**: Use `set -euo pipefail`
- **Variables**: Use `readonly` for constants
- **Functions**: Use descriptive names and document parameters
### Script Template
```bash
#!/bin/bash
set -euo pipefail
# Script description
# Usage: script_name [options] [arguments]
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_NAME="$(basename "$0")"
# Function documentation
# Parameters: $1 - description, $2 - description
function example_function() {
local param1="$1"
local param2="$2"
# Function implementation
echo "Processing: $param1, $param2"
}
# Main execution
main() {
# Main logic here
example_function "value1" "value2"
}
# Run main function if script is executed directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi
```
### Error Handling
```bash
# Check if command exists
if ! command -v mvn &> /dev/null; then
echo "Error: Maven is not installed" >&2
exit 1
fi
# Check if file exists
if [[ ! -f "pom.xml" ]]; then
echo "Error: pom.xml not found" >&2
exit 1
fi
# Handle command failures
if ! mvn clean compile; then
echo "Error: Maven compilation failed" >&2
exit 1
fi
```
## 📝 Documentation
### README Structure
- **Title**: Clear, descriptive title
- **Badges**: Status badges for version, license, etc.
- **Overview**: Brief description of purpose
- **Quick Start**: Getting started instructions
- **Usage**: Detailed usage examples
- **Development**: Development setup and guidelines
- **Contributing**: Contribution guidelines
- **License**: License information
### Inline Documentation
```yaml
# commands/mvn_build.yml
description: >
Builds a Maven project with specified goals.
Supports multi-module projects and custom settings.
parameters:
goals:
type: string
default: "clean compile"
description: >
Maven goals to execute.
Common values: clean, compile, test, package, install
```
### Shell Script Documentation
```bash
#!/bin/bash
# Script: calculate_version.sh
# Description: Calculates semantic version based on GitFlow branch
# Usage: calculate_version.sh [branch_name]
# Parameters:
# branch_name - Git branch name (optional, defaults to current branch)
# Returns: Semantic version string
```
## 🧪 Testing Standards
### Test Structure
- **Unit Tests**: Test individual functions and commands
- **Integration Tests**: Test complete workflows
- **Validation Tests**: Test orb configuration and packing
### Test Naming
- **Test Files**: `test_<component>.yml`
- **Test Functions**: `test_<function_name>`
- **Test Descriptions**: Clear, descriptive test names
### Coverage Requirements
- **Commands**: All parameters and error conditions
- **Jobs**: All workflow paths and error handling
- **Scripts**: All functions and error conditions
## 🔍 Code Review Standards
### Review Checklist
- [ ] **Functionality**: Code works as intended
- [ ] **Style**: Follows project style guidelines
- [ ] **Documentation**: Adequate documentation and comments
- [ ] **Testing**: Appropriate test coverage
- [ ] **Security**: No security vulnerabilities
- [ ] **Performance**: Efficient implementation
- [ ] **Maintainability**: Code is maintainable and readable
### Review Process
1. **Self Review**: Author reviews their own code first
2. **Peer Review**: At least one peer review required
3. **Testing**: All tests must pass
4. **Documentation**: Documentation updated as needed
5. **Approval**: Required approvals before merge
## 🛠️ Development Tools
### Required Tools
- **CircleCI CLI**: For orb development and validation
- **ShellCheck**: For shell script linting
- **yamllint**: For YAML linting
- **Git**: For version control
### IDE Configuration
#### VS Code
```json
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.rulers": [120],
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"yaml.schemas": {
"https://json.schemastore.org/circle-ci-config.json": ".circleci/config.yml"
}
}
```
#### IntelliJ IDEA
- **Code Style**: Use project code style settings
- **File Templates**: Use project file templates
- **Inspections**: Enable all relevant inspections
## 📋 Best Practices
### General Principles
- **DRY**: Don't Repeat Yourself
- **KISS**: Keep It Simple, Stupid
- **YAGNI**: You Aren't Gonna Need It
- **SOLID**: Follow SOLID principles where applicable
### Security Considerations
- **Secrets**: Never commit secrets or credentials
- **Input Validation**: Validate all inputs
- **Error Handling**: Don't expose sensitive information in errors
- **Dependencies**: Keep dependencies up to date
### Performance Considerations
- **Efficiency**: Use efficient algorithms and data structures
- **Caching**: Cache expensive operations when appropriate
- **Parallelization**: Use parallel execution where beneficial
- **Resource Usage**: Minimize resource consumption
## 🔗 Resources
- **CircleCI Orb Development**: https://circleci.com/docs/2.0/orb-author-intro/
- **Shell Script Best Practices**: https://google.github.io/styleguide/shellguide.html
- **YAML Best Practices**: https://yaml.org/spec/1.2/spec.html
- **GitFlow Workflow**: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
---
**Remember**: Consistent code style improves maintainability and reduces bugs. When in doubt, follow existing patterns in the codebase.
* See Project [Code Style Guide](https://github.com/Kingsrook/qqq/blob/develop/CODE_STYLE.md)
+2 -134
View File
@@ -1,136 +1,4 @@
# Contributing to QQQ Orb
# Contributing to QBit User Role Permissions
First off, thanks for taking the time to contribute! ❤️
* See Project [Contributing](https://github.com/Kingsrook/qqq/blob/develop/CONTRIBUTING.md)
QQQ Orb is **open source** and welcomes contributions from the community. This document provides a quick overview - for detailed guides, see our [Complete Documentation Wiki](https://github.com/Kingsrook/qqq/wiki).
## 🚀 Quick Start
**New to QQQ?** Start with our [Developer Onboarding Guide](https://github.com/Kingsrook/qqq/wiki/Developer-Onboarding) to get your environment set up.
## 📚 Documentation & Guides
All detailed information is in our [Wiki](https://github.com/Kingsrook/qqq/wiki):
- **[🏠 Home](https://github.com/Kingsrook/qqq/wiki/Home)** - Project overview
- **[🔧 Development](https://github.com/Kingsrook/qqq/wiki/Developer-Onboarding)** - Complete setup guide
- **[📝 Contribution Process](https://github.com/Kingsrook/qqq/wiki/Contribution-Guidelines)** - Detailed contribution workflow
- **[🔍 Code Standards](https://github.com/Kingsrook/qqq/wiki/Code-Review-Standards)** - Coding standards and review process
- **[🧪 Testing](https://github.com/Kingsrook/qqq/wiki/Testing)** - Testing strategy and requirements
- **[🏗️ Architecture](https://github.com/Kingsrook/qqq/wiki/High-Level-Architecture)** - System design and principles
## 🤝 How to Contribute
### **1. Report Issues**
Found a bug or have a feature request? [Create an issue](https://github.com/Kingsrook/qqq/issues).
### **2. Code Contributions**
Want to contribute code? Follow our [Contribution Guidelines](https://github.com/Kingsrook/qqq/wiki/Contribution-Guidelines).
**Key Requirements:**
- CircleCI CLI and orb development tools
- Follow QQQ's [Code Review Standards](https://github.com/Kingsrook/qqq/wiki/Code-Review-Standards)
- Meet testing coverage requirements
- Use conventional commit messages
- Validate orb configuration with `make lint`
### **3. Documentation**
Improve our docs by updating the [Wiki](https://github.com/Kingsrook/qqq/wiki) or suggesting improvements via issues.
## 🔧 Development Setup
**Prerequisites:**
- **macOS** (QQQ dev tools are macOS-optimized)
- **CircleCI CLI** for orb development
- **ShellCheck** and **yamllint** for linting
- **Git** with SSH access
**Quick Setup:**
```bash
# Install CircleCI CLI
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/main/install.sh | sudo bash
# Install linting tools (macOS)
brew install shellcheck yamllint
# Clone the repository
git clone git@github.com:Kingsrook/qqq.git
cd qqq/qqq-orb
# Run development workflow
make dev
```
For complete setup instructions, see [Developer Onboarding](https://github.com/Kingsrook/qqq/wiki/Developer-Onboarding).
## 📋 Contribution Checklist
Before submitting your contribution:
- [ ] **Environment**: Development environment properly set up
- [ ] **Code Style**: Follows QQQ's [Code Review Standards](https://github.com/Kingsrook/qqq/wiki/Code-Review-Standards)
- [ ] **Testing**: All tests pass with `make test`
- [ ] **Linting**: All linting checks pass with `make lint`
- [ ] **Documentation**: Updated relevant wiki pages
- [ ] **Commit Messages**: Follow conventional commit format
- [ ] **Orb Validation**: Orb packs and validates successfully
## 🧪 Testing
### Running Tests
```bash
# Run all tests
make test
# Run linting checks
make lint
# Validate orb configuration
make validate
# Development workflow
make dev
```
### Test Coverage
The orb includes comprehensive testing:
- **YAML Validation**: CircleCI orb configuration validation
- **Shell Script Testing**: ShellCheck for shell script validation
- **Orb Packing**: Tests orb packing and resolution
- **Integration Testing**: End-to-end workflow testing
## 📦 Publishing
### Development Publishing
```bash
# Publish snapshot for testing
make publish-snapshot
```
### Production Publishing
```bash
# Publish production release
make publish-release
```
## 🆘 Getting Help
- **📖 [Wiki](https://github.com/Kingsrook/qqq/wiki)**: Start here for comprehensive guides
- **🐛 [Issues](https://github.com/Kingsrook/qqq/issues)**: Search existing issues or create new ones
- **💬 [Discussions](https://github.com/Kingsrook/qqq/discussions)**: Ask questions and get help
## 📄 Legal Notice
When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content, and that the content you contribute may be provided under the project license.
## 🏢 About Kingsrook
QQQ Orb is built by **[Kingsrook](https://qrun.io)** - making engineers more productive through intelligent automation and developer tools.
---
**Ready to contribute?** [Start with our Developer Onboarding Guide](https://github.com/Kingsrook/qqq/wiki/Developer-Onboarding)!
+2 -111
View File
@@ -1,112 +1,3 @@
# Security Policy
## Supported Versions
QQQ Orb follows semantic versioning and provides security updates for the following versions:
| Version | Supported | End of Life |
| ------- | ------------------ | ----------- |
| 2.1.x | :white_check_mark: | TBD |
| 2.0.x | :white_check_mark: | TBD |
| 1.x.x | :white_check_mark: | TBD |
| < 1.0 | :x: | EOL |
**Note**: We recommend using the latest stable version for security updates.
## Reporting a Vulnerability
**🚨 Security vulnerabilities should NEVER be reported publicly.**
If you discover a security vulnerability in QQQ Orb, please report it privately:
### **Email Security Reports**
Send security reports to: **security@kingsrook.com**
### **What to Include**
- **Description**: Clear description of the vulnerability
- **Impact**: Potential impact on users and CI/CD systems
- **Reproduction**: Steps to reproduce the issue
- **Environment**: QQQ Orb version, CircleCI version, OS details
- **Timeline**: If you need disclosure by a specific date
### **Response Timeline**
- **Initial Response**: Within 24 hours
- **Assessment**: Within 3 business days
- **Update**: Regular updates on progress
- **Resolution**: As quickly as possible based on severity
### **What Happens Next**
1. **Acknowledgment**: We'll acknowledge receipt within 24 hours
2. **Investigation**: Our security team will investigate the report
3. **Assessment**: We'll assess the severity and impact
4. **Fix Development**: Develop and test a security fix
5. **Release**: Release a security update
6. **Disclosure**: Public disclosure with credit (if requested)
## Security Best Practices
### **For Users**
- **Keep Updated**: Always use the latest stable version
- **Monitor Releases**: Watch for security advisories
- **Report Issues**: Report any security concerns immediately
- **Follow Guidelines**: Use QQQ Orb according to security best practices
- **Secure Contexts**: Ensure CircleCI contexts contain only necessary secrets
### **For Contributors**
- **Security Review**: All code changes undergo security review
- **Dependency Scanning**: Regular vulnerability scanning of dependencies
- **Secure Development**: Follow secure coding practices
- **Testing**: Security testing is part of our development process
- **Secret Management**: Never commit secrets or credentials
## Security Features
QQQ Orb includes several security features:
- **Input Validation**: Comprehensive input validation and sanitization
- **Secret Management**: Secure handling of CI/CD secrets and credentials
- **Audit Logging**: Comprehensive audit trails for CI/CD events
- **Secure Defaults**: Secure-by-default configuration
- **Dependency Scanning**: Regular scanning of orb dependencies
## Security Updates
### **Release Process**
Security updates follow our standard [Release Flow](https://github.com/Kingsrook/qqq/wiki/Release-Flow):
1. **Security Fix**: Develop and test security fix
2. **Release Branch**: Create release branch for security update
3. **Testing**: Thorough testing of security fix
4. **Release**: Release security update to users
5. **Communication**: Notify users of security update
### **Update Notifications**
- **GitHub Releases**: Security updates announced in release notes
- **Security Advisories**: GitHub security advisories for critical issues
- **Email Notifications**: Direct notifications for critical vulnerabilities
- **CircleCI Registry**: Updated orb versions in CircleCI registry
## CI/CD Security Considerations
### **CircleCI Context Security**
- **Minimal Permissions**: Use least-privilege access for contexts
- **Secret Rotation**: Regularly rotate secrets and credentials
- **Access Control**: Limit access to sensitive contexts
- **Audit Logs**: Monitor context usage and access
### **Orb Security**
- **Version Pinning**: Always pin specific orb versions
- **Source Verification**: Verify orb source and integrity
- **Regular Updates**: Keep orb versions up to date
- **Security Scanning**: Scan orb dependencies regularly
## Contact Information
- **Security Email**: security@kingsrook.com
- **General Contact**: contact@kingsrook.com
- **Company**: Kingsrook, LLC
- **Website**: https://qrun.io
---
**Thank you for helping keep QQQ Orb secure!** 🛡️
* See Project [Security Policy](https://github.com/Kingsrook/qqq/blob/develop/SECURITY.md)
+1 -5
View File
@@ -161,11 +161,7 @@ calculate_next_version() {
NEW_VERSION="$TAG_VERSION"
echo "Converting RC version to tag version: $NEW_VERSION"
else
#####################################################################
## Keep current version (might be ahead of tag) ##
#####################################################################
NEW_VERSION="$CURRENT_VERSION"
echo "Keeping current version (ahead of tag)"
NEW_VERSION="$LATEST_TAG"
fi
else
echo "Warning: Tag format not recognized: $LATEST_TAG"
+8 -1
View File
@@ -27,7 +27,14 @@ if [[ -n "$(git status --porcelain pom.xml)" ]]; then
NEW_VERSION=$(grep '<revision>' pom.xml | sed 's/.*<revision>//;s/<.*//')
git add pom.xml
git commit -m "Bump version to $NEW_VERSION [skip ci]"
git push origin "HEAD:${CIRCLE_BRANCH}"
if [ -n "$CIRCLE_BRANCH" ]; then
git push origin "HEAD:${CIRCLE_BRANCH}"
else
# Tag build: push to main (or your default branch)
git push origin HEAD:main
fi
echo "Version updated to: $NEW_VERSION and pushed"
else
echo "No version change needed"