Skip to content

Conversation

jstirnaman
Copy link
Collaborator

@jstirnaman jstirnaman commented Aug 21, 2025

…ments

  • Add GitHub Actions workflow to detect README changes and create sync reminders
  • Update README_TEMPLATE.md with documentation sync instructions
  • Add validate_readme.py script for template compliance checking
  • Update CONTRIBUTING.md with comprehensive documentation sync process guide

The workflow automatically:

  • Detects plugin README changes on master branch commits
  • Creates commit comments with pre-filled sync request links to docs-v2
  • Provides clear instructions for the sync process
  • Requires no secrets or cross-repository authentication

Updated documentation includes:

  • Complete sync workflow instructions
  • Template compliance requirements
  • Automated sync process explanation
  • Manual sync alternatives

This workflow works with influxdata/docs-v2#6329 to sync updated READMEs in influxdb3_plugins to influxdata/docs-v2.

…ments

- Add GitHub Actions workflow to detect README changes and create sync reminders
- Update README_TEMPLATE.md with documentation sync instructions
- Add validate_readme.py script for template compliance checking
- Update CONTRIBUTING.md with comprehensive documentation sync process guide

The workflow automatically:
- Detects plugin README changes on master branch commits
- Creates commit comments with pre-filled sync request links to docs-v2
- Provides clear instructions for the sync process
- Requires no secrets or cross-repository authentication

Updated documentation includes:
- Complete sync workflow instructions
- Template compliance requirements
- Automated sync process explanation
- Manual sync alternatives
Copilot

This comment was marked as outdated.

Copilot

This comment was marked as outdated.

…ers, move to scripts directory:- Moves validate_readme.py to /scripts

- Replaces magic numbers with variables
- Adds support for --help and --list flags- Updates contributing doc
@jstirnaman jstirnaman force-pushed the jstirnaman/validate-and-sync-readmes-with-influxdata-docs branch from 3bc228e to cf7a557 Compare August 21, 2025 21:43
@jstirnaman jstirnaman requested a review from Copilot August 21, 2025 21:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an automated documentation sync system to remind contributors to synchronize plugin README changes with the InfluxDB documentation site. The workflow automatically detects when plugin READMEs are modified and provides clear instructions for syncing those changes to the docs-v2 repository.

Key changes:

  • Automated detection and reminder system for README changes via GitHub Actions
  • Comprehensive README template with sync instructions and validation requirements
  • Python validation script to ensure README compliance with template standards

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/remind-sync-docs.yml GitHub Actions workflow that detects README changes and creates sync reminder comments
README_TEMPLATE.md Comprehensive template for plugin READMEs with sync instructions and proper structure
CONTRIBUTING.md Updated with detailed documentation sync process and requirements
scripts/validate_readme.py Python script for validating README compliance against template standards
Comments suppressed due to low confidence (1)

errors = []

# Check for bash code examples
bash_examples = re.findall(r'```bash(.*?)```', content, re.DOTALL)
Copy link
Preview

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

The regex pattern for finding bash examples may match incorrectly if there are nested backticks or escaped characters within code blocks. Consider using a more robust parsing approach or adding boundary checks to avoid false matches.

Suggested change
bash_examples = re.findall(r'```bash(.*?)```', content, re.DOTALL)
bash_examples = []
in_bash_block = False
current_block = []
for line in content.splitlines():
if not in_bash_block and line.strip().startswith("```bash"):
in_bash_block = True
current_block = []
# If there is content after ```bash on the same line, include it
after = line.strip()[7:]
if after:
current_block.append(after)
elif in_bash_block and line.strip().startswith("```"):
in_bash_block = False
bash_examples.append('\n'.join(current_block))
elif in_bash_block:
current_block.append(line)

Copilot uses AI. Check for mistakes.


# Check for emoji metadata pattern
metadata_pattern = r'^⚡\s+[\w\-,\s]+\s+🏷️\s+[\w\-,\s]+\s+🔧\s+InfluxDB 3'
if not re.search(metadata_pattern, content, re.MULTILINE):
Copy link
Preview

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

The hardcoded regex pattern for emoji metadata validation is fragile and difficult to maintain. Consider extracting the pattern to a constant or configuration, and document the expected format more clearly to make future updates easier.

Suggested change
if not re.search(metadata_pattern, content, re.MULTILINE):
# Emoji metadata line format:
# The README must contain a line matching the following format:
# ⚡ <trigger types> 🏷️ <tags> 🔧 InfluxDB 3
# - ⚡: Indicates trigger types (comma-separated, e.g., "scheduled, webhook")
# - 🏷️: Indicates tags (comma-separated, e.g., "data, analytics")
# - 🔧: Indicates compatibility (always "InfluxDB 3" for now)
EMOJI_METADATA_PATTERN = r'^⚡\s+[\w\-,\s]+\s+🏷️\s+[\w\-,\s]+\s+🔧\s+InfluxDB 3'
def validate_emoji_metadata(content: str) -> List[str]:
"""Validate the emoji metadata line."""
errors = []
# Check for emoji metadata pattern
if not re.search(EMOJI_METADATA_PATTERN, content, re.MULTILINE):

Copilot uses AI. Check for mistakes.


# Check for template remnants
if 'Plugin Name' in content and '# Plugin Name' in content:
errors.append("README still contains template placeholder 'Plugin Name'")
Copy link
Preview

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

The condition checks for both 'Plugin Name' and '# Plugin Name' which is redundant since the second check is more specific and would be sufficient. Consider simplifying to just check for '# Plugin Name' to avoid duplicate validation logic.

Suggested change
errors.append("README still contains template placeholder 'Plugin Name'")
if '# Plugin Name' in content:
errors.append("README still contains template placeholder '# Plugin Name'")

Copilot uses AI. Check for mistakes.

id: detect-changes
run: |
# Get list of changed README files
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | grep '^influxdata/.*/README\.md$' | head -10)
Copy link
Preview

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

The head -10 limitation arbitrarily caps the number of changed files processed. If more than 10 plugin READMEs are changed in a single commit, some changes won't trigger sync reminders. Consider either removing this limit or making it configurable.

Suggested change
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | grep '^influxdata/.*/README\.md$' | head -10)
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | grep '^influxdata/.*/README\.md$')

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants