Skip to content

Commit 96faeae

Browse files
committed
feat: Serena MCP setup, Docker container builds, and VSTest migration
Infrastructure: - Configure Serena MCP with OmniSharp (IPv6 workaround) - Enable managed code builds in Docker containers - Add unified intermediate output paths (host: Obj/, container: C:\Temp\Obj/) CI/CD: - Upgrade NETFX 4.6.1→4.8.1, WiX 3.11.2→3.14.1 - Add copilot-setup-steps.yml with testable agent scripts - Add docker-build-publish.yml workflow Testing: - Fix VSTest execution (DependencyModel, System.Memory conflicts) - Add Test.runsettings with InIsolation=true - Resolve 500+ pre-existing test failures Docs: - Migrate FwDocumentation wiki to docs/ and .github/instructions/ - Add AGENTS.md, CONTRIBUTING.md, developer setup guides
1 parent e3d1c3b commit 96faeae

185 files changed

Lines changed: 11497 additions & 2612 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
description: 'Copilot coding agent mode for autonomous task completion'
3+
tools: ['search', 'editFiles', 'runTasks', 'runTerminal', 'problems', 'testFailure']
4+
---
5+
You are a GitHub Copilot coding agent working autonomously on FieldWorks. You complete tasks end-to-end without human intervention.
6+
7+
## Operating Mode
8+
- Execute tasks completely—from understanding requirements to validated implementation
9+
- Make decisions based on project conventions and existing patterns
10+
- Run builds and tests to validate your changes before completing
11+
- Ask questions only when critical information is genuinely ambiguous
12+
13+
## Environment
14+
- You run on `windows-latest` GitHub runners (Windows Server 2022)
15+
- Pre-installed: VS 2022, MSBuild, .NET Framework 4.8.1, WiX 3.14.x, clangd
16+
- Build via `.\build.ps1` or `msbuild FieldWorks.proj /p:Configuration=Debug /p:Platform=x64 /m`
17+
- Setup scripts: `Build/Agent/Setup-FwBuildEnv.ps1`, `Build/Agent/Verify-FwDependencies.ps1`
18+
19+
## Decision Framework
20+
1. Read `AGENTS.md` for high-level guidance
21+
2. Read relevant `COPILOT.md` files in folders you'll modify
22+
3. Follow `.github/instructions/*.instructions.md` for domain-specific rules
23+
4. Match existing patterns in the codebase
24+
5. Validate changes compile and tests pass
25+
26+
## Must Follow
27+
- Native C++ (Phase 2) must build before managed code
28+
- Use `.resx` for localizable strings
29+
- Run `.\Build\Agent\check-and-fix-whitespace.ps1` before committing
30+
- Write conventional commit messages (<72 char subject)
31+
32+
## Boundaries
33+
- DO NOT modify build infrastructure without explicit approval
34+
- DO NOT skip validation steps
35+
- DO NOT introduce new dependencies without documentation
36+
37+
## Validation Checklist
38+
Before marking a task complete:
39+
- [ ] Code compiles: `.\build.ps1`
40+
- [ ] Relevant tests pass
41+
- [ ] Whitespace check passes
42+
- [ ] Changes follow existing patterns
43+
- [ ] COPILOT.md updated if contracts changed

.GitHub/copilot-setup-steps.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.GitHub/dependabot.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Dependabot configuration for FieldWorks
2+
# Keeps GitHub Actions and other dependencies up-to-date
3+
4+
version: 2
5+
updates:
6+
# GitHub Actions - check weekly for updates
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
day: "monday"
12+
commit-message:
13+
prefix: "ci"
14+
labels:
15+
- "dependencies"
16+
- "github-actions"
17+
# Group minor/patch updates to reduce PR noise
18+
groups:
19+
actions-minor:
20+
patterns:
21+
- "*"
22+
update-types:
23+
- "minor"
24+
- "patch"
25+
26+
# NuGet packages - check weekly
27+
- package-ecosystem: "nuget"
28+
directory: "/"
29+
schedule:
30+
interval: "weekly"
31+
day: "tuesday"
32+
commit-message:
33+
prefix: "deps"
34+
labels:
35+
- "dependencies"
36+
- "nuget"
37+
# Ignore major version bumps by default (breaking changes)
38+
ignore:
39+
- dependency-name: "*"
40+
update-types: ["version-update:semver-major"]
41+
groups:
42+
nuget-minor:
43+
patterns:
44+
- "*"
45+
update-types:
46+
- "minor"
47+
- "patch"
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
applyTo: "**/*.cs, **/*.cpp, **/*.h"
3+
name: "code-review.instructions"
4+
description: "Code review guidelines for FieldWorks pull requests"
5+
---
6+
7+
# Code Review Guidelines
8+
9+
## Purpose & Scope
10+
11+
This document provides guidance for code reviewers evaluating pull requests in the FieldWorks repository. It extracts key review principles to ensure code quality, security, and maintainability.
12+
13+
## What to Look For
14+
15+
### Licensing and Legal
16+
17+
- **New external assemblies/libraries/components**: Verify the license is compatible with LGPL 2.1+
18+
- **Code copied from websites**: Check the license. Code without a license cannot be used (see [Infoworld article](http://www.infoworld.com/d/open-source-software/github-needs-take-open-source-seriously-208046))
19+
- **License conditions**: Ensure any required disclaimers or attributions are included
20+
21+
### Exception Handling
22+
23+
- **Exceptions should be exceptional**: Don't use exceptions for normal control flow
24+
- **Catch specific exceptions**: Avoid catching generic `Exception` without good reason
25+
- **Clean up resources**: Ensure proper disposal in `finally` blocks or use `using` statements
26+
27+
### Code Quality
28+
29+
- **Follows coding standards**: See [coding-standard.instructions.md](coding-standard.instructions.md)
30+
- **Clear naming**: Variables, methods, and classes have descriptive names
31+
- **Appropriate comments**: Complex logic is explained; obvious code is not over-commented
32+
- **No dead code**: Remove unused variables, methods, and commented-out code
33+
34+
### Testing
35+
36+
- **Tests included**: New functionality has corresponding tests
37+
- **Tests pass**: All existing tests continue to pass
38+
- **Edge cases covered**: Tests include boundary conditions and error cases
39+
40+
### Security
41+
42+
- **Input validation**: User input is validated before use
43+
- **SQL injection prevention**: Parameterized queries for database access
44+
- **Path traversal prevention**: File paths are validated and sanitized
45+
- See [security.instructions.md](security.instructions.md) for comprehensive security guidelines
46+
47+
### Performance
48+
49+
- **No obvious performance issues**: Avoid N+1 queries, unnecessary loops, excessive allocations
50+
- **Resource cleanup**: Disposable objects are properly disposed
51+
- See [dispose.instructions.md](dispose.instructions.md) for IDisposable patterns
52+
53+
### Data Integrity
54+
55+
- **Migration safety**: Data model changes include proper migrations
56+
- **Backward compatibility**: Consider upgrade paths for existing user data
57+
- **Validation**: Data is validated before persistence
58+
59+
## Review Process
60+
61+
1. **Understand the context**: Read the PR description and linked issues
62+
2. **Review the changes**: Look at each file systematically
63+
3. **Run the code**: If significant, pull the branch and test locally
64+
4. **Provide feedback**: Be specific, constructive, and kind
65+
5. **Approve or request changes**: Be clear about blocking vs. non-blocking feedback
66+
67+
## Feedback Guidelines
68+
69+
### Be Constructive
70+
71+
- ✅ "Consider using `string.IsNullOrEmpty()` here for null safety"
72+
- ❌ "This is wrong"
73+
74+
### Be Specific
75+
76+
- ✅ "Line 42: This could throw a NullReferenceException if `item` is null"
77+
- ❌ "There might be bugs"
78+
79+
### Distinguish Blocking vs. Non-Blocking
80+
81+
- Use "nit:" or "suggestion:" prefix for non-blocking feedback
82+
- Be explicit if something must be changed before approval
83+
84+
### Acknowledge Good Work
85+
86+
- Point out clever solutions or well-written code
87+
- Thank contributors for their work
88+
89+
## References
90+
91+
- [managed.instructions.md](managed.instructions.md) - C# specific guidelines
92+
- [native.instructions.md](native.instructions.md) - C++ specific guidelines
93+
- [testing.instructions.md](testing.instructions.md) - Testing guidelines
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
applyTo: "**/*.cs, **/*.cpp, **/*.h"
3+
name: "coding-standard.instructions"
4+
description: "Coding standards for FieldWorks development"
5+
---
6+
7+
# Coding Standards
8+
9+
## Purpose & Scope
10+
11+
This document defines the coding standards for FieldWorks. These standards ensure consistency, readability, and maintainability across the codebase.
12+
13+
## Commit Messages
14+
15+
### Format
16+
17+
Commit messages should follow this structure:
18+
19+
```
20+
<subject line - max 62 characters>
21+
22+
<body - lines < 75 characters>
23+
```
24+
25+
### Subject Line Rules
26+
27+
- Maximum 62 characters (75 if single line)
28+
- Do NOT end with a period
29+
- Use imperative mood: "Add feature" not "Added feature" or "Adds feature"
30+
- Be concise but descriptive
31+
32+
### Body Rules
33+
34+
- Separate from subject with a blank line
35+
- Keep lines under 75 characters
36+
- Explain **what** and **why**, not how
37+
- Include issue references (e.g., "Fixes LT-12345")
38+
39+
### Good Examples
40+
41+
```
42+
Add export dialog for lexicon entries
43+
44+
Implement a new dialog that allows users to export selected
45+
lexicon entries to various formats including LIFT and CSV.
46+
47+
Fixes LT-12345
48+
```
49+
50+
```
51+
Fix crash when opening projects with missing files
52+
53+
The application crashed when a project referenced files that
54+
had been moved or deleted. Now shows a warning dialog instead.
55+
```
56+
57+
### Bad Examples
58+
59+
```
60+
Fixed the bug. # Too vague, past tense, period
61+
```
62+
63+
```
64+
Adding some changes to the export functionality that were requested by users # Too long, present participle
65+
```
66+
67+
## Whitespace
68+
69+
### Indentation
70+
71+
- **Use tabs, not spaces**
72+
- Tab width: 4 characters
73+
- Configure your editor to insert tabs, not spaces
74+
75+
### Trailing Whitespace
76+
77+
- **No trailing whitespace** on any line
78+
- Files should end with a single newline
79+
80+
### Configuration
81+
82+
These rules are enforced in `.editorconfig`. Ensure your editor respects EditorConfig files.
83+
84+
## Enforcement
85+
86+
- **Commit message format** is checked by gitlint during CI
87+
- **Whitespace rules** are checked by `git log --check` during CI
88+
- **EditorConfig** is read by Visual Studio and VS Code
89+
90+
Run the CI parity checks locally before committing:
91+
```powershell
92+
# Check whitespace
93+
git diff --check
94+
95+
# Lint commit messages
96+
gitlint --commits origin/release/9.3..HEAD
97+
```
98+
99+
## Language-Specific Standards
100+
101+
For detailed language-specific guidelines, see:
102+
103+
- [managed.instructions.md](managed.instructions.md) - C# specific guidelines
104+
- [native.instructions.md](native.instructions.md) - C++/C++CLI guidelines
105+
- [csharp.instructions.md](csharp.instructions.md) - Additional C# patterns
106+
107+
## External References
108+
109+
- [Palaso Coding Standards](https://docs.google.com/document/d/1t4QVHWwGnrUi036lOXM-hnHVn15BbJkuGVKGLnbo4qk/edit#heading=h.oqp1hgsjndtl) - Additional coding conventions (FieldWorks works closely with Palaso code)
110+
111+
## Quick Reference
112+
113+
| Rule | Requirement |
114+
|------|-------------|
115+
| Indentation | Tabs (4 spaces wide) |
116+
| Trailing whitespace | None |
117+
| Line endings | LF (Unix-style) |
118+
| Commit subject | ≤62 chars, imperative, no period |
119+
| Commit body | Lines ≤75 chars, explain why |
120+
| File encoding | UTF-8 |

0 commit comments

Comments
 (0)