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
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
version: latest
args: --timeout=5m
- name: Test
run: go test ./... -race -coverprofile=coverage.out
run: go test -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt ./...
- name: Govulncheck
uses: golang/govulncheck-action@v1
with:
Expand All @@ -42,13 +42,10 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.out
path: coverage.txt
- name: Upload coverage to Codecov
if: success() || failure()
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: coverage.out
flags: unittests
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
slug: karolswdev/ticketr
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ for retries := 0; retries < maxRetries; retries++ {
cd ticketr
```

2. **Install Go 1.22 or later:**
2. **Install Go 1.24 or later:**
Follow the instructions at https://go.dev/doc/install

3. **Install dependencies:**
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Format: Use `# TICKET:` headings in Markdown files.
- Architecture: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
- Webhooks: [docs/WEBHOOKS.md](docs/WEBHOOKS.md)
- Development: [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)
- CI & Coverage: [docs/CI.md](docs/CI.md)
- CLI Reference: [docs/CLI.md](docs/CLI.md)
- Examples: [examples/](examples/)
- Rich custom fields example: [examples/tickets_with_custom_fields.md](examples/tickets_with_custom_fields.md)
Expand Down
75 changes: 75 additions & 0 deletions docs/CI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Continuous Integration and Coverage

This guide shows how to run Ticketr’s CI and report coverage with Codecov.

## GitHub Actions

Minimal workflow that vets, lints, tests with coverage, and uploads to Codecov:

```yaml
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Vet
run: go vet ./...

- name: Lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
args: --timeout=5m

- name: Test
run: go test -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt ./...

- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.txt

- name: Upload coverage reports to Codecov
if: success() || failure()
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: karolswdev/ticketr
```

Notes:
- `-covermode=atomic` pairs well with `-race`.
- `-coverpkg=./...` ensures a single `coverage.txt` at the repo root.
- Codecov v5 autodiscovers `coverage.txt`; explicit `files:` is optional.

## Local Checks

Run the same steps locally:

```bash
go vet ./...
golangci-lint run
go test -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt ./...
```

Open an HTML coverage report:

```bash
go tool cover -html=coverage.txt -o coverage.html
```

39 changes: 17 additions & 22 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ This guide provides comprehensive instructions for setting up your development e

### Required Software

- **Go 1.22 or later**: [Download Go](https://go.dev/dl/)
- **Go 1.24 or later**: [Download Go](https://go.dev/dl/)
- **Git**: [Download Git](https://git-scm.com/downloads)
- **Make** (optional): For simplified command execution
- **Docker** (optional): For containerized development

### Recommended Tools

- **VS Code** with Go extension
- **GoLand** IDE
- **golangci-lint**: For code quality checks
- **ko**: For building container images
- **VS Code** with Go extension or GoLand IDE
- **golangci-lint**: Code quality checks (matches CI)

## Setting Up Your Development Environment

Expand Down Expand Up @@ -117,6 +115,7 @@ go test -timeout 30s ./...
```bash
# Run tests with race detector
go test -race ./...
```

## Local Lint and Security Checks

Expand Down Expand Up @@ -146,15 +145,12 @@ This repository enforces a Go toolchain via `go.mod`:
toolchain go1.24.4
```

Most tools (including `go` itself and GitHub Actions `setup-go`) will automatically install/use this version when `go-version-file: go.mod` is configured. If you want to override locally for a single shell, you can use:
Most tools (including `go` itself and GitHub Actions `setup-go`) automatically install/use this version when `go-version-file: go.mod` is configured. If you want to override locally for a single shell, you can use:

```bash
GOTOOLCHAIN=go1.24.4
```

# Note: This makes tests slower but catches concurrency issues
```

### Benchmark Tests

```bash
Expand Down Expand Up @@ -206,15 +202,14 @@ func TestTicketService_ProcessTickets(t *testing.T) {

### Branch Strategy

We follow a Git Flow-inspired branching model:
We follow GitHub Flow:

```
main - Production-ready code
├── develop - Integration branch for features
├── feat/* - Feature branches
├── fix/* - Bug fix branches
├── docs/* - Documentation updates
└── refactor/* - Code refactoring
main - Production-ready code
feat/* - Feature branches
fix/* - Bug fix branches
docs/* - Documentation updates
refactor/* - Code refactoring
```

### Creating a Feature Branch
Expand Down Expand Up @@ -280,7 +275,7 @@ git commit -m "refactor(services): Extract validation logic to separate package"
### Code Review Process

1. **Create Pull Request**
- Target the `develop` branch
- Target the `main` branch
- Fill out the PR template
- Link related issues

Expand Down Expand Up @@ -323,8 +318,8 @@ golangci-lint run
# Run go vet
go vet ./...

# Check for security issues
gosec ./...
# Check for known vulnerabilities
govulncheck ./...
```

### Editor Configuration
Expand Down Expand Up @@ -484,10 +479,10 @@ Our CI pipeline runs on every push and pull request:
1. **Lint**: Code style and quality checks
2. **Test**: Unit and integration tests
3. **Build**: Cross-platform binary compilation
4. **Coverage**: Code coverage reporting
4. **Coverage**: Code coverage reporting (Codecov)
5. **Security**: Vulnerability scanning

### Running CI Locally
### Running CI Locally (optional)

```bash
# Install act (GitHub Actions locally)
Expand All @@ -499,7 +494,7 @@ curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
act push

# Run specific job
act -j test
act -j build-test
```

## Release Process
Expand Down
37 changes: 30 additions & 7 deletions docs/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Welcome to Ticketr! This guide will walk you through setting up and using Ticket

Before you begin, ensure you have:

1. **Go 1.22+** installed (for building from source)
1. **Go 1.24+** installed (for building from source)
2. **JIRA Account** with API access enabled
3. **JIRA API Token** (not your password!)
- Generate at: https://id.atlassian.com/manage-profile/security/api-tokens
Expand Down Expand Up @@ -238,16 +238,40 @@ Use emojis for visual status:

### CI/CD Integration

Automate ticket creation in GitHub Actions:
Automate ticket sync in GitHub Actions.

Option A — Install CLI and run:
```yaml
jobs:
ticketr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install ticketr
run: go install github.com/karolswdev/ticketr/cmd/ticketr@latest
- name: Push tickets
env:
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
JIRA_API_KEY: ${{ secrets.JIRA_API_KEY }}
JIRA_PROJECT_KEY: PROJ
run: ticketr push stories/backlog.md
```

Option B — Use the composite action from this repo:
```yaml
- name: Push tickets to JIRA
uses: karolswdev/ticketr-action@v1
uses: karolswdev/ticketr/.github/actions/ticketr-sync@main # Pin to a tag in production
with:
file: stories/backlog.md
jira-url: ${{ secrets.JIRA_URL }}
jira-email: ${{ secrets.JIRA_EMAIL }}
jira-api-key: ${{ secrets.JIRA_API_KEY }}
jira-project-key: PROJ
command: push
file-path: stories/backlog.md
```

### Real-time Sync
Expand Down Expand Up @@ -323,11 +347,10 @@ ticketr pull --strategy=remote-wins

## Getting Help

- 📚 [Full Documentation](https://github.com/karolswdev/ticketr/wiki)
- 💬 [GitHub Discussions](https://github.com/karolswdev/ticketr/discussions)
- 🐛 [Report Issues](https://github.com/karolswdev/ticketr/issues)
- 📧 [Contact Support](mailto:support@ticketr.dev)
- 📚 Project docs live in the `docs/` folder of this repo

---

Happy ticket management! 🎫
Happy ticket management! 🎫
Loading