You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/20 09:30:53 UTC

[GitHub] [airflow] potiuk commented on pull request #22327: Rewrite Selective Check in Python

potiuk commented on pull request #22327:
URL: https://github.com/apache/airflow/pull/22327#issuecomment-1073209858


   > Direct Push (PR is merged) doesn't generate a commit hash (SHA)
   
   It also generates commit hash, but we do not care about it. For Direct Push/Merge we always want to run all posible tests so in this case selective check turns into "run everything possible".
   
   > Merge Commit generates a commit hash
   
   Yep. We have it in all cases (because we are using it to assign the "tag" to images we build). But in case of Pull Request Github prepares a "merge commit" containing only changes coming from the PR, and the commit HASH we have is this particular commit.
   
   
   >   CHANGED_FILES=$(git diff-tree --no-commit-id --name-only  -r "${INCOMING_COMMIT_SHA}^" "${INCOMING_COMMIT_SHA} || true) 
   
   This is just a way how you can get the list of files when you get an incoming commit:
   1) git diff-tree produces information about difference between two commits
   2) --no-commit-id --name-only -> this causes git diff-tree to only show file names that were changed between the two commits
   3) -r  "${INCOMING_COMMIT_SHA}^"  -> this is the parent (^) of the incoming merge commit
   4) "${INCOMING_COMMIT_SHA}"  -> this is the incoming commit
   
   So what we get at the end is the list of changed files between the "parent of commit" and "commit" that is incoming from the PR.
   
   


-- 
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