You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@yetus.apache.org by "Allen Wittenauer (Jira)" <ji...@apache.org> on 2020/09/27 17:02:00 UTC

[jira] [Comment Edited] (YETUS-966) github actions very confused about tags?

    [ https://issues.apache.org/jira/browse/YETUS-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17202860#comment-17202860 ] 

Allen Wittenauer edited comment on YETUS-966 at 9/27/20, 5:01 PM:
------------------------------------------------------------------

Notes:

* With checkoutv2 and fetch-depth 0, the githubactions robot no longer needs to modify the repo.  Will update the docs to reflect that.

Code path is basically:

```
git reset --hard
git clean
git checkout --force (default branch) 
git pull --rebase
git checkout --force (patch branch)
git fetch
git reset --hard FETCH_HARD
git clean
```

Details:
* reset and clean the repo to the top because who knows what state it is in
* checkout the default branch
* update all branches to the latest (note that --tags is not provided... it probably should be)
* At this point, all remote branches and the main branch should be relatively good to go to compare against
* checkout the branch that is going to get worked on, forcibly overwriting any craziness
* update it to be the same as remote by doing a fetch + reset
* clean again

Where things go wrong is the git reset --hard FETCH_HARD.  There is no guarantee that FETCH_HARD actually refers to the ref we just fetched if there were no changes. Also, git pull doesn't work after checkout of a tag because the repo is in detached state.  Running these commands locally completely duplicates what I see on GitHub.  

Now how to fix this without breaking everything else ...


was (Author: aw):
Notes:

* With checkoutv2 and fetch-depth 0, the githubactions robot no longer needs to modify the repo.  Will update the docs to reflect that.

Code path is basically:

```
git reset --hard
git clean
git checkout --force (default branch) 
git pull --rebase
git checkout --force (patch branch)
git fetch
git reset --hard FETCH_HARD
git clean
```

Details:
* reset and clean the repo to the top because who knows what state it is in
* checkout the default branch
* update all branches to the latest (note that --tags is not provided... it probably should be)
* At this point, all remote branches and the main branch should be relatively good to go to compare against
* checkout the branch that is going to get worked on, forcibly overwriting any craziness
* update it to be the same as remote by doing a fetch + reset
* clean again

Where things go wrong is the git reset --hard FETCH_HARD.  There is no guarantee that FETCH_HARD actually refers to the ref we just fetched if there were no changes.  Running these commands locally completely duplicates what I see on GitHub.  

Now how to fix this without breaking everything else ...

> github actions very confused about tags?
> ----------------------------------------
>
>                 Key: YETUS-966
>                 URL: https://issues.apache.org/jira/browse/YETUS-966
>             Project: Yetus
>          Issue Type: Improvement
>          Components: Precommit
>    Affects Versions: 0.12.0
>            Reporter: Allen Wittenauer
>            Assignee: Allen Wittenauer
>            Priority: Critical
>
> The github action build for the rel/0.12.0 tag got very, very, very confused.  See below for more.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)