GithubHelp home page GithubHelp logo

Comments (11)

Yikun avatar Yikun commented on August 10, 2024 1

@yi-Xu-0100 这个我会尽快解决,python版本比较好改了。:)

我看链接[1]提到的git rev-list -n 1 --all这个方法感觉还不错。

[1] https://stackoverflow.com/questions/5491832/how-can-i-check-whether-a-git-repository-has-any-commits-in-it

from hub-mirror-action.

Yikun avatar Yikun commented on August 10, 2024 1

@yi-Xu-0100 OK,明白了,这是因为empty push失败了,加到failed list里了,如果failed list非空,会在最后退出的。

所以,你这个场景,即使修复了empty这个问题,可能也不能完全避免。感觉需要一个参数来控制最后的退出

比如类似skip_exit之类的,默认保持现状,如果用户设置为True的话,job永远成功,不会退出。这样不会break到后面的job。

from hub-mirror-action.

Yikun avatar Yikun commented on August 10, 2024

现在这个empty同步是直接中断挂掉了,还是最后raise error?

from hub-mirror-action.

yi-Xu-0100 avatar yi-Xu-0100 commented on August 10, 2024

@Yikun 不会中断,但是最后会返回步骤失败,造成缓存无法完成。虽然都同步成功了,但是后面步骤都不会完成。

from hub-mirror-action.

yi-Xu-0100 avatar yi-Xu-0100 commented on August 10, 2024

@Yikun https://github.com/yi-Xu-0100/test/runs/1258327855

可以看下以前的这个测试,MyWiki 是空仓库,同步会因为 push fail 而使结果错误。

是否应该在 clone 的地方判断,因为 clone 的结果中包含 warning 提示。

Backup MyWiki ...
(0/3) Downloading...
Cloning into 'MyWiki'...
warning: You appear to have cloned an empty repository.
+ cd MyWiki
+ create_repo MyWiki ***
++ curl https://gitee.com/api/v5/users/yiXu0100/repos
  % Total    % Received % Xferd  Average S++ peejq d '.[] | select(.full_name=="yiXu0100/MyWiki").name' 
 Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0++ wc -l

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0
 99  111k   99  111k    0     0  21522      0  0:00:05  0:00:05 --:--:-- 22261
100  111k  100  111k    0     0  21545      0  0:00:05  0:00:05 --:--:-- 36242
+ has_repo=1
+ '[' 1 == 0 ']'
+ git remote add gitee [email protected]:yiXu0100/MyWiki.git
+ update_repo
(1/3) Updating...
+ echo -e '\033[31m(1/3)\033[0m' Updating...
+ git pull -p
Your configuration specifies to merge with the ref 'refs/heads/master'
from the remote, but no such ref was fetched.
+ echo 'Update failed'
+ import_repo
+ echo -e '\033[31m(2/3)\033[0m' Importing...
+ git remote set-head origin -d
Update failed
(2/3) Importing...
+ [[ true == \t\r\u\e ]]
+ git push -f gitee 'refs/remotes/origin/*:refs/heads/*' --tags --prune
Warning: Permanently added 'gitee.com,117.28.245.92' (ECDSA) to the list of known hosts.
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
Connection to gitee.com closed by remote host.
 Push failed 
error: failed to push some refs to '[email protected]:yiXu0100/MyWiki.git'

from hub-mirror-action.

yi-Xu-0100 avatar yi-Xu-0100 commented on August 10, 2024

我创建的 repo-list-genreator - github action 自从 v1.0.0 开始已经能够去除空仓库了!这样暂时就不会有这个空仓库推送报错的问题了!

from hub-mirror-action.

yi-Xu-0100 avatar yi-Xu-0100 commented on August 10, 2024

@Yikun 空仓库在新版本中仍然无法同步并给出 error,如果只使用当前的 action 可能会造成缓存模式中断和后续任务失败,建议在 python 中增加判断空仓库并跳过给出 warning 的逻辑。😀

from hub-mirror-action.

Yikun avatar Yikun commented on August 10, 2024

如果只使用当前的 action 可能会造成缓存模式中断和后续任务失败

昨天我没注意,你说还会影响后续任务失败吗?我试了下,似乎不会break流程 [1],只是有一个failed。因为理论上讲,所有的主流程错误都会被catch住,并且append到failed list里面

[1] https://github.com/Yikun/hub-mirror-action/pull/95/checks?check_run_id=2077891384

from hub-mirror-action.

yi-Xu-0100 avatar yi-Xu-0100 commented on August 10, 2024

@Yikun
我指的是当前 workflows 中这个任务之后的任务,造成整个 job 失败,应该会造成 cache 缓存失败。

当然其他的仓库同步是完成的。

from hub-mirror-action.

Yikun avatar Yikun commented on August 10, 2024

另外,empty这个问题已经解决了:#62 ,可以试试 uses: Yikun/hub-mirror-action@empty,没问题我就合入了。
image
[1] https://github.com/Yikun/hub-mirror-action/pull/95/checks?check_run_id=2082408627

from hub-mirror-action.

yi-Xu-0100 avatar yi-Xu-0100 commented on August 10, 2024

@Yikun 看起来非常不错👍,合并后关闭

from hub-mirror-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.