Skip to content

Commit ce8831d

Browse files
committed
public facing
1 parent 3debe25 commit ce8831d

58 files changed

Lines changed: 1993 additions & 105 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.{cs,csproj,xaml,xml,props,targets}]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.{yml,yaml,json,md,ps1}]
14+
indent_style = space
15+
indent_size = 2
16+
17+
[*.md]
18+
trim_trailing_whitespace = false
19+
20+
[*.cs]
21+
dotnet_style_qualification_for_field = false:suggestion
22+
dotnet_style_qualification_for_property = false:suggestion
23+
dotnet_style_qualification_for_method = false:suggestion
24+
dotnet_style_qualification_for_event = false:suggestion
25+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
26+
csharp_style_namespace_declarations = file_scoped:suggestion
27+
csharp_style_var_for_built_in_types = true:suggestion
28+
csharp_style_var_when_type_is_apparent = true:suggestion
29+
csharp_style_var_elsewhere = false:suggestion

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Default maintainership
2+
* @ari.sulistiono
3+
4+
# Protocol and RAW transport changes need careful review
5+
/src/PtpLabClock.Protocol/ @ari.sulistiono
6+
/src/PtpLabClock.Core/ @ari.sulistiono
7+
/src/PtpLabClock.Pcap/ @ari.sulistiono
8+
/tests/ @ari.sulistiono
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Bug report
2+
description: Report a reproducible defect
3+
title: "bug: "
4+
labels: [bug, triage]
5+
body:
6+
- type: textarea
7+
id: summary
8+
attributes:
9+
label: Summary
10+
description: What went wrong?
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: steps
15+
attributes:
16+
label: Reproduction steps
17+
description: Include exact commands, mode, adapter, domain, VLAN settings, and expected/actual behavior.
18+
placeholder: |
19+
1. Run ...
20+
2. Select ...
21+
3. Click ...
22+
validations:
23+
required: true
24+
- type: textarea
25+
id: environment
26+
attributes:
27+
label: Environment
28+
placeholder: |
29+
OS:
30+
.NET SDK:
31+
Npcap version:
32+
Adapter type:
33+
Wireshark filter:
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: logs
38+
attributes:
39+
label: Logs or screenshots
40+
description: Paste relevant CLI/app logs. Attach a small PCAP only when safe.
41+
validations:
42+
required: false
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Feature request
2+
description: Propose a focused improvement
3+
title: "feature: "
4+
labels: [enhancement, triage]
5+
body:
6+
- type: textarea
7+
id: problem
8+
attributes:
9+
label: Problem
10+
description: Which lab or diagnostic workflow is blocked?
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: proposal
15+
attributes:
16+
label: Proposed solution
17+
description: Describe the smallest useful change.
18+
validations:
19+
required: true
20+
- type: dropdown
21+
id: area
22+
attributes:
23+
label: Area
24+
options:
25+
- WPF UI
26+
- Console CLI
27+
- Protocol serializer/parser
28+
- RAW Npcap transport
29+
- Passive monitor / health validator
30+
- Reporting / session export
31+
- Documentation / release
32+
validations:
33+
required: true
34+
- type: checkboxes
35+
id: safety
36+
attributes:
37+
label: Safety boundary
38+
options:
39+
- label: This request does not require claiming certified grandmaster or relay-acceptance behavior.
40+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Summary
2+
3+
What changed and why?
4+
5+
## Validation
6+
7+
- [ ] `dotnet build .\PtpLabClock.sln -c Release`
8+
- [ ] `dotnet test .\PtpLabClock.sln -c Release`
9+
- [ ] `dotnet run --project .\src\PtpLabClock.Console -- --validate-protocol --domain 0`
10+
11+
## RAW/Npcap impact
12+
13+
- [ ] No RAW/Npcap impact
14+
- [ ] RAW mode tested with `--raw-self-test`
15+
- [ ] Wireshark validation performed with `eth.type == 0x88f7 or ptp`
16+
17+
## Safety and docs
18+
19+
- [ ] No timing-source overclaim introduced
20+
- [ ] README/docs updated when user-visible behavior changed
21+
- [ ] New dependencies reviewed for license and security posture

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "nuget"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
time: "06:00"
9+
timezone: "Asia/Jakarta"
10+
open-pull-requests-limit: 5
11+
groups:
12+
test-dependencies:
13+
patterns:
14+
- "xunit*"
15+
- "Microsoft.NET.Test.Sdk"
16+
packet-dependencies:
17+
patterns:
18+
- "SharpPcap"
19+
- package-ecosystem: "github-actions"
20+
directory: "/"
21+
schedule:
22+
interval: "weekly"
23+
day: "monday"
24+
time: "06:30"
25+
timezone: "Asia/Jakarta"
26+
open-pull-requests-limit: 5
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
fail-on-severity: moderate
2+
allow-licenses:
3+
- Apache-2.0
4+
- MIT
5+
- BSD-2-Clause
6+
- BSD-3-Clause
7+
- ISC
8+
- MS-PL
9+
deny-licenses:
10+
- GPL-2.0
11+
- GPL-3.0
12+
- AGPL-1.0
13+
- AGPL-3.0
14+
- LGPL-2.0
15+
- LGPL-2.1
16+
- LGPL-3.0
17+
comment-summary-in-pr: always

.github/workflows/build.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,22 @@ on:
77
branches: [ main, master ]
88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: build-${{ github.ref }}
15+
cancel-in-progress: true
16+
1017
jobs:
1118
build:
12-
name: Windows build
19+
name: Windows ${{ matrix.configuration }}
1320
runs-on: windows-latest
21+
timeout-minutes: 25
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
configuration: [Debug, Release]
1426

1527
steps:
1628
- name: Checkout
@@ -21,6 +33,14 @@ jobs:
2133
with:
2234
dotnet-version: '8.0.x'
2335

36+
- name: Cache NuGet packages
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.nuget/packages
40+
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', 'Directory.Build.props') }}
41+
restore-keys: |
42+
nuget-${{ runner.os }}-
43+
2444
- name: Validate repository layout
2545
shell: pwsh
2646
run: .\tools\scripts\validate-layout.ps1
@@ -29,17 +49,22 @@ jobs:
2949
run: dotnet restore .\PtpLabClock.sln
3050

3151
- name: Build
32-
run: dotnet build .\PtpLabClock.sln -c Release --no-restore
52+
run: dotnet build .\PtpLabClock.sln -c ${{ matrix.configuration }} --no-restore
3353

3454
- name: Test
35-
run: dotnet test .\PtpLabClock.sln -c Release --no-build --logger trx --results-directory TestResults
55+
run: dotnet test .\PtpLabClock.sln -c ${{ matrix.configuration }} --no-build --logger trx --results-directory TestResults
3656

3757
- name: Protocol smoke validation
58+
if: matrix.configuration == 'Release'
3859
run: dotnet run --project .\src\PtpLabClock.Console --configuration Release -- --validate-protocol --domain 0
3960

61+
- name: Export protocol validation PCAP
62+
if: matrix.configuration == 'Release'
63+
run: dotnet run --project .\src\PtpLabClock.Console --configuration Release -- --validate-protocol --domain 0 --export-pcap .\TestResults\ptp-validation.pcap
64+
4065
- name: Upload test results
4166
if: always()
4267
uses: actions/upload-artifact@v4
4368
with:
44-
name: test-results
69+
name: test-results-${{ matrix.configuration }}
4570
path: TestResults

.github/workflows/codeql.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
schedule:
9+
- cron: '22 20 * * 0'
10+
workflow_dispatch:
11+
12+
permissions:
13+
security-events: write
14+
packages: read
15+
actions: read
16+
contents: read
17+
18+
jobs:
19+
analyze:
20+
name: CodeQL C#
21+
runs-on: windows-latest
22+
timeout-minutes: 30
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v4
30+
with:
31+
languages: csharp
32+
33+
- name: Setup .NET
34+
uses: actions/setup-dotnet@v4
35+
with:
36+
dotnet-version: '8.0.x'
37+
38+
- name: Build for analysis
39+
run: dotnet build .\PtpLabClock.sln -c Release
40+
41+
- name: Perform CodeQL Analysis
42+
uses: github/codeql-action/analyze@v4
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Dependency Review
2+
3+
on:
4+
pull_request:
5+
branches: [ main, master ]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
dependency-review:
13+
name: Dependency Review
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Dependency Review
21+
uses: actions/dependency-review-action@v4
22+
with:
23+
config-file: .github/dependency-review-config.yml

0 commit comments

Comments
 (0)