Skip to content

About

Tool to generate project reports from Linux Foundation Gerrit server content

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

906 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Linux Foundation Project Reporting System

Comprehensive multi-repository analysis tool for Linux Foundation projects

Generate detailed reports on Gerrit projects, contributor activity, Jenkins jobs, GitHub CI/CD workflows, and development practices across repositories.


πŸ—’οΈ Published Reports

https://lfreleng-actions.github.io/project-reporting-tool/

πŸ—„οΈ Report Data and Retention

The daily πŸ“Š Production Reports workflow (.github/workflows/reporting-production.yaml) keeps its outputs in two places:

  • GitHub Pages (deployed with actions/deploy-pages): the latest report.html, report.md, report_raw.json and metadata.json per project. Each run rebuilds the whole site from report artifacts and replaces the previous deployment. An active project without a report from that run keeps the newest unexpired reports-<slug> artifact holding a report.html from an earlier scheduled or dispatched run of this workflow on the default branch; once none remains, it drops off the site. A failed API lookup for such an artifact fails the run instead and leaves the previous deployment live.
  • Workflow run artifacts: raw-data-<slug>, reports-<slug>, clone-manifest-<slug> and clone-log-<slug>, kept for 90 days, after which GitHub deletes them.

To fetch data from an earlier run within those 90 days, download the artifacts from that workflow run in the Actions tab, or use .github/scripts/download-artifacts.sh.

⚑ Quick Start

# Run without installing
uvx lf-releng-project-reporting generate \
  --project my-project \
  --repos-path ./repos

# Or install as a tool, then run lf-releng-project-reporting directly
uv tool install lf-releng-project-reporting

πŸš€ Key Features

  • πŸ“ˆ Git Analytics - Commit activity, lines of code, contributor metrics across configurable time windows
  • πŸ“‹ INFO.yaml Reporting - Project metadata, committer activity, and lifecycle state tracking from info-master
  • πŸ” Feature Detection - Automatic detection of CI/CD, documentation, dependency management, security tools
  • πŸ‘₯ Contributor Intelligence - Author and organization analysis with domain mapping
  • 🌐 API Integration - GitHub, Gerrit, and Jenkins API support
  • 🎯 CI-Management Integration - Authoritative Jenkins job allocation using JJB definitions (99%+ accuracy)
  • πŸ“Š Interactive Reports - JSON (data), Markdown (readable), HTML (interactive), ZIP (bundled)
  • ⚑ High Performance - Parallel processing with caching support

πŸ“š Documentation

🎯 Getting Started

βš™οΈ Setup & Configuration

πŸ”§ Advanced Usage

πŸ‘¨β€πŸ’» Development

πŸ” Development Tools

  • Template Audit Script - python scripts/audit_templates.py - Comprehensive audit of all Jinja2 templates to verify field accesses match context builders, preventing runtime errors

πŸ’» Installation

Using UV (Recommended)

# Install UV
curl -LsSf https://astral.sh/uv/install.sh | sh

# Run the published package without installing
uvx lf-releng-project-reporting --help

# Or install it as a tool
uv tool install lf-releng-project-reporting

Developing from a checkout

# Install dependencies
uv sync

# Run the tool
# Note: repos-path should match the directory created by gerrit-clone-action
# which defaults to the Gerrit server hostname (e.g., ./gerrit.o-ran-sc.org)
uv run lf-releng-project-reporting generate --project O-RAN-SC --repos-path ./gerrit.o-ran-sc.org

The repository commits uv.lock, which pins every dependency version. After editing pyproject.toml, run uv lock and commit the regenerated lock with it: CI runs uv lock --check and fails when the lock no longer matches, and the production workflows install with uv sync --locked. Dependabot bumps the lock weekly.

β†’ Detailed Setup Instructions


🎯 Common Use Cases

Use Case Command
Basic report (O-RAN-SC) lf-releng-project-reporting generate --project O-RAN-SC --repos-path ./gerrit.o-ran-sc.org
Basic report (ONAP) lf-releng-project-reporting generate --project ONAP --repos-path ./gerrit.onap.org
With caching lf-releng-project-reporting generate --project O-RAN-SC --repos-path ./gerrit.o-ran-sc.org --cache --workers 8
Check config lf-releng-project-reporting generate --project O-RAN-SC --repos-path ./gerrit.o-ran-sc.org --dry-run
Get help lf-releng-project-reporting --help

Note: The --repos-path should point to the directory created by gerrit-clone-action, which uses the Gerrit server hostname as the directory name (e.g., ./gerrit.o-ran-sc.org for O-RAN-SC, ./gerrit.onap.org for ONAP).


πŸ“Š Output Formats

reports/
  <PROJECT>/
    β”œβ”€β”€ report_raw.json              # Complete dataset (canonical)
    β”œβ”€β”€ report.md                    # Markdown report (readable)
    β”œβ”€β”€ report.html                  # Interactive HTML (sortable tables)
    β”œβ”€β”€ config_resolved.json         # Applied configuration
    └── <PROJECT>_report_bundle.zip  # Complete bundle

πŸ”Œ CI/CD Integration

GitHub Actions

- name: Generate Report
  run: |
    uv run lf-releng-project-reporting generate \
      --project "${{ matrix.project }}" \
      --repos-path "./${{ matrix.server }}" \
      --cache \
      --quiet
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

πŸ”§ Requirements

  • Python: 3.11+ (supports 3.11, 3.12, 3.13, 3.14)
  • Dependencies: PyYAML, httpx, Jinja2, typer, rich
  • Optional: GitHub token for API features (required for workflow status colors)

GitHub Token Requirements

For full workflow status reporting (colored status indicators), you need a GitHub Personal Access Token (Classic) with these permissions:

Required Scopes:

  • β˜‘ repo - Full repository access (or public_repo for public repositories)
  • β˜‘ actions:read - Read GitHub Actions workflow runs and status

Note: Fine-grained tokens are not supported as they cannot span organizations.

Setup:

# Set environment variable
export GITHUB_TOKEN=ghp_your_token_here
# OR for CI/production:
export CLASSIC_READ_ONLY_PAT_TOKEN=ghp_your_token_here

# Then run the tool
lf-releng-project-reporting generate --project my-project --repos-path ./repos

Create token: https://github.com/settings/tokens

Without a token: The tool detects workflows but shows them as grey (unknown status) instead of colored status indicators.

See also: Configuration Guide for detailed token setup

Jenkins Authentication (Optional)

Some Jenkins servers require authentication to view job information. If you encounter a "returned 0 jobs" error, you need to provide Jenkins credentials.

Setup:

# Generate API token in Jenkins: User β†’ Configure β†’ API Token β†’ Add new Token
export JENKINS_USER="your-username"
export JENKINS_API_TOKEN="your-api-token"

# Then run the tool
lf-releng-project-reporting generate --project my-project --repos-path ./repos

Create token: Log into your Jenkins instance β†’ Your Username β†’ Configure β†’ API Token

Without credentials: The tool will fail with an error if Jenkins requires authentication.

See also: Troubleshooting Guide for detailed setup


πŸ“– Key Documentation Files

Topic Document
Getting Started docs/GETTING_STARTED.md
Commands docs/COMMANDS.md
FAQ docs/FAQ.md
Configuration docs/CONFIGURATION.md
Usage Examples docs/USAGE_EXAMPLES.md
Performance docs/PERFORMANCE.md
Troubleshooting docs/TROUBLESHOOTING.md
CI/CD Setup docs/CI_CD_INTEGRATION.md
Developer Guide docs/DEVELOPER_GUIDE.md

πŸ’‘ Quick Tips

  • 🎯 First time? Start with Getting Started Guide
  • ⚑ Slow? Add --cache --workers 8 for parallel processing
  • πŸ› Issues? Check Troubleshooting Guide
  • ❓ Questions? See FAQ
  • πŸ“– Need help? Run lf-releng-project-reporting --help
  • πŸ” Developing templates? Run python scripts/audit_templates.py to verify all field accesses

πŸ› οΈ Development Scripts

Template Audit Script

python scripts/audit_templates.py

This script performs a comprehensive audit of all Jinja2 templates to:

  • Extract all field accesses from templates (e.g., repo.field, org.field)
  • Analyze context builders to see what fields they provide
  • Identify mismatches that could cause "Undefined variable" errors at runtime

When to use:

  • Before committing template changes
  • After modifying context builders
  • When debugging template rendering errors
  • During code review to verify template correctness

Output:

  • βœ… Green checkmarks - All required fields present
  • ⚠️ Warnings - Extra fields exist (safe, unused)
  • ❌ Red errors - Missing fields that will cause runtime failures

Example output:

================================================================================
TEMPLATE FIELD ACCESS AUDIT
================================================================================

πŸ“„ html/sections/summary.html.j2
  summary:
    - active_count
    - current_count
    - repositories_analyzed

βœ… No critical issues found!
   Extra fields are safe - they're unused.

🀝 Support


πŸ“œ License

Apache-2.0 License - Copyright 2025 The Linux Foundation


About

Tool to generate project reports from Linux Foundation Gerrit server content

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages