Repository navigation
[BREAKING] Fix cross-worker settings consistency and Redis Explorer #675
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Notes Check | |
| on: | |
| pull_request: | |
| branches: | |
| - Development | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - edited | |
| jobs: | |
| check-release-notes: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 | |
| with: | |
| files_yaml: | | |
| application: | |
| - 'application/**' | |
| release_notes: | |
| - 'docs/explanation/release_notes.md' | |
| latest_features: | |
| - 'application/single_app/support_menu_config.py' | |
| - name: Check for feature/fix keywords in PR | |
| id: check-keywords | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| run: | | |
| echo "🔍 Analyzing PR title and body for feature/fix indicators..." | |
| # Convert to lowercase for case-insensitive matching | |
| title_lower=$(echo "$PR_TITLE" | tr '[:upper:]' '[:lower:]') | |
| body_lower=$(echo "$PR_BODY" | tr '[:upper:]' '[:lower:]') | |
| # Check for feature indicators | |
| if echo "$title_lower $body_lower" | grep -qE "(feat|feature|add|new|implement|introduce|enhancement|improve)"; then | |
| echo "has_feature=true" >> $GITHUB_OUTPUT | |
| echo "📦 Feature-related keywords detected" | |
| else | |
| echo "has_feature=false" >> $GITHUB_OUTPUT | |
| fi | |
| # Check for fix indicators | |
| if echo "$title_lower $body_lower" | grep -qE "(fix|bug|patch|resolve|correct|repair|hotfix|issue)"; then | |
| echo "has_fix=true" >> $GITHUB_OUTPUT | |
| echo "🐛 Fix-related keywords detected" | |
| else | |
| echo "has_fix=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Determine if release notes update is required | |
| id: require-notes | |
| env: | |
| APPLICATION_CHANGED: ${{ steps.changed-files.outputs.application_any_changed }} | |
| RELEASE_NOTES_CHANGED: ${{ steps.changed-files.outputs.release_notes_any_changed }} | |
| HAS_FEATURE: ${{ steps.check-keywords.outputs.has_feature }} | |
| HAS_FIX: ${{ steps.check-keywords.outputs.has_fix }} | |
| run: | | |
| echo "" | |
| echo "================================" | |
| echo "📋 PR Analysis Summary" | |
| echo "================================" | |
| echo "Application files changed: $APPLICATION_CHANGED" | |
| echo "Release notes updated: $RELEASE_NOTES_CHANGED" | |
| echo "Feature keywords found: $HAS_FEATURE" | |
| echo "Fix keywords found: $HAS_FIX" | |
| echo "================================" | |
| echo "" | |
| # Determine if this PR likely needs release notes | |
| needs_notes="false" | |
| reason="" | |
| if [[ "$APPLICATION_CHANGED" == "true" ]]; then | |
| if [[ "$HAS_FEATURE" == "true" ]]; then | |
| needs_notes="true" | |
| reason="Feature-related keywords detected and files under application/ changed" | |
| elif [[ "$HAS_FIX" == "true" ]]; then | |
| needs_notes="true" | |
| reason="Fix-related keywords detected and files under application/ changed" | |
| fi | |
| fi | |
| echo "needs_notes=$needs_notes" >> $GITHUB_OUTPUT | |
| echo "reason=$reason" >> $GITHUB_OUTPUT | |
| - name: Determine if latest features update is recommended | |
| id: require-latest-features | |
| env: | |
| APPLICATION_CHANGED: ${{ steps.changed-files.outputs.application_any_changed }} | |
| LATEST_FEATURES_CHANGED: ${{ steps.changed-files.outputs.latest_features_any_changed }} | |
| HAS_FEATURE: ${{ steps.check-keywords.outputs.has_feature }} | |
| run: | | |
| echo "" | |
| echo "================================" | |
| echo "✨ Latest Features Analysis" | |
| echo "================================" | |
| echo "Application files changed: $APPLICATION_CHANGED" | |
| echo "Latest Features catalog updated: $LATEST_FEATURES_CHANGED" | |
| echo "Feature keywords found: $HAS_FEATURE" | |
| echo "================================" | |
| echo "" | |
| needs_latest_features="false" | |
| latest_features_reason="" | |
| if [[ "$APPLICATION_CHANGED" == "true" && "$HAS_FEATURE" == "true" && "$LATEST_FEATURES_CHANGED" != "true" ]]; then | |
| needs_latest_features="true" | |
| latest_features_reason="Feature-related keywords detected and files under application/ changed, but application/single_app/support_menu_config.py was not updated" | |
| echo "⚠️ Latest Features catalog review recommended." | |
| echo "📝 Reason: $latest_features_reason" | |
| echo "💡 If this change is user-facing or admin-facing, consider adding or updating a Latest Features card." | |
| elif [[ "$LATEST_FEATURES_CHANGED" == "true" ]]; then | |
| echo "✅ Latest Features catalog was updated." | |
| elif [[ "$APPLICATION_CHANGED" != "true" ]]; then | |
| echo "ℹ️ No files under application/ changed - Latest Features catalog update not required." | |
| elif [[ "$HAS_FEATURE" != "true" ]]; then | |
| echo "ℹ️ No feature keywords detected - Latest Features catalog update optional." | |
| else | |
| echo "ℹ️ Latest Features catalog update optional." | |
| fi | |
| echo "needs_latest_features=$needs_latest_features" >> $GITHUB_OUTPUT | |
| echo "reason=$latest_features_reason" >> $GITHUB_OUTPUT | |
| - name: Validate release notes update | |
| env: | |
| APPLICATION_CHANGED: ${{ steps.changed-files.outputs.application_any_changed }} | |
| RELEASE_NOTES_CHANGED: ${{ steps.changed-files.outputs.release_notes_any_changed }} | |
| NEEDS_NOTES: ${{ steps.require-notes.outputs.needs_notes }} | |
| REASON: ${{ steps.require-notes.outputs.reason }} | |
| APPLICATION_FILES: ${{ steps.changed-files.outputs.application_all_changed_files }} | |
| run: | | |
| echo "" | |
| if [[ "$NEEDS_NOTES" == "true" && "$RELEASE_NOTES_CHANGED" != "true" ]]; then | |
| echo "⚠️ ==============================================" | |
| echo "⚠️ RELEASE NOTES UPDATE RECOMMENDED" | |
| echo "⚠️ ==============================================" | |
| echo "" | |
| echo "📝 Reason: $REASON" | |
| echo "" | |
| echo "This PR appears to contain changes that should be documented" | |
| echo "in the release notes (docs/explanation/release_notes.md)." | |
| echo "" | |
| echo "📁 Application files changed:" | |
| echo "$APPLICATION_FILES" | tr ' ' '\n' | sed 's/^/ - /' | |
| echo "" | |
| echo "💡 Please consider adding an entry to release_notes.md describing:" | |
| echo " • New features added" | |
| echo " • Bug fixes implemented" | |
| echo " • Breaking changes (if any)" | |
| echo " • Files modified" | |
| echo "" | |
| echo "📖 Follow the existing format in release_notes.md" | |
| echo "" | |
| # Exit with warning (non-zero) to flag the PR but not block it | |
| # Change 'exit 0' to 'exit 1' below to make this a hard requirement | |
| exit 0 | |
| elif [[ "$RELEASE_NOTES_CHANGED" == "true" ]]; then | |
| echo "✅ Release notes have been updated - great job!" | |
| elif [[ "$APPLICATION_CHANGED" != "true" ]]; then | |
| echo "ℹ️ No files under application/ changed - release notes update not required." | |
| else | |
| echo "ℹ️ Changes appear to be minor - release notes update optional." | |
| fi | |
| echo "" | |
| echo "✅ Release notes check completed successfully." | |
| - name: Post PR comment (when notes needed but missing) | |
| if: steps.require-notes.outputs.needs_notes == 'true' && steps.changed-files.outputs.release_notes_any_changed != 'true' | |
| # Best-effort reminder. Pull requests from forks and from Dependabot run with a | |
| # read-only GITHUB_TOKEN, so creating a comment raises "Resource not accessible by | |
| # integration". This reminder is advisory, so a failure here must not fail the job. | |
| continue-on-error: true | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| const reason = '${{ steps.require-notes.outputs.reason }}'; | |
| // Check if we already commented | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number | |
| }); | |
| const botComment = comments.find(comment => | |
| comment.user.type === 'Bot' && | |
| comment.body.includes('📋 Release Notes Reminder') | |
| ); | |
| if (!botComment) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: `## 📋 Release Notes Reminder | |
| This PR appears to contain changes that should be documented in the release notes. | |
| **Reason:** ${reason} | |
| ### 📝 Please consider updating: | |
| \`docs/explanation/release_notes.md\` | |
| ### Template for new features: | |
| \`\`\`markdown | |
| * **Feature Name** | |
| * Brief description of the feature. | |
| * **Key Details**: Important implementation notes. | |
| * **Files Modified**: \`file1.py\`, \`file2.js\`. | |
| * (Ref: related components, patterns) | |
| \`\`\` | |
| ### Template for bug fixes: | |
| \`\`\`markdown | |
| * **Bug Fix Title** | |
| * Description of what was fixed. | |
| * **Root Cause**: What caused the issue. | |
| * **Solution**: How it was resolved. | |
| * **Files Modified**: \`file.py\`. | |
| * (Ref: related issue numbers, components) | |
| \`\`\` | |
| --- | |
| *This is an automated reminder. If this PR doesn't require release notes (e.g., internal refactoring, documentation-only changes), you can ignore this message.*` | |
| }); | |
| } | |
| - name: Post PR comment (when latest features likely needed but missing) | |
| if: steps.require-latest-features.outputs.needs_latest_features == 'true' | |
| # Best-effort reminder. Pull requests from forks and from Dependabot run with a | |
| # read-only GITHUB_TOKEN, so creating a comment raises "Resource not accessible by | |
| # integration". This reminder is advisory, so a failure here must not fail the job. | |
| continue-on-error: true | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| with: | |
| script: | | |
| const reason = '${{ steps.require-latest-features.outputs.reason }}'; | |
| const marker = '✨ Latest Features Catalog Reminder'; | |
| // Check if we already commented | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number | |
| }); | |
| const botComment = comments.find(comment => | |
| comment.user.type === 'Bot' && | |
| comment.body.includes(marker) | |
| ); | |
| if (!botComment) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: `## ${marker} | |
| This PR appears to contain application changes for a feature, but the in-app Latest Features catalog was not updated. | |
| **Reason:** ${reason} | |
| ### ✨ Please consider reviewing: | |
| ` + '`application/single_app/support_menu_config.py`' + ` | |
| If this change is visible to end users or admins, consider adding or updating a Latest Features card. If this is internal-only, no catalog update is needed. | |
| --- | |
| *This is an automated, non-blocking reminder. You can ignore it when the change does not need a Latest Features card.*` | |
| }); | |
| } |