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

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


The following commit(s) were added to refs/heads/main by this push:
     new 56d1f3844e Remove unused sync_authors workflow and scripts (#33350)
56d1f3844e is described below

commit 56d1f3844ed836c462f2c896d3a9a917a8f9d3b6
Author: Hussein Awala <[email protected]>
AuthorDate: Sat Aug 12 20:55:18 2023 +0200

    Remove unused sync_authors workflow and scripts (#33350)
---
 .github/workflows/ci.yml           | 12 ++----
 .github/workflows/sync_authors.yml | 65 ---------------------------------
 .pre-commit-config.yaml            |  1 -
 scripts/ci/runners/sync_authors.py | 75 --------------------------------------
 4 files changed, 3 insertions(+), 150 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 59c4a0adb1..0e3b91e33d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -61,15 +61,9 @@ jobs:
   build-info:
     name: "Build info"
     # The runs-on cannot refer to env. or secrets. context, so we have no
-    # option but to specify a hard-coded list here. This is "safe", as the list
-    # is checked again by the runner using it's own list, so a PR author cannot
-    # change this and get access to our self-hosted runners
-    #
-    # This list is kept up-to-date from the list of authors found in the
-    # 'airflow-ci-infra' by the 'sync_authors' Github workflow. It uses a 
regexp
-    # to find the list of authors and replace them, so any changes to the
-    # formatting of the contains(fromJSON()) structure below will need to be
-    # reflected in that workflow too.
+    # option but to specify a hard-coded list here. This is "safe", the
+    # runner checks if the user is an owner or collaborator of the repo
+    # before running the workflow.
     runs-on: "ubuntu-22.04"
     env:
       GITHUB_CONTEXT: ${{ toJson(github) }}
diff --git a/.github/workflows/sync_authors.yml 
b/.github/workflows/sync_authors.yml
deleted file mode 100644
index 5ef30ba9c4..0000000000
--- a/.github/workflows/sync_authors.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# 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: Sync authors list
-
-on:  # yamllint disable-line rule:truthy
-  schedule:
-    #        min   hr    dom   mon   dow
-    - cron: '11    01    *     *     *'     # daily at 1.11am
-  workflow_dispatch:
-  # only users with write access to apache/airflow can run manually
-  # 
https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
-
-permissions:
-  contents: write
-  pull-requests: write
-
-jobs:
-  sync:
-    name: Sync
-    runs-on: ubuntu-latest
-
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v3
-
-      - name: Python
-        uses: actions/setup-python@v4
-        with:
-          python-version: '3.10'
-
-      - name: Requests
-        run: |
-          pip install requests toml
-
-      - name: Sync the authors list
-        env:
-          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        run: |
-          python scripts/ci/runners/sync_authors.py
-          git config user.name "GitHub Actions"
-          git config user.email "[email protected]"
-          if [ -n "$(git status --porcelain)" ]; then
-            branch=update-$(date +%s)
-            git add -A
-            git checkout -b $branch
-            git commit --message "Authors list automatic update"
-            git push origin $branch
-            gh pr create --title "Authors list automatic update" --body ''
-          fi
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a45e832b21..2abf7de0b7 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -849,7 +849,6 @@ repos:
         language: python
         pass_filenames: true
         files: ^\.github/workflows/.*\.yml$
-        exclude: ^\.github/workflows/sync_authors\.yml$
         additional_dependencies: ['PyYAML', 'rich>=12.4.4']
       - id: check-docstring-param-types
         name: Check that docstrings do not specify param types
diff --git a/scripts/ci/runners/sync_authors.py 
b/scripts/ci/runners/sync_authors.py
deleted file mode 100644
index 70f246eb4b..0000000000
--- a/scripts/ci/runners/sync_authors.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env python
-
-# 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.
-
-from __future__ import annotations
-
-import re
-
-import requests
-import toml
-
-# The list of users in the 'build-info' job looks like:
-#
-#       contains(fromJSON('[
-#         "BasPH",
-#         ...
-#       ]'), github.event.pull_request.user.login)
-#
-# This script should replace the contents of the array with a new list of
-# identically formatted names, such that changes to the source of truth:
-AUTHORS = 
"https://raw.githubusercontent.com/apache/airflow-ci-infra/main/authors.toml";
-
-# ...end up being reflected in the ci.yml:
-WORKFLOW = ".github/workflows/ci.yml"
-
-
-req = requests.get(AUTHORS)
-author_list = toml.loads(req.text)
-
-author_set = set()
-for membership in author_list:
-    author_set.update([author for author in author_list[membership]])
-
-authors = ""
-for author in sorted(author_set):
-    authors += f'            "{author}",\n'
-
-authors = authors[:-2]
-
-with open(WORKFLOW) as handle:
-    new_ci = re.sub(
-        r"""
-            ^
-            # matches the entire file up to contains(fromJSON('[
-            ( .*? contains.fromJSON \( ' \[ \n )
-
-            # the list of authors (which is replaced)
-            .*?
-
-            # the remainder of the file, from the end of the list onwards
-            ( \s+ \] ' \), . github\.event\.pull_request\.user\.login .*? )
-            $
-        """,
-        f"\\1{authors}\\2",
-        handle.read(),
-        flags=re.DOTALL | re.VERBOSE,
-    )
-
-with open(WORKFLOW, "w") as handle:
-    handle.write(new_ci)

Reply via email to