Skip to content

feat: Add GitHub Action to notify SDK repositories of API changes on release#134

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-897299bd-e5a0-44b8-873e-cd69da33255c
Open

feat: Add GitHub Action to notify SDK repositories of API changes on release#134
Copilot wants to merge 3 commits intomainfrom
copilot/fix-897299bd-e5a0-44b8-873e-cd69da33255c

Conversation

Copy link
Copy Markdown

Copilot AI commented Sep 29, 2025

This PR implements an automated GitHub Action workflow that creates issues in OpenFoodFacts SDK repositories whenever a NutriPatrol release contains API changes.

Problem

When NutriPatrol releases include API changes, SDK maintainers across multiple repositories need to be manually notified to update their implementations. This manual process is error-prone and can lead to outdated SDKs.

Solution

The new workflow (.github/workflows/notify-sdk-api-changes.yml) automatically:

  1. Triggers on releases - Activates when a new release is published
  2. Detects API changes - Analyzes release notes for keywords like "api", "endpoint", "route", "breaking change", etc.
  3. Creates standardized issues - Opens issues in all 9 SDK repositories with comprehensive information

Target Repositories

When API changes are detected, issues are created in:

  • openfoodfacts-php
  • openfoodfacts-js
  • openfoodfacts-laravel
  • openfoodfacts-python
  • openfoodfacts-ruby
  • openfoodfacts-java
  • openfoodfacts-elixir
  • openfoodfacts-dart
  • openfoodfacts-go

Issue Template

Each generated issue includes:

  • Release information with direct links to release notes
  • Full release notes in formatted code blocks
  • Action checklist for SDK maintainers (review changes, update code, test, release)
  • Useful links to API documentation and repository
  • Automatic labels (enhancement, api-update)

API Change Detection

The workflow uses pattern matching to detect API-related terms:

# Examples that trigger notifications:
"add /api/v1 prefix to all API routes"
"Add new routes and features (CRUD api)"
"Breaking changes to authentication API"

# Examples that don't trigger:
"fix container-deploy.yml config"
"add new commands to Makefile"

Error Handling

The workflow includes:

  • Success/failure tracking for each repository
  • Detailed logging and status reporting
  • Rate limiting protection (3-second delays between requests)
  • Comprehensive summary of results

Testing

The implementation has been thoroughly tested with:

  • ✅ YAML syntax validation
  • ✅ API detection logic with real changelog examples
  • ✅ Python script generation and JSON payload creation
  • ✅ GitHub API integration patterns

Documentation

Added docs/sdk-notification-workflow.md explaining the workflow configuration and testing approach.

This automation ensures SDK maintainers are promptly and consistently notified of API changes, improving the overall ecosystem's responsiveness to NutriPatrol updates.

Original prompt

This section details on the original issue you should resolve

<issue_title>Task</issue_title>
<issue_description>### Task
Create a github action that - on every release that mentions an API change - creates an issue in openfoodfacts-php, openfoodfacts-js, openfoodfacts-laravel, openfoodfacts-python, openfoodfacts-ruby, openfoodfacts-java, openfoodfacts-elixir, openfoodfacts-dart, openfoodfacts-go asking to Update the SDK accordingly.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #133

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: teolemon <1689815+teolemon@users.noreply.github.com>
…sting

Co-authored-by: teolemon <1689815+teolemon@users.noreply.github.com>
Copilot AI changed the title [WIP] Task Add GitHub Action to notify SDK repositories of API changes on release Sep 29, 2025
Copilot AI requested a review from teolemon September 29, 2025 14:41
@teolemon teolemon changed the title Add GitHub Action to notify SDK repositories of API changes on release feat: Add GitHub Action to notify SDK repositories of API changes on release Sep 29, 2025
@teolemon teolemon marked this pull request as ready for review September 29, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Task

2 participants