Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e914a42
feat: add SafeMarkup helper and fix Spectre.Console markup escaping
Kydoimos97 Dec 5, 2025
04883bd
feat: add detailed logging and timeout detection for async operations
Kydoimos97 Dec 5, 2025
d629eb4
fix: resolve circular dependency in service registration
Kydoimos97 Dec 5, 2025
a2bb3c5
refactor: reorganize project structure and simplify CLI
Kydoimos97 Dec 5, 2025
88ea81a
feat: add local deployment PowerShell script for FileCombiner
Kydoimos97 Dec 5, 2025
84232d7
chore: remove bin/obj from git and improve .gitignore
Kydoimos97 Dec 5, 2025
367f162
ci: add GitHub Actions workflow with test coverage and badges
Kydoimos97 Dec 5, 2025
96ebbc0
fix: update codecov action to v5 and simplify coverage upload
Kydoimos97 Dec 5, 2025
a07f17e
fix: use directory parameter instead of files for codecov upload and …
Kydoimos97 Dec 5, 2025
1d42829
fix: add better debug output for coverage directory check
Kydoimos97 Dec 5, 2025
1a194b0
fix: remove results-directory parameter and let codecov auto-discover…
Kydoimos97 Dec 5, 2025
1c224f2
fix: specify TestResults directory and search for all XML files
Kydoimos97 Dec 5, 2025
fb629c2
fix: remove --no-build flag to ensure tests are built
Kydoimos97 Dec 5, 2025
f2a90f4
fix: use dotnet-coverage tool for reliable coverage collection
Kydoimos97 Dec 5, 2025
5c11108
refactor: replace coverlet with dotnet-coverage and simplify CI to si…
Kydoimos97 Dec 5, 2025
3db1f22
feat: add concurrency control to cancel outdated workflow runs
Kydoimos97 Dec 5, 2025
dcb66a7
fix: restore multi-OS testing matrix
Kydoimos97 Dec 5, 2025
d4c54f7
chore: remove .kiro files from git and update .gitignore
Kydoimos97 Dec 5, 2025
ae87fa1
test: add comprehensive test coverage with Coverlet integration
Kydoimos97 Dec 5, 2025
1eb967f
fix: remove --no-build flag from test coverage command
Kydoimos97 Dec 5, 2025
a486ec9
fix: add null checks for nullable collections in tests and improve co…
Kydoimos97 Dec 5, 2025
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
68 changes: 68 additions & 0 deletions .github/CODECOV_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Codecov Setup Guide

To enable code coverage reporting with Codecov, follow these steps:

## 1. Sign up for Codecov

1. Go to [codecov.io](https://codecov.io)
2. Sign in with your GitHub account
3. Authorize Codecov to access your repositories

## 2. Add Repository

1. Find `Kydoimos97/FileCombiner` in your repository list
2. Click "Setup repo" or enable it

## 3. Get Upload Token

1. Go to repository settings in Codecov
2. Copy the upload token (it will look like: `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`)

## 4. Add Token to GitHub Secrets

1. Go to your GitHub repository: `https://github.com/Kydoimos97/FileCombiner`
2. Click on **Settings** → **Secrets and variables** → **Actions**
3. Click **New repository secret**
4. Name: `CODECOV_TOKEN`
5. Value: Paste the token from Codecov
6. Click **Add secret**

## 5. Verify Setup

Once the token is added:
1. Push a commit or create a PR
2. The CI workflow will run automatically
3. Coverage reports will be uploaded to Codecov
4. The coverage badge in README.md will update

## Optional: Configure Codecov

Create a `codecov.yml` file in the repository root to customize coverage settings:

```yaml
coverage:
status:
project:
default:
target: 80%
threshold: 1%
patch:
default:
target: 80%

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: false
```

## Troubleshooting

- **Badge shows "unknown"**: Token not set or first workflow hasn't completed yet
- **Coverage not uploading**: Check GitHub Actions logs for errors
- **Token invalid**: Regenerate token in Codecov and update GitHub secret

## Resources

- [Codecov Documentation](https://docs.codecov.com/)
- [GitHub Actions Integration](https://docs.codecov.com/docs/github-actions-integration)
79 changes: 79 additions & 0 deletions .github/CODECOV_STATUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Codecov Integration Status

## ✅ Completed Setup

1. **GitHub Actions CI Workflow** (`.github/workflows/ci.yml`)
- Runs tests on Ubuntu, Windows, and macOS
- Collects code coverage using XPlat Code Coverage (coverlet)
- Uploads coverage to Codecov using v5 action
- Builds Windows x64 artifacts on main branch

2. **Codecov Configuration** (`codecov.yml`)
- Target coverage: 70%
- Ignores test files and build artifacts
- Configured for PR comments with coverage diff

3. **README Badges**
- CI status badge
- Codecov coverage badge
- License and .NET version badges

4. **Test Project Configuration**
- `coverlet.collector` package installed (v6.0.2)
- Configured to generate Cobertura XML format

## 🔧 Required: User Action

**You need to add the CODECOV_TOKEN to GitHub Secrets:**

1. Go to [Codecov.io](https://codecov.io) and sign in with GitHub
2. Find your repository: `Kydoimos97/FileCombiner`
3. Copy the upload token from repository settings
4. Go to GitHub: `https://github.com/Kydoimos97/FileCombiner/settings/secrets/actions`
5. Click "New repository secret"
6. Name: `CODECOV_TOKEN`
7. Value: Paste your token
8. Save

## 📊 Current Status

- Latest commit: `96ebbc0` - "fix: update codecov action to v5 and simplify coverage upload"
- Branch: `feature/cli-fixes-and-simplification`
- Status: **Pushed and ready for CI run**

## 🔍 What Happens Next

Once you add the `CODECOV_TOKEN`:

1. The CI workflow will run on the next push/PR
2. Tests will execute on all three platforms
3. Coverage will be collected from Ubuntu runner
4. Coverage report will upload to Codecov
5. Badges in README will update with real data

## 🐛 Troubleshooting

If coverage upload fails:

1. **Check token is set**: Verify `CODECOV_TOKEN` exists in GitHub Secrets
2. **Check workflow logs**: Look for "Upload coverage reports to Codecov" step
3. **Verify coverage files**: The workflow expects `./coverage/**/coverage.cobertura.xml`
4. **Check Codecov dashboard**: Visit codecov.io to see upload status

## 📝 Files Modified

- `.github/workflows/ci.yml` - CI workflow with Codecov integration
- `codecov.yml` - Codecov configuration
- `README.md` - Added badges
- `.github/CODECOV_SETUP.md` - Setup instructions (reference)

## ✨ Next Steps

1. Add `CODECOV_TOKEN` to GitHub Secrets (required)
2. Merge PR #1 to main branch
3. Verify CI passes and coverage uploads
4. Check coverage badge updates in README

---

**Note**: The workflow uses `fail_ci_if_error: false` so CI won't fail if Codecov upload has issues. This is intentional during initial setup. You can change it to `true` once everything is working.
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

on:
push:
branches: [ main, develop, feature/* ]
pull_request:
branches: [ main, develop ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Run tests with coverage
run: dotnet test FileCombiner.Tests/FileCombiner.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=../coverage.cobertura.xml --configuration Release --verbosity quiet

- name: List coverage files (debug)
if: matrix.os == 'ubuntu-latest'
run: |
echo "Searching for coverage files..."
ls -la *.xml || echo "No XML files found"
echo "=== Coverage file content (first 50 lines) ==="
head -50 coverage.cobertura.xml || echo "Cannot read coverage.cobertura.xml"
echo "=== Coverage file stats ==="
grep -E 'line-rate|branch-rate|lines-covered|lines-valid' coverage.cobertura.xml | head -5 || echo "Cannot parse coverage stats"

- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.cobertura.xml
flags: unittests
fail_ci_if_error: false
verbose: true

build:
name: Build Release Artifacts
runs-on: windows-latest
needs: test
if: github.ref == 'refs/heads/main'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Publish Windows x64
run: dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:DebugType=None -p:DebugSymbols=false -o ./artifacts/win-x64

- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: filecombiner-win-x64
path: ./artifacts/win-x64/filecombiner.exe
retention-days: 30
74 changes: 74 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,77 @@
/bin/
/obj/
/*.DotSettings.user

# Kiro IDE files
.kiro/

# Coverage reports
coverage*.xml
coveragereport/
TestResults/

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/

# Test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Visual Studio cache/options
.vs/
.vscode/

# ReSharper
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"kiroAgent.configureMCP": "Disabled"
}
80 changes: 80 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Changelog

All notable changes to FileCombiner will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- `--interactive` / `-i` flag for opt-in interactive mode
- Comprehensive property-based testing with FsCheck
- Improved help text using CommandLine library's built-in help generation
- Path resolution tests to ensure location independence

### Changed
- **BREAKING**: Interactive mode is now opt-in via `--interactive` flag instead of automatic fallback
- **BREAKING**: Directory argument is now optional (defaults to current directory)
- Simplified interactive mode from 7 questions to 4 essential questions
- Help text now uses CommandLine library's automatic generation
- Fixed Spectre.Console markup escaping in help display
- Fixed service initialization hang caused by circular dependency
- Improved async/await patterns throughout codebase

### Removed
- **BREAKING**: The following options are now hidden (still work for backward compatibility):
- `--include` - Use `--extensions` instead
- `--ignore-dirs` - Use `--exclude` with directory patterns instead
- `--compact` - Feature removed (rarely used)
- `--no-tree` - Tree generation simplified
- `--max-files` - Now uses sensible default of 1000
- `--max-file-size` - Now uses sensible default of 10MB

### Fixed
- Spectre.Console markup parsing errors in help display
- Application hanging after service provider initialization
- Circular dependency between ContentExtractorFactory and FileContentExtractor

## Migration Guide

### For users of removed options:

**`--include` patterns**
- **Before**: `filecombiner . --include "*.cs,*.js"`
- **After**: `filecombiner . --extensions .cs,.js`

**`--ignore-dirs` patterns**
- **Before**: `filecombiner . --ignore-dirs "bin,obj"`
- **After**: `filecombiner . --exclude "**/bin/**,**/obj/**"`

**`--compact` mode**
- This feature has been removed. The default output format is now optimized.

**`--no-tree` flag**
- Tree generation is now always included and optimized.

**`--max-files` and `--max-file-size`**
- These now use sensible defaults (1000 files, 10MB per file).
- If you need different limits, please open an issue.

### For users relying on automatic interactive mode:

**Before**: Running `filecombiner` without arguments would enter interactive mode.

**After**: Running `filecombiner` without arguments processes the current directory with defaults.

To enter interactive mode, use the `--interactive` or `-i` flag:
```bash
filecombiner --interactive
```

### Default behavior changes:

- **No arguments**: Now processes current directory instead of entering interactive mode
- **Directory only**: `filecombiner ./src` now works without additional prompts
- **Sensible defaults**: Auto-detects text files, max depth of 5, outputs to clipboard

## [Previous Versions]

_(No previous versions documented)_
Loading
Loading