potiuk commented on code in PR #41443: URL: https://github.com/apache/airflow/pull/41443#discussion_r1715947761
########## .github/workflows/news-fragment.yml: ########## @@ -0,0 +1,52 @@ +# 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: CI + +on: # yamllint disable-line rule:truthy + pull_request: + types: [labeled, unlabeled, opened, reopened, synchronize] + +jobs: + check-news-fragment: + name: Check News Fragment + runs-on: ubuntu-20.04 + if: "contains(github.event.pull_request.labels.*.name, 'airflow3.0:breaking')" + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + # `towncrier check` runs `git diff --name-only origin/main...`, which + # needs a non-shallow clone. + fetch-depth: 0 + + - name: Check news fragment + run: > + if ! pipx run towncrier check + --dir . + --config newsfragments/config.toml + --compare-with origin/${{ github.base_ref }}; then + + echo "Please check + https://github.com/apache/airflow/blob/main/contributing-docs/16_contribution_workflow.rst + for guidance." + + false + + fi Review Comment: Up to you - I have just seen how you struggled with it and pushed a number of changes to CI which is always pain (and bash is something we wanted to minimise). BTW. We could also run ``` if 'airflow3.0:breaking' in self._pr_labels: res = run_command("towncrier", "check", "--dir", AIRFLOW_SOURCE_DIR, "--config", "newsfragments/config.toml", "--compare-with HEAD^", check=False) if res.resultcode !=0: get_console() ``` Would need to add towncrier as breeze dependency, but since breeze auto-upgrades, it would be easy. It would have the same properties for testing as explained before. When selective checks are run depth-fetch: 2 is set automatically to get list of changed files. BTW. I **think** - if I am not mistaken - that the bash check might have an error - it likely fails because `pipx` is not available in CI and not because towncrier check fails. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
