This is an automated email from the ASF dual-hosted git repository.

jiadongb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git


The following commit(s) were added to refs/heads/main by this push:
     new f8999290fa feat(ci): automatically send an email to dev list on ddl 
change (#4250)
f8999290fa is described below

commit f8999290fa66b512e51323e721d0157347800183
Author: Grace Chia <[email protected]>
AuthorDate: Mon Mar 9 15:21:02 2026 -0700

    feat(ci): automatically send an email to dev list on ddl change (#4250)
    
    <!--
    Thanks for sending a pull request (PR)! Here are some tips for you:
    1. If this is your first time, please read our contributor guidelines:
    [Contributing to
    Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md)
      2. Ensure you have added or run the appropriate tests for your PR
      3. If the PR is work in progress, mark it a draft on GitHub.
      4. Please write your PR title to summarize what this PR proposes, we
        are following Conventional Commits style for PR titles as well.
      5. Be sure to keep the PR description updated to reflect all changes.
    -->
    
    ### What changes were proposed in this PR?
    <!--
    Please clarify what changes you are proposing. The purpose of this
    section
    is to outline the changes. Here are some tips for you:
      1. If you propose a new API, clarify the use case for a new API.
      2. If you fix a bug, you can clarify why it is a bug.
      3. If it is a refactoring, clarify what has been changed.
      3. It would be helpful to include a before-and-after comparison using
         screenshots or GIFs.
      4. Please consider writing useful notes for better and faster reviews.
    -->
    This PR adds a workflow that automatically sends an email notifying
    developers on DDL change.
    
    <img width="691" height="429" alt="Screenshot 2026-03-01 at 11 48 08 PM"
    
src="https://github.com/user-attachments/assets/7fa631da-35b1-4818-9ac3-adcb6345783a";
    />
    
    Please note that we will need to add GitHub secrets MAIL_USERNAME and
    MAIL_PASSWORD to specify which email to send the email from.
    
    ### Any related issues, documentation, discussions?
    <!--
    Please use this section to link other resources if not mentioned
    already.
    1. If this PR fixes an issue, please include `Fixes #1234`, `Resolves
    #1234`
    or `Closes #1234`. If it is only related, simply mention the issue
    number.
      2. If there is design documentation, please add the link.
      3. If there is a discussion in the mailing list, please add the link.
    -->
    Closes #4166
    
    ### How was this PR tested?
    <!--
    If tests were added, say they were added here. Or simply mention that if
    the PR
    is tested with existing test cases. Make sure to include/update test
    cases that
    check the changes thoroughly including negative and positive cases if
    possible.
    If it was tested in a way different from regular unit tests, please
    clarify how
    you tested step by step, ideally copy and paste-able, so that other
    reviewers can
    test and check, and descendants can verify in the future. If tests were
    not added,
    please describe why they were not added and/or why it was difficult to
    add.
    -->
    Tested on my private repository.
    
    ### Was this PR authored or co-authored using generative AI tooling?
    <!--
    If generative AI tooling has been used in the process of authoring this
    PR,
    please include the phrase: 'Generated-by: ' followed by the name of the
    tool
    and its version. If no, write 'No'.
    Please refer to the [ASF Generative Tooling
    Guidance](https://www.apache.org/legal/generative-tooling.html) for
    details.
    -->
    Co-authored using: Claude Code (Sonnet 4.6)
    
    ---------
    
    Co-authored-by: Chen Li <[email protected]>
---
 .../automatic-email-notif-on-ddl-change.yml        | 62 ++++++++++++++++++++++
 LICENSE                                            |  4 ++
 2 files changed, 66 insertions(+)

diff --git a/.github/workflows/automatic-email-notif-on-ddl-change.yml 
b/.github/workflows/automatic-email-notif-on-ddl-change.yml
new file mode 100644
index 0000000000..6d0fa62cd6
--- /dev/null
+++ b/.github/workflows/automatic-email-notif-on-ddl-change.yml
@@ -0,0 +1,62 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Automatic email notification on DDL change
+
+on:
+  pull_request:
+    types:
+      - closed
+
+jobs:
+  notify:
+    if: >-
+      github.event.pull_request.merged == true && 
+      contains(github.event.pull_request.labels.*.name, 'ddl-change')
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          sparse-checkout: sql/updates/
+
+      - name: Get added file in sql/updates/
+        id: get_sql_file
+        run: |
+          FILE=$(git diff --name-only --diff-filter=A \
+            ${{ github.event.pull_request.base.sha }} \
+            ${{ github.event.pull_request.merge_commit_sha }} \
+            -- 'sql/updates/')
+          echo "sql_file=$FILE" >> $GITHUB_OUTPUT
+      - name: Send email
+        uses: dawidd6/action-send-mail@v7
+        with:
+          server_address: smtp.gmail.com
+          server_port: 465
+          secure: true
+          username: ${{secrets.NOREPLY_EMAIL_USERNAME}}
+          password: ${{secrets.NOREPLY_EMAIL_PASSWORD}}
+          subject: Actions Required After Pulling Latest Update
+          to: [email protected]
+          from: ${{ github.event.pull_request.user.login }}
+          body: |
+            Hi all,
+            We have merged PR #${{ github.event.pull_request.number }} (${{ 
github.event.pull_request.html_url }}): ${{github.event.pull_request.title}}. 
To incorporate the change, please apply ${{ steps.get_sql_file.outputs.sql_file 
}} to your local Postgres instance and run sbt jooqGenerate to generate jooq 
classes. 
+
+            Best,
+            ${{ github.event.pull_request.user.login }}
+          reply_to: [email protected]
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 6734840ae8..27b73f30b8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -231,6 +231,10 @@ This product bundles code derived from TypeFox 
monaco-languageclient:
   Copyright (c) 2024 TypeFox and others.
   Source: https://github.com/TypeFox/monaco-languageclient
 
+This product incorporates dawidd6-action-send-mail as a GitHub Actions 
workflow dependency:
+  Copyright (c) 2020 Dawid Dziurla
+  Source: https://github.com/dawidd6/action-send-mail
+
 This product includes SVG icons from SVGRepo:
   - frontend/src/assets/svg/operator-view-result.svg
   - frontend/src/assets/svg/operator-reuse-cache-valid.svg

Reply via email to