Files
QuantEngineByItz/.gitea/workflows/.archived/wbs_9_3_null_policy_ci_gate.yml
T
kjh2064 647a26eefd
Merge to Main - Full Pipeline / Stage 1: Fast Gates (push) Failing after 3s
Merge to Main - Full Pipeline / Stage 2: Critical Gates (push) Has been skipped
Merge to Main - Full Pipeline / Stage 3: Integration Tests (push) Has been skipped
Merge to Main - Full Pipeline / Stage 4: Build and Package (push) Has been skipped
Merge to Main - Full Pipeline / Stage 5: Deploy to Production (push) Has been skipped
Merge to Main - Full Pipeline / Pipeline Summary (push) Successful in 1s
chore: Archive 7 unused workflows and consolidate to SSOT pipeline
Reorganized .gitea/workflows/ to reduce duplication and noise:
- Archived 7 unnecessary workflows to .archived/ subdirectory:
  - auto_backup_schedule.yml
  - backup.yml
  - calibration_backlog.yml
  - kis_data_collection.yml
  - qualitative_sell_strategy.yml
  - snapshot_admin.yml
  - wbs_9_3_null_policy_ci_gate.yml

Active workflows (5 total):
- merge-to-main.yml (SSOT 5-stage pipeline)
- ci.yml (PR validation)
- deploy-prod.yml (manual deployment)
- fast-validation.yml (PR fast checks)
- _common/build-and-test.yml (reusable component)

Rationale: Phase 2 deployment infrastructure is complete. Legacy workflows
are no longer needed, reducing CI/CD maintenance burden and improving clarity.
Archived workflows remain available for reference if rollback is needed.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-11 21:31:44 +09:00

134 lines
3.8 KiB
YAML

name: WBS-9.3 - NULL Policy CI Gate
on:
push:
branches:
- main
- 'feature/**'
paths:
- 'src/**'
- 'spec/12_field_dictionary.yaml'
pull_request:
branches:
- main
jobs:
null-policy-validation:
runs-on: ubuntu-latest
name: NULL Policy Validation
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
run: python --version
- name: Run NULL Policy Validation
run: |
python -c "
import sqlite3
from pathlib import Path
import yaml
# Load NULL policy from field dictionary
with open('spec/12_field_dictionary.yaml') as f:
spec = yaml.safe_load(f)
null_policy = spec.get('field_dictionary', {}).get('policy', {})
print(f'[*] NULL Policy loaded: {null_policy}')
# Check both databases
databases = [
'src/quant_engine/kis_data_collection.db',
'src/quant_engine/snapshot_admin.db'
]
all_passed = True
for db_path in databases:
if not Path(db_path).exists():
print(f'[SKIP] {db_path} not found')
continue
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
# Get all tables
cursor.execute(\"SELECT name FROM sqlite_master WHERE type='table'\")
tables = [row[0] for row in cursor.fetchall()]
print(f'\n[CHECK] {db_path}')
for table in tables:
if table == 'sqlite_sequence':
continue
cursor.execute(f'SELECT * FROM {table} LIMIT 1')
if cursor.fetchone() is None:
print(f' [{table}] Empty (OK)')
else:
print(f' [{table}] Has data')
conn.close()
print('\n[RESULT] NULL Policy validation PASS')
"
- name: Validate Field Dictionary Schema
run: |
python -c "
import yaml
from pathlib import Path
with open('spec/12_field_dictionary.yaml') as f:
spec = yaml.safe_load(f)
# Check required sections
required_sections = ['meta', 'field_dictionary']
for section in required_sections:
if section not in spec:
print(f'ERROR: Missing section: {section}')
exit(1)
# Check field_dictionary structure
fd = spec['field_dictionary']
if 'fields' not in fd:
print('ERROR: Missing fields in field_dictionary')
exit(1)
print('[OK] Field dictionary schema valid')
print(f'[OK] Total fields defined: {len(fd[\"fields\"])}')
"
- name: Check FILLABLE vs NOT_FILLABLE
run: |
python -c "
import yaml
with open('spec/12_field_dictionary.yaml') as f:
spec = yaml.safe_load(f)
fields = spec['field_dictionary']['fields']
fillable = 0
not_fillable = 0
for fname, fspec in fields.items():
if 'data_quality_policy' in fspec:
chargeability = fspec['data_quality_policy'].get('chargeability')
if chargeability == 'FILLABLE':
fillable += 1
elif chargeability == 'NOT_FILLABLE':
not_fillable += 1
print(f'[OK] FILLABLE fields: {fillable}')
print(f'[OK] NOT_FILLABLE fields: {not_fillable}')
print('[OK] Data quality policy check complete')
"
- name: Log Results
if: always()
run: |
echo "WBS-9.3 NULL Policy CI Gate completed"
echo "Fields validated: total definitions vs NULL distribution"