You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2024/03/17 17:00:08 UTC
[PR] Use common image build workflows in pull-request-target workflow [airflow]
potiuk opened a new pull request, #38231:
URL: https://github.com/apache/airflow/pull/38231
We left a little duplication of the code that has been used to build images in "Build Images" workflow - that is run as "Pull request target" workflow - mainly because of the security concerns and the way how we are replacing the source for actions, workflows and CI scripts from the incoming PRs with the one coming from the target branch.
This change moves parts of the code that was used to replace the scripts to the shared workflows and removes the composite actions that we used in the past as common code.
As part of that change it turned out that there was a bug in target-commit-sha usage for PRs coming from the forks where rather than using the merge commit, we were using the original commit coming from the fork. This was the reason why often we asked the users to rebase their PRs where some new breaking changes were added in the workflows or new dependencies added. With using merge commit, we should be experiencing the "please rebase to take into account the latest version of CI or Airflow" far less frequently.
<!--
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.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Use common image build workflows in pull-request-target workflow [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #38231:
URL: https://github.com/apache/airflow/pull/38231#issuecomment-2006977893
Would love to get that one reviewed and `in` as it would complete some of the DRY things and would enable more interesting changes in our workflows that I am going to propose soon (getting them limited and faster). Having this one in and tested would enable much faster iteration on the workflows.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Use common image build workflows in pull-request-target workflow [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #38231:
URL: https://github.com/apache/airflow/pull/38231#issuecomment-2002540737
This is the nice "final" (never say final) removal of the non-DRY code in the huge workflow refactor. It finally removes the repeated build-image code between actions and workflows.
It does need a bit more scrutiny - because unlike the other changes it modifies the "pull request target" workflow that is a potential security issue (see the warning messages in the workflows). I tested it here https://github.com/potiuk/airflow/pull/297 - simulating someone (higrys is my second persona) trying to hack the workflow by submitting a change to it in my fork - and it nicely DID NOT HACK IT .... The "ci-image-build.yaml` workflow used in the PR was the one from "target" not the one that came with PR (which is how `pull-request-target` should work).
But ... review woudl be really useful
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Use common image build workflows in pull-request-target workflow [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #38231:
URL: https://github.com/apache/airflow/pull/38231
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org