Skip to content

fix: Enable workflow_dispatch for leaderboard update and regenerate data#299

Merged
jeremyeder merged 1 commit intoambient-code:mainfrom
kami619:fix/leaderboard-workflow-dispatch-298
Feb 18, 2026
Merged

fix: Enable workflow_dispatch for leaderboard update and regenerate data#299
jeremyeder merged 1 commit intoambient-code:mainfrom
kami619:fix/leaderboard-workflow-dispatch-298

Conversation

@kami619
Copy link
Collaborator

@kami619 kami619 commented Feb 18, 2026

Description

Fix the ordering problem in updating the leaderboard data when there is a change to the leaderboard data generate python script in addition to the new submissions.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Related Issues

Fixes #298

Changes Made

  • Fix update job condition to run on workflow_dispatch (was only running on push)
  • Add generate-leaderboard-data.py to trigger paths for automatic regeneration
  • Regenerate leaderboard.json with correct HTTPS URLs (fixes broken links)

Testing

  • Unit tests pass (pytest)
  • Integration tests pass
  • Manual testing performed
  • No new warnings or errors

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

- Fix update job condition to run on workflow_dispatch (was only running on push)
- Add generate-leaderboard-data.py to trigger paths for automatic regeneration
- Regenerate leaderboard.json with correct HTTPS URLs (fixes broken links)

Fixes ambient-code#298

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

📈 Test Coverage Report

Branch Coverage
This PR 66.0%
Main 66.0%
Diff ✅ +0%

Coverage calculated from unit tests only

@github-actions
Copy link
Contributor

AgentReady Code Review 🤖

Summary

This PR fixes a workflow trigger issue and regenerates leaderboard data with corrected URLs. The changes are focused and address a legitimate bug in the workflow dispatch handling.


✅ Positive Findings

1. Clear Problem Definition

2. Minimal, Targeted Changes

  • Only 2 files modified (workflow + data regeneration)
  • Surgical fix to workflow condition: line 186
  • Added missing trigger path for script changes: line 14

3. Security Best Practices

  • No new security vulnerabilities introduced
  • Maintains existing GitHub Actions security patterns
  • Uses environment variables for untrusted data (REPO_URL, SUBMITTER)

🔍 AgentReady Attribute Analysis

Passing Attributes

  1. Clear Documentation (attribute: clear_documentation)

  2. Standard Structure (attribute: standard_structure)

    • Changes follow established patterns
    • Workflow organization maintained
    • Script location appropriate (scripts/)
  3. Security Practices (attribute: secure_coding)

    • Proper use of environment variables
    • No command injection risks
    • Maintains least-privilege permissions model
  4. Version Control Hygiene (attribute: clean_commits)

    • Conventional commit expected: fix: Enable workflow_dispatch...
    • Targeted scope prevents merge conflicts

⚠️ Potential Improvements

  1. Testing Coverage (attribute: test_coverage)

    • Impact: Medium
    • Finding: Manual testing only, no automated tests
    • Recommendation: Add workflow test job or integration test for workflow_dispatch
    • Why: Workflow bugs can slip through manual testing alone
    • Score Impact: -5 points from test_coverage attribute
  2. Documentation (attribute: inline_documentation)

    • Impact: Low
    • Finding: Workflow change at line 186 lacks explanatory comment
    • Recommendation: Add inline comment explaining dual-trigger logic
    • Example:
      # Run on push to main OR manual workflow_dispatch trigger
      if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
    • Score Impact: -2 points from inline_documentation
  3. Actionlint Validation (attribute: pre_commit_hooks)

    • Impact: Low
    • Finding: No evidence of actionlint validation in PR checks
    • Recommendation: According to CLAUDE.md line 536-538, ALWAYS run actionlint before pushing workflow changes
    • Command: actionlint .github/workflows/leaderboard.yml
    • Score Impact: -3 points from pre_commit_hooks

🔧 Code Quality Assessment

Workflow Changes (.github/workflows/leaderboard.yml)

Line 14: ✅ Added script to trigger paths

+ - 'scripts/generate-leaderboard-data.py'
  • Rationale: Ensures workflow reruns when generator script changes
  • Best Practice: Trigger paths should include dependencies

Line 186: ⚠️ Modified update job condition

- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
+ if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
  • Issue: Logic reordering changes evaluation order (minor)
  • Recommendation: Keep original order for consistency
  • Suggested Fix:
    if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
  • Why: Matches line 24 pattern: if: github.event_name == 'pull_request'

Data Regeneration (docs/_data/leaderboard.json)

URL Normalization: ✅ Critical fix

  • Before: Mixed git@github.com:, https://github.com/...git
  • After: Consistent https://github.com/org/repo
  • Impact: Fixes broken hyperlinks in Jekyll site
  • Root Cause: Script line 98 hardcodes HTTPS URLs, but submissions contained mixed formats
  • Long-term Fix: Validate URL format during submission validation (workflow line 66)

🚨 Security Review

No New Vulnerabilities ✅

  • All user-controlled data handled via environment variables
  • No direct interpolation into shell commands
  • GITHUB_TOKEN scoped appropriately
  • No secrets exposed in logs

Existing Patterns Maintained ✅

  • Command injection protections preserved (lines 91, 109)
  • Safe subprocess usage in workflow
  • Permissions remain minimal (contents: write only where needed)

📊 Estimated AgentReady Score Impact

Attribute Current Change New
test_coverage 37.0 -5.0 32.0
inline_documentation 75.0 -2.0 73.0
pre_commit_hooks 80.0 -3.0 77.0
Overall 80.0 -1.2 78.8

Estimated impact based on tier weights (Tier 1: 50%, Tier 2: 30%, Tier 3: 15%, Tier 4: 5%)


✅ Recommendation: APPROVE with Minor Suggestions

This PR successfully fixes the reported bug with minimal risk. The changes are well-scoped and maintain security best practices.

Before Merge:

  1. ✅ Run actionlint .github/workflows/leaderboard.yml (per CLAUDE.md:536)
  2. 📝 Add inline comment explaining dual-trigger logic (line 186)
  3. 🧪 Consider workflow integration test for future robustness

Post-Merge:

  1. Monitor first workflow_dispatch trigger to verify fix
  2. Consider URL validation in submission workflow (prevent future data inconsistencies)

Review conducted by Claude Sonnet 4.5 via AgentReady review-agentready skill
AgentReady Version: 2.28.0

@jeremyeder jeremyeder merged commit 091d9dd into ambient-code:main Feb 18, 2026
10 of 11 checks passed
@kami619 kami619 deleted the fix/leaderboard-workflow-dispatch-298 branch February 18, 2026 18:06
github-actions bot pushed a commit that referenced this pull request Feb 18, 2026
## [2.28.1](v2.28.0...v2.28.1) (2026-02-18)

### Bug Fixes

* Enable workflow_dispatch for leaderboard update and regenerate data ([#299](#299)) ([091d9dd](091d9dd)), closes [#298](#298)
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.28.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Copy link

@ktdreyer ktdreyer left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] git repo urls are not resolved properly for certain url patterns in the leaderboard github pages site

3 participants