Skip to content
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
28 changes: 28 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# CODEOWNERS file for Job Application Tracker
# This file defines who must review changes to specific parts of the codebase
# See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# Global default owners for all files
* @jonathan-trevino

# Lightning Web Components require extra review
force-app/main/default/lwc/ @jonathan-trevino
force-app/test/default/classes/ @jonathan-trevino

# Critical configuration files
package.json @jonathan-trevino
jest.config.js @jonathan-trevino
eslint.config.js @jonathan-trevino
.github/ @jonathan-trevino

# Metadata and permissions
force-app/main/default/permissionsets/ @jonathan-trevino
force-app/main/default/objects/ @jonathan-trevino

# CI/CD and automation
.github/workflows/ @jonathan-trevino
.husky/ @jonathan-trevino
scripts/ @jonathan-trevino

# Documentation
*.md @jonathan-trevino
75 changes: 75 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
## 📝 Description

Brief description of what this PR does and why.

## 🧪 Testing

- [ ] All Jest tests pass locally (`npm run test:unit`)
- [ ] ESLint passes (`npm run lint`)
- [ ] Prettier formatting is applied (`npm run format:check`)
- [ ] Manual testing completed for affected functionality
- [ ] Test coverage maintained or improved

## 📋 Type of Change

- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] 📝 Documentation update
- [ ] 🔧 Refactoring (no functional changes)
- [ ] 🧪 Test improvements

## 🔍 Changed Files

<!-- List the main files that were modified -->

- `force-app/main/default/lwc/...`
- `force-app/test/default/classes/...`

## ⚡ Performance Impact

- [ ] No performance impact expected
- [ ] Performance improvements included
- [ ] Potential performance concerns (explain below)

## 🔒 Security Considerations

- [ ] No security implications
- [ ] Security review required
- [ ] Permissions/access changes included

## 📱 Salesforce Metadata

- [ ] No metadata changes
- [ ] Custom objects modified
- [ ] Permission sets updated
- [ ] Layouts/page layouts changed
- [ ] Validation rules added/modified

## ✅ Pre-Submission Checklist

- [ ] Code follows project coding standards
- [ ] Self-review of code completed
- [ ] Comments added for complex logic
- [ ] No console.log statements in production code
- [ ] All related documentation updated
- [ ] Salesforce metadata follows naming conventions

## 📸 Screenshots (if applicable)

<!-- Add screenshots for UI changes -->

## 🔗 Related Issues

<!-- Link any related issues -->

- Closes #xxx
- Related to #xxx

## 🤝 Reviewer Notes

<!-- Any specific areas that need extra attention -->

---

**CI Pipeline Status**: This PR will be automatically tested with Jest, ESLint, and Prettier checks. All status checks must pass before merging.
83 changes: 83 additions & 0 deletions .github/scripts/setup-branch-protection.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Setup GitHub Branch Protection Rules (PowerShell)
# This script configures branch protection for the main branch

Write-Host "🔒 Setting up GitHub Branch Protection Rules..." -ForegroundColor Green

# Check if GitHub CLI is installed
if (-not (Get-Command gh -ErrorAction SilentlyContinue)) {
Write-Host "❌ GitHub CLI (gh) is not installed." -ForegroundColor Red
Write-Host "Please install it from: https://cli.github.com/" -ForegroundColor Yellow
exit 1
}

# Check if user is authenticated
$authStatus = gh auth status 2>&1
if ($LASTEXITCODE -ne 0) {
Write-Host "🔑 Please authenticate with GitHub CLI:" -ForegroundColor Yellow
gh auth login
}

# Get the repository info
$repo = gh repo view --json nameWithOwner --jq '.nameWithOwner'
Write-Host "📦 Repository: $repo" -ForegroundColor Green

# Set up branch protection rules for main branch
Write-Host "🛡️ Configuring branch protection for 'main'..." -ForegroundColor Green

$protectionConfig = @{
required_status_checks = @{
strict = $true
checks = @(
@{ context = "Run Tests (18.x)" },
@{ context = "Run Tests (20.x)" },
@{ context = "Code Quality Checks" }
)
}
enforce_admins = $true
required_pull_request_reviews = @{
required_approving_review_count = 1
dismiss_stale_reviews = $true
require_code_owner_reviews = $true
require_last_push_approval = $false
}
restrictions = $null
allow_force_pushes = $false
allow_deletions = $false
block_creations = $false
required_conversation_resolution = $true
} | ConvertTo-Json -Depth 10

try {
$result = gh api "repos/$repo/branches/main/protection" --method PUT --input - <<< $protectionConfig
Write-Host "✅ Branch protection rules configured successfully!" -ForegroundColor Green
}
catch {
Write-Host "❌ Failed to configure branch protection rules." -ForegroundColor Red
Write-Host "You may need to configure these manually in GitHub:" -ForegroundColor Yellow
Write-Host "1. Go to your repository on GitHub"
Write-Host "2. Click Settings > Branches"
Write-Host "3. Add a rule for the 'main' branch with the following settings:"
Write-Host " - Require a pull request before merging"
Write-Host " - Require approvals (1)"
Write-Host " - Dismiss stale reviews"
Write-Host " - Require review from CODEOWNERS"
Write-Host " - Require status checks to pass before merging"
Write-Host " - Require branches to be up to date before merging"
Write-Host " - Required status checks:"
Write-Host " * Run Tests (18.x)"
Write-Host " * Run Tests (20.x)"
Write-Host " * Code Quality Checks"
Write-Host " - Restrict pushes that create matching branches"
Write-Host " - Do not allow bypassing the above settings"
}

Write-Host "🎉 Setup complete!" -ForegroundColor Green
Write-Host "📋 Next steps:" -ForegroundColor Yellow
Write-Host "1. Push your changes to trigger the first CI run"
Write-Host "2. Create a test pull request to verify the protection rules"
Write-Host "3. Check that status checks appear and must pass before merging"
Write-Host ""
Write-Host "🔧 Manual verification:" -ForegroundColor Green
Write-Host "- Go to https://github.com/$repo/settings/branches"
Write-Host "- Verify the 'main' branch protection rule is active"
Write-Host "- Test with a pull request that breaks tests to confirm protection works"
88 changes: 88 additions & 0 deletions .github/scripts/setup-branch-protection.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash

# Setup GitHub Branch Protection Rules
# This script configures branch protection for the main branch

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

echo -e "${GREEN}🔒 Setting up GitHub Branch Protection Rules...${NC}"

# Check if GitHub CLI is installed
if ! command -v gh &> /dev/null; then
echo -e "${RED}❌ GitHub CLI (gh) is not installed.${NC}"
echo -e "${YELLOW}Please install it from: https://cli.github.com/${NC}"
exit 1
fi

# Check if user is authenticated
if ! gh auth status &> /dev/null; then
echo -e "${YELLOW}🔑 Please authenticate with GitHub CLI:${NC}"
gh auth login
fi

# Get the repository info
REPO=$(gh repo view --json nameWithOwner --jq '.nameWithOwner')
echo -e "${GREEN}📦 Repository: ${REPO}${NC}"

# Set up branch protection rules for main branch
echo -e "${GREEN}🛡️ Configuring branch protection for 'main'...${NC}"

gh api repos/${REPO}/branches/main/protection \
--method PUT \
--field required_status_checks='{
"strict": true,
"checks": [
{"context": "Run Tests (18.x)"},
{"context": "Run Tests (20.x)"},
{"context": "Code Quality Checks"}
]
}' \
--field enforce_admins=true \
--field required_pull_request_reviews='{
"required_approving_review_count": 1,
"dismiss_stale_reviews": true,
"require_code_owner_reviews": true,
"require_last_push_approval": false
}' \
--field restrictions=null \
--field allow_force_pushes=false \
--field allow_deletions=false \
--field block_creations=false \
--field required_conversation_resolution=true

if [ $? -eq 0 ]; then
echo -e "${GREEN}✅ Branch protection rules configured successfully!${NC}"
else
echo -e "${RED}❌ Failed to configure branch protection rules.${NC}"
echo -e "${YELLOW}You may need to configure these manually in GitHub:${NC}"
echo -e "1. Go to your repository on GitHub"
echo -e "2. Click Settings > Branches"
echo -e "3. Add a rule for the 'main' branch with the following settings:"
echo -e " - Require a pull request before merging"
echo -e " - Require approvals (1)"
echo -e " - Dismiss stale reviews"
echo -e " - Require review from CODEOWNERS"
echo -e " - Require status checks to pass before merging"
echo -e " - Require branches to be up to date before merging"
echo -e " - Required status checks:"
echo -e " * Run Tests (18.x)"
echo -e " * Run Tests (20.x)"
echo -e " * Code Quality Checks"
echo -e " - Restrict pushes that create matching branches"
echo -e " - Do not allow bypassing the above settings"
fi

echo -e "${GREEN}🎉 Setup complete!${NC}"
echo -e "${YELLOW}📋 Next steps:${NC}"
echo -e "1. Push your changes to trigger the first CI run"
echo -e "2. Create a test pull request to verify the protection rules"
echo -e "3. Check that status checks appear and must pass before merging"
echo ""
echo -e "${GREEN}🔧 Manual verification:${NC}"
echo -e "- Go to https://github.com/${REPO}/settings/branches"
echo -e "- Verify the 'main' branch protection rule is active"
echo -e "- Test with a pull request that breaks tests to confirm protection works"
Loading