Skip to content

Commit 8bdd311

Browse files
authored
docs/oss sweep (#13)
* chore(ci): align Codecov config with coverage.txt\n\n- Use go test -coverprofile=coverage.txt\n- Upload artifact and Codecov input as coverage.txt\n\nNo Jira ticket; routine CI maintenance change. * chore(ci): use codecov/codecov-action@v5 with token/slug\n\n- Switch from v4 to v5\n- Pass token via input and set slug\n- Rely on autodiscovery for coverage.txt * chore(ci): ensure coverage.txt is generated at repo root\n\n- Move flags before packages\n- Add -covermode=atomic and -coverpkg=./...\n- Stabilize single coverage.txt for artifact/Codecov * docs: OSS-ready docs sweep\n\n- Align Go version to 1.24+ across docs\n- Fix CI/CD examples; add composite action + CLI variants\n- Add docs/CI.md with Codecov v5 guidance\n- Standardize branching to GitHub Flow\n- Replace gosec with govulncheck; remove aspirational links
1 parent 510ef00 commit 8bdd311

File tree

5 files changed

+124
-30
lines changed

5 files changed

+124
-30
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ for retries := 0; retries < maxRetries; retries++ {
9696
cd ticketr
9797
```
9898

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

102102
3. **Install dependencies:**

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Format: Use `# TICKET:` headings in Markdown files.
106106
- Architecture: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
107107
- Webhooks: [docs/WEBHOOKS.md](docs/WEBHOOKS.md)
108108
- Development: [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)
109+
- CI & Coverage: [docs/CI.md](docs/CI.md)
109110
- CLI Reference: [docs/CLI.md](docs/CLI.md)
110111
- Examples: [examples/](examples/)
111112
- Rich custom fields example: [examples/tickets_with_custom_fields.md](examples/tickets_with_custom_fields.md)

docs/CI.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Continuous Integration and Coverage
2+
3+
This guide shows how to run Ticketr’s CI and report coverage with Codecov.
4+
5+
## GitHub Actions
6+
7+
Minimal workflow that vets, lints, tests with coverage, and uploads to Codecov:
8+
9+
```yaml
10+
name: CI
11+
12+
on:
13+
push:
14+
branches: [ main ]
15+
pull_request:
16+
branches: [ main ]
17+
18+
jobs:
19+
build-test:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/setup-go@v5
25+
with:
26+
go-version-file: go.mod
27+
28+
- name: Vet
29+
run: go vet ./...
30+
31+
- name: Lint
32+
uses: golangci/golangci-lint-action@v4
33+
with:
34+
version: latest
35+
args: --timeout=5m
36+
37+
- name: Test
38+
run: go test -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt ./...
39+
40+
- name: Upload coverage artifact
41+
if: always()
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: coverage
45+
path: coverage.txt
46+
47+
- name: Upload coverage reports to Codecov
48+
if: success() || failure()
49+
uses: codecov/codecov-action@v5
50+
with:
51+
token: ${{ secrets.CODECOV_TOKEN }}
52+
slug: karolswdev/ticketr
53+
```
54+
55+
Notes:
56+
- `-covermode=atomic` pairs well with `-race`.
57+
- `-coverpkg=./...` ensures a single `coverage.txt` at the repo root.
58+
- Codecov v5 autodiscovers `coverage.txt`; explicit `files:` is optional.
59+
60+
## Local Checks
61+
62+
Run the same steps locally:
63+
64+
```bash
65+
go vet ./...
66+
golangci-lint run
67+
go test -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt ./...
68+
```
69+
70+
Open an HTML coverage report:
71+
72+
```bash
73+
go tool cover -html=coverage.txt -o coverage.html
74+
```
75+

docs/DEVELOPMENT.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ This guide provides comprehensive instructions for setting up your development e
66

77
### Required Software
88

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

1414
### Recommended Tools
1515

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

2119
## Setting Up Your Development Environment
2220

@@ -117,6 +115,7 @@ go test -timeout 30s ./...
117115
```bash
118116
# Run tests with race detector
119117
go test -race ./...
118+
```
120119

121120
## Local Lint and Security Checks
122121

@@ -146,15 +145,12 @@ This repository enforces a Go toolchain via `go.mod`:
146145
toolchain go1.24.4
147146
```
148147

149-
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:
148+
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:
150149

151150
```bash
152151
GOTOOLCHAIN=go1.24.4
153152
```
154153

155-
# Note: This makes tests slower but catches concurrency issues
156-
```
157-
158154
### Benchmark Tests
159155

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

207203
### Branch Strategy
208204

209-
We follow a Git Flow-inspired branching model:
205+
We follow GitHub Flow:
210206

211207
```
212-
main - Production-ready code
213-
├── develop - Integration branch for features
214-
├── feat/* - Feature branches
215-
├── fix/* - Bug fix branches
216-
├── docs/* - Documentation updates
217-
└── refactor/* - Code refactoring
208+
main - Production-ready code
209+
feat/* - Feature branches
210+
fix/* - Bug fix branches
211+
docs/* - Documentation updates
212+
refactor/* - Code refactoring
218213
```
219214

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

282277
1. **Create Pull Request**
283-
- Target the `develop` branch
278+
- Target the `main` branch
284279
- Fill out the PR template
285280
- Link related issues
286281

@@ -323,8 +318,8 @@ golangci-lint run
323318
# Run go vet
324319
go vet ./...
325320

326-
# Check for security issues
327-
gosec ./...
321+
# Check for known vulnerabilities
322+
govulncheck ./...
328323
```
329324

330325
### Editor Configuration
@@ -484,10 +479,10 @@ Our CI pipeline runs on every push and pull request:
484479
1. **Lint**: Code style and quality checks
485480
2. **Test**: Unit and integration tests
486481
3. **Build**: Cross-platform binary compilation
487-
4. **Coverage**: Code coverage reporting
482+
4. **Coverage**: Code coverage reporting (Codecov)
488483
5. **Security**: Vulnerability scanning
489484
490-
### Running CI Locally
485+
### Running CI Locally (optional)
491486
492487
```bash
493488
# Install act (GitHub Actions locally)
@@ -499,7 +494,7 @@ curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
499494
act push
500495

501496
# Run specific job
502-
act -j test
497+
act -j build-test
503498
```
504499

505500
## Release Process

docs/GETTING_STARTED.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Welcome to Ticketr! This guide will walk you through setting up and using Ticket
1515

1616
Before you begin, ensure you have:
1717

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

239239
### CI/CD Integration
240240

241-
Automate ticket creation in GitHub Actions:
241+
Automate ticket sync in GitHub Actions.
242+
243+
Option A — Install CLI and run:
244+
```yaml
245+
jobs:
246+
ticketr:
247+
runs-on: ubuntu-latest
248+
steps:
249+
- uses: actions/checkout@v4
250+
- uses: actions/setup-go@v5
251+
with:
252+
go-version-file: go.mod
253+
- name: Install ticketr
254+
run: go install github.com/karolswdev/ticketr/cmd/ticketr@latest
255+
- name: Push tickets
256+
env:
257+
JIRA_URL: ${{ secrets.JIRA_URL }}
258+
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
259+
JIRA_API_KEY: ${{ secrets.JIRA_API_KEY }}
260+
JIRA_PROJECT_KEY: PROJ
261+
run: ticketr push stories/backlog.md
262+
```
263+
264+
Option B — Use the composite action from this repo:
242265
```yaml
243266
- name: Push tickets to JIRA
244-
uses: karolswdev/ticketr-action@v1
267+
uses: karolswdev/ticketr/.github/actions/ticketr-sync@main # Pin to a tag in production
245268
with:
246-
file: stories/backlog.md
247269
jira-url: ${{ secrets.JIRA_URL }}
248270
jira-email: ${{ secrets.JIRA_EMAIL }}
249271
jira-api-key: ${{ secrets.JIRA_API_KEY }}
250272
jira-project-key: PROJ
273+
command: push
274+
file-path: stories/backlog.md
251275
```
252276
253277
### Real-time Sync
@@ -323,11 +347,10 @@ ticketr pull --strategy=remote-wins
323347

324348
## Getting Help
325349

326-
- 📚 [Full Documentation](https://github.com/karolswdev/ticketr/wiki)
327350
- 💬 [GitHub Discussions](https://github.com/karolswdev/ticketr/discussions)
328351
- 🐛 [Report Issues](https://github.com/karolswdev/ticketr/issues)
329-
- 📧 [Contact Support](mailto:[email protected])
352+
- 📚 Project docs live in the `docs/` folder of this repo
330353

331354
---
332355

333-
Happy ticket management! 🎫
356+
Happy ticket management! 🎫

0 commit comments

Comments
 (0)