Skip to content

Add messages for open channel v1 #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jun 10, 2025
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
85 changes: 27 additions & 58 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ dotnet_diagnostic.IDE0044.severity = error

# IDE0051: Remove unused private member
dotnet_diagnostic.IDE0051.severity = error
dotnet_diagnostic.IDE0051.severity = error

# IDE0055: Fix formatting
dotnet_diagnostic.IDE0055.severity = error
Expand Down Expand Up @@ -86,6 +85,7 @@ dotnet_diagnostic.RS2008.severity = error
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
# TODO: Check if there's a way of enabling local using directives under namespace for simplification

# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:error
Expand All @@ -109,69 +109,44 @@ csharp_style_inlined_variable_declaration = true:warning
csharp_style_throw_expression = true:warning
csharp_style_conditional_delegate_call = true:warning
csharp_style_prefer_extended_property_pattern = true:warning
# TODO: Check if there are newer ones for dotnet9

# Whitespace options
dotnet_style_allow_multiple_blank_lines_experimental = false

# Non-private static fields are PascalCase
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = error
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style

dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_static_fields.required_modifiers = static

dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case

# By default, name enum values with PascalCase
dotnet_naming_rule.enum_values_should_be_pascal_case.severity = error
dotnet_naming_rule.enum_values_should_be_pascal_case.symbols = enum_values
dotnet_naming_rule.enum_values_should_be_pascal_case.style = enum_values_style

dotnet_naming_symbols.enum_values.applicable_accessibilities = public, protected, internal, protected_internal, private_protected, private
dotnet_naming_symbols.enum_values.applicable_kinds = enum

dotnet_naming_style.enum_values_style.capitalization = pascal_case

# Constants are uppercase
dotnet_naming_rule.constants_should_be_upper_case.severity = error
dotnet_naming_rule.constants_should_be_upper_case.symbols = constants
dotnet_naming_rule.constants_should_be_upper_case.style = constant_style

dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
# --- Naming Conventions ---

dotnet_naming_style.constant_style.capitalization = all_upper

# Static readonly fields are uppercase
dotnet_naming_rule.non_private_readonly_static_fields_should_be_pascal_case.severity = error
dotnet_naming_rule.non_private_readonly_static_fields_should_be_pascal_case.symbols = non_private_readonly_static_fields
dotnet_naming_rule.non_private_readonly_static_fields_should_be_pascal_case.style = non_private_readonly_static_style
# Re-use existing naming rules
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_style.camel_case_style.capitalization = camel_case

dotnet_naming_symbols.non_private_readonly_static_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_readonly_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_readonly_static_fields.required_modifiers = readonly, static
# Private const fields are PascalCase and start with
dotnet_naming_rule.private_const_fields_should_be_camel_case.severity = error
dotnet_naming_rule.private_const_fields_should_be_camel_case.symbols = private_const_fields
dotnet_naming_rule.private_const_fields_should_be_camel_case.style = pascal_case_style

dotnet_naming_style.non_private_readonly_static_style.capitalization = pascal_case
dotnet_naming_symbols.private_const_fields.applicable_kinds = field
dotnet_naming_symbols.private_const_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_const_fields.required_modifiers = const

# Static fields are camelCase and start with s_
dotnet_naming_rule.static_fields_should_be_camel_case.severity = error
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
# Private static fields are camelCase and start with s_
dotnet_naming_rule.private_static_fields_should_be_camel_case.severity = error
dotnet_naming_rule.private_static_fields_should_be_camel_case.symbols = private_static_fields
dotnet_naming_rule.private_static_fields_should_be_camel_case.style = private_static_field_style

dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_symbols.private_static_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_static_fields.required_modifiers = static

dotnet_naming_style.static_field_style.capitalization = camel_case
dotnet_naming_style.static_field_style.required_prefix = s_
dotnet_naming_style.private_static_field_style.capitalization = camel_case
dotnet_naming_style.private_static_field_style.required_prefix = s_

# Instance fields are camelCase and start with _
# Private fields are camelCase and start with _
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = error
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style

dotnet_naming_symbols.instance_fields.applicable_kinds = field, property
dotnet_naming_symbols.instance_fields.applicable_kinds = field
dotnet_naming_symbols.instance_fields.applicable_accessibilities = private

dotnet_naming_style.instance_field_style.capitalization = camel_case
Expand All @@ -184,25 +159,19 @@ dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style

dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local

dotnet_naming_style.camel_case_style.capitalization = camel_case

# Local functions are PascalCase
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = error
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
dotnet_naming_rule.local_functions_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.local_functions.applicable_kinds = local_function

dotnet_naming_style.local_function_style.capitalization = pascal_case

# By default, name items with PascalCase
dotnet_naming_rule.members_should_be_pascal_case.severity = error
dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
dotnet_naming_rule.members_should_be_pascal_case.symbols = other_pascal_case_members
dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.all_members.applicable_kinds = *

dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_symbols.other_pascal_case_members.applicable_kinds = *

# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:warning
Expand Down
52 changes: 51 additions & 1 deletion .github/workflows/combined-report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: NLightning Combined Coverage Report (Push)
on:
workflow_run:
workflows: ["NLightning .NET Build & Tests (Push)", "NLightning.Native .NET Build & Tests (Push)", "NLightning.Wasm .NET Build & Tests (Push)"]
workflows: [ "NLightning .NET Build & Tests (Push)" ]
types:
- completed

Expand All @@ -12,6 +12,56 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Wait for all workflows to complete
run: |
REQUIRED_WORKFLOWS=(
"NLightning .NET Build & Tests (Push)"
"NLightning.Native .NET Build & Tests (Push)"
"NLightning.Wasm .NET Build & Tests (Push)"
)

echo "Waiting for all workflows to complete for commit ${{ github.event.workflow_run.head_sha }}"

# Set timeout to 5 minutes (300 seconds)
TIMEOUT=300
ELAPSED=0
SLEEP_INTERVAL=30

while [ $ELAPSED -lt $TIMEOUT ]; do
all_complete=true

for workflow in "${REQUIRED_WORKFLOWS[@]}"; do
# Get the latest run for this workflow and commit
run_data=$(gh api repos/${{ github.repository }}/actions/runs \
--jq ".workflow_runs[] | select(.head_sha==\"${{ github.event.workflow_run.head_sha }}\" and .name==\"$workflow\") | {status: .status, conclusion: .conclusion}" \
| head -1)

run_status=$(echo "$run_data" | jq -r '.status')
run_conclusion=$(echo "$run_data" | jq -r '.conclusion')

echo "Workflow '$workflow': status=$run_status, conclusion=$run_conclusion"

if [ "$run_status" != "completed" ]; then
all_complete=false
break
fi
done

if [ "$all_complete" = true ]; then
echo "✅ All workflows completed!"
exit 0
else
echo "⏳ Still waiting for workflows to complete... (${ELAPSED}s/${TIMEOUT}s)"
sleep $SLEEP_INTERVAL
ELAPSED=$((ELAPSED + SLEEP_INTERVAL))
fi
done

echo "❌ Timeout reached after ${TIMEOUT} seconds. Not all workflows completed in time."
exit 1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand Down
68 changes: 59 additions & 9 deletions .github/workflows/pr.combined-report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: NLightning Combined Coverage Report (PR)
on:
workflow_run:
workflows: ["NLightning .NET Build & Tests (PR)", "NLightning.Native .NET Build & Tests (PR)", "NLightning.Wasm .NET Build & Tests (PR)"]
workflows: [ "NLightning .NET Build & Tests (PR)" ]
types:
- completed

Expand All @@ -12,35 +12,85 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Wait for all workflows to complete
run: |
REQUIRED_WORKFLOWS=(
"NLightning .NET Build & Tests (PR)"
"NLightning.Native .NET Build & Tests (PR)"
"NLightning.Wasm .NET Build & Tests (PR)"
)

echo "Waiting for all workflows to complete for commit ${{ github.event.workflow_run.head_sha }}"

# Set timeout to 5 minutes (300 seconds)
TIMEOUT=300
ELAPSED=0
SLEEP_INTERVAL=30

while [ $ELAPSED -lt $TIMEOUT ]; do
all_complete=true

for workflow in "${REQUIRED_WORKFLOWS[@]}"; do
# Get the latest run for this workflow and commit
run_data=$(gh api repos/${{ github.repository }}/actions/runs \
--jq ".workflow_runs[] | select(.head_sha==\"${{ github.event.workflow_run.head_sha }}\" and .name==\"$workflow\") | {status: .status, conclusion: .conclusion}" \
| head -1)

run_status=$(echo "$run_data" | jq -r '.status')
run_conclusion=$(echo "$run_data" | jq -r '.conclusion')

echo "Workflow '$workflow': status=$run_status, conclusion=$run_conclusion"

if [ "$run_status" != "completed" ]; then
all_complete=false
break
fi
done

if [ "$all_complete" = true ]; then
echo "✅ All workflows completed!"
exit 0
else
echo "⏳ Still waiting for workflows to complete... (${ELAPSED}s/${TIMEOUT}s)"
sleep $SLEEP_INTERVAL
ELAPSED=$((ELAPSED + SLEEP_INTERVAL))
fi
done

echo "❌ Timeout reached after ${TIMEOUT} seconds. Not all workflows completed in time."
exit 1
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

- name: Download Standard Coverage
uses: dawidd6/action-download-artifact@v3
with:
workflow: pr.yml
name: coverage
path: coverage-reports/standard

- name: Download Native Coverage
uses: dawidd6/action-download-artifact@v3
with:
workflow: pr.native.yml
name: coverage.Native
path: coverage-reports/native

- name: Download WASM Coverage
uses: dawidd6/action-download-artifact@v3
with:
workflow: pr.wasm.yml
name: coverage.Wasm
path: coverage-reports/wasm

- name: List All Downloaded Files
run: find coverage-reports -type f | sort

- name: Combine All Coverage Reports
uses: danielpalme/[email protected]
with:
Expand All @@ -52,7 +102,7 @@ jobs:
tag: "${{ github.run_number }}_${{ github.run_id }}"
toolpath: "reportgeneratortool"
assemblyfilters: "+*;-NLightning.Infrastructure.Blazor;-NLightning.BlazorTestApp"

- name: Generate Combined Coverage Report
uses: irongut/[email protected]
with:
Expand All @@ -65,7 +115,7 @@ jobs:
indicators: true
output: both
thresholds: '50 75'

- name: Find PR Number
id: pr-number
uses: potiuk/get-workflow-origin@v1_5
Expand Down Expand Up @@ -110,7 +160,7 @@ jobs:

- name: List All Downloaded Files
run: find test-results -type f | sort

- name: Publish Combined Test Results
uses: EnricoMi/[email protected]
if: always()
Expand Down
Loading
Loading