Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
48 changes: 10 additions & 38 deletions .github/workflows/daily-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,36 @@ on:
- cron: '0 0 * * *' # Daily
workflow_dispatch:

<<<<<<< HEAD
=======
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'

permissions:
contents: write

<<<<<<< HEAD
>>>>>>> pr-21923
=======
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

>>>>>>> pr-21902
jobs:
graphrag-benchmark:
name: GraphRAG Evaluation
runs-on: ubuntu-latest
permissions:
contents: write

steps:
<<<<<<< HEAD
- name: Checkout Code
=======
- name: Checkout repository
<<<<<<< HEAD
>>>>>>> pr-21923
=======
>>>>>>> pr-21902
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.15.4
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile
=======
>>>>>>> pr-21956
=======
>>>>>>> pr-21923
=======
>>>>>>> pr-21902
=======
>>>>>>> pr-21894

- name: Run GraphRAG Benchmark
run: node --experimental-strip-types scripts/benchmarks/run_graphrag.ts
run: npx tsx scripts/benchmarks/run_graphrag.ts

- name: Upload Benchmark Artifacts
uses: actions/upload-artifact@v4
Expand Down
41 changes: 11 additions & 30 deletions .github/workflows/monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,9 @@ on:
- cron: '0 * * * *' # Hourly
workflow_dispatch:

<<<<<<< HEAD
=======
permissions:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
contents: write
actions: read
issues: write
pull-requests: read

<<<<<<< HEAD
>>>>>>> pr-21923
=======
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'

>>>>>>> pr-21902
jobs:
monitor:
name: Hourly Health Scripts
Expand All @@ -31,44 +18,38 @@ jobs:
actions: read

steps:
<<<<<<< HEAD
- name: Checkout Code
=======
- name: Checkout repository
<<<<<<< HEAD
>>>>>>> pr-21923
=======
>>>>>>> pr-21902
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.15.4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Run CI Health Monitor
run: node --experimental-strip-types scripts/monitoring/ci_health.ts
run: npx tsx scripts/monitoring/ci_health.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Determinism Drift Monitor
run: node --experimental-strip-types scripts/monitoring/determinism_drift.ts
run: npx tsx scripts/monitoring/determinism_drift.ts

- name: Run Repo Entropy Monitor
run: node --experimental-strip-types scripts/monitoring/repo_entropy.ts
run: npx tsx scripts/monitoring/repo_entropy.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Security Drift Monitor
run: node --experimental-strip-types scripts/monitoring/security_drift.ts
run: npx tsx scripts/monitoring/security_drift.ts

- name: Evaluate Thresholds & Raise Issue
run: |
Expand Down
14 changes: 11 additions & 3 deletions scripts/monitoring/ci_health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ async function main() {
});

const output: { workflows: typeof sortedStats; overall_health: string } = {
workflows: sortedStats,
overall_health: 'healthy'
overall_health: 'healthy',
workflows: sortedStats
};

// Check for threshold breach (e.g., any workflow with > 20% failure rate)
Expand All @@ -90,13 +90,21 @@ async function main() {
output.overall_health = 'degraded';
}

// Sort keys alphabetically for deterministic JSON output
const sortedOutput = Object.keys(output)
.sort()
.reduce((acc, key) => {
acc[key] = (output as any)[key];
return acc;
}, {} as any);
Comment on lines +94 to +99
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For improved readability and type safety, you can use a more modern approach with Object.fromEntries() and Object.entries() to sort the object keys. This avoids the use of any type assertions and results in more concise code. Note that this approach requires an environment that supports ES2019 features.

  const sortedOutput = Object.fromEntries(
    Object.entries(output).sort(([keyA], [keyB]) => keyA.localeCompare(keyB))
  );


const outputDir = path.resolve('artifacts/monitoring');
if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, { recursive: true });
}

const outputPath = path.join(outputDir, 'ci-health.json');
fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));
fs.writeFileSync(outputPath, JSON.stringify(sortedOutput, null, 2));

console.log(`Wrote CI health metrics to ${outputPath}`);
}
Expand Down
Loading