A Python script to automatically track and summarize documentation changes in the Cloudflare documentation repository. This tool analyzes git commit history to generate monthly reports of documentation updates for specific product areas.
This script helps documentation maintainers:
- Track changes to specific product documentation areas
- Generate monthly summaries of documentation updates
- Filter out trivial changes (typos, formatting, etc.)
- Identify which pages were updated and what sections changed
- Create reports suitable for sharing with stakeholders
- Date-based filtering: Track changes by month using merge dates
- Product-specific tracking: Focus on specific product areas (Cache, DNS, SSL/TLS, etc.)
- Category-based organization: Group products into 5 categories (Application Performance, Application Security, Cloudflare One, Platform, Developer Platform)
- Changelog tracking: Automatically includes new changelog entries for tracked products
- Smart filtering: Automatically excludes trivial changes like typos and formatting
- Section detection: Identifies which sections of a page were modified
- Clean output: Generates formatted summaries ready for copy-paste into Confluence or other tools
- Python 3.6+
- Git
- Access to a local clone of the cloudflare-docs repository
- Download the script:
curl -O https://raw.githubusercontent.com/ngayerie/spm-doc-updates-tracker/main/track-doc-changes.py
chmod +x track-doc-changes.py- Clone the Cloudflare docs repository (if you haven't already):
git clone https://github.com/cloudflare/cloudflare-docs.gitTrack changes for the last month:
python3 track-doc-changes.py --repo /path/to/cloudflare-docsTrack changes for a specific month:
python3 track-doc-changes.py --repo /path/to/cloudflare-docs --month 2024-12Focus on a specific category:
python3 track-doc-changes.py --repo /path/to/cloudflare-docs --month 2024-12 --category app_perfTrack multiple categories:
python3 track-doc-changes.py --repo /path/to/cloudflare-docs --month 2024-12 --category app_perf app_secOverride categories and focus on specific products:
python3 track-doc-changes.py --repo /path/to/cloudflare-docs --month 2024-12 --products cache dns sslGenerate a report file:
python3 track-doc-changes.py --repo /path/to/cloudflare-docs --month 2024-12 --output december-updates.txtBy default, trivial changes (typos, formatting) are excluded. To include them:
python3 track-doc-changes.py --repo /path/to/cloudflare-docs --month 2024-12 --include-trivial| Argument | Required | Description |
|---|---|---|
--repo |
Yes | Path to the cloudflare-docs repository |
--month |
No | Month in YYYY-MM format (default: last month) |
--category |
No | Category to track: app_perf, app_sec, cf1, platform, dev_plat (default: all) |
--products |
No | Specific products to track (overrides --category) |
--include-trivial |
No | Include trivial changes like typos and formatting |
--output |
No | Output file path (default: stdout) |
The script organizes products into 5 categories:
Argo Smart Routing, Automatic Platform Optimization, Cache, Cloudflare for SaaS, Data Localization, DNS, Health Checks, Load Balancing, Logs, Rules, Speed, SSL/TLS, Version Management, 1.1.1.1
API Shield, Bot Management, Cloudflare Challenges, DDoS Protection, Firewall, Log Explorer, Page Shield, Ruleset Engine, Security, Security Center, Smart Shield, Turnstile, WAF, Waiting Room
Browser Rendering, BYOIP, China Network, Client IP Geolocation, Cloudflare One, Email Security, Magic Cloud Networking, Magic Firewall, Magic Network Monitoring, Magic Transit, Magic WAN, Network, Network Error Logging, Network Interconnect, Spectrum, WARP Client
Analytics, Billing, Notifications, Pulumi, Radar, Registrar, Tenant, Time Services
Agents, AI Crawl Control, AI Gateway, AI Search, Containers, D1, DMARC Management, Durable Objects, Email Routing, Google Tag Gateway, Hyperdrive, Images, KV, Pages, Pipelines, Queues, R2, R2 SQL, Realtime, Sandbox, Secrets Store, Stream, Vectorize, Web3, Workers, Workers AI, Workers VPC, Workflows, Zaraz
The following products are always included regardless of category selection:
- Support
- Fundamentals
- Terraform
The script generates output with two sections:
# Documentation Updates - December 2024
Update to the Cache documentation: Add new caching strategies guide
- https://developers.cloudflare.com/cache/strategies/
Update to the DNS documentation: Update DNSSEC configuration steps
- https://developers.cloudflare.com/dns/dnssec/ - Updated: Configuration, Troubleshooting
Changelog entries are filtered by the date field in their frontmatter, not by git commit date. This ensures entries appear in the correct month even if they were added to the repository later.
# New Changelog Entries - December 2024
New changelog entry for WAF: WAF Release - 2024-12-15
- https://developers.cloudflare.com/changelog/2024-12-15-waf-release/
New changelog entry for Workers: Workers now supports Node.js 20
- https://developers.cloudflare.com/changelog/2024-12-10-nodejs-20/
You can customize the script by editing:
- CATEGORIES: Add or remove products within categories
- CHANGELOG_TO_DOCS_MAP: Map changelog directories to doc directories (for directories with different names)
- TRIVIAL_PATTERNS: Adjust what counts as trivial changes
- SIGNIFICANT_PATTERNS: Define patterns for significant changes
python3 track-doc-changes.py \
--repo ~/cloudflare-docs \
--month 2024-12 \
--category app_perf \
--output december-app-performance.txtpython3 track-doc-changes.py \
--repo ~/cloudflare-docs \
--month 2024-12 \
--category app_sec cf1 \
--output december-security-network.txtpython3 track-doc-changes.py \
--repo ~/cloudflare-docs \
--month 2024-12 \
--include-trivial \
--output december-all-changes.txtpython3 track-doc-changes.py --repo ~/cloudflare-docs-
Keep your local repository updated:
cd /path/to/cloudflare-docs git checkout production git pull origin production -
Run the script monthly to generate regular reports
-
Copy output to Confluence or your documentation tracking system
-
Adjust filters based on your team's needs
Error: Repository path does not exist
- Ensure the path to your cloudflare-docs repository is correct
- Use absolute paths or
~for home directory
Error: Not a git repository
- Make sure you're pointing to a valid git repository
- Check that the
.gitdirectory exists
No commits found
- Verify the date range includes commits
- Check that the product paths are correct
- Ensure your local repository is up to date
Feel free to submit issues or pull requests to improve this tool.
MIT License - feel free to use and modify as needed.