Comments (9)
At least mlr-org/mlr@12864ca was not up-to-date with the most recent commits in the problematic build. https://travis-ci.org/mlr-org/mlr/jobs/400392404#L2296. This maybe then triggered a commit that deployed a historic state.
Nevertheless, only NEWS
was staged and in any case nothing more should have been deployed here.
Maybe inserting another git pull
after git checkout -B <branch>
helps?
from tic.
We also faced this in mlr
: mlr-org/mlr@12864ca
from tic.
Thanks. It's strange that other files were deployed besides NEWS
. The safest thing would be to operate on FETCH_HEAD
, commit there, and then try to deploy that to master
. If this fails then probably another commit got in the way, and we fail the deploy (maybe push to a new branch beforehand). I'll take care of checking this in #62.
from tic.
Tricky problem here.
Suppose master
has commits A
, B
, C
, CI runs for commit A
. The deployment is run against commit A
, but we need to add our commit on top of commit C
(otherwise we can't push).
A--B--C
then becomes A--B--C--A'
.
The issue described here arises because the code incorrectly issues git reset C
when A
is checked out. This doesn't change the file system contents for the clone, and has the effect that A'
reverts C
and B
.
What are the alternatives?
- Do not reset, commit
A'
on top ofA
. What then? One of:- Fail when pushing
- Run
git pull --rebase
- Push to a separate branch, issue a pull request
- Create and push a synthetic commit
X
to trigger another CI run - Do nothing
- When deploying, always use the latest tip. This doesn't guarantee that deployment uses tested code
- Rebase to
A--A'--B--C
, then force-push -- very risky- What if
C
has[ci skip]
, will a CI run be started forB
? - What if CI for
B
is already running? What if CI forB
has completed before?
- What if
- ?
from tic.
Maybe a feasible strategy:
- Commit
A'
on top ofA
in a branch - Reset to
C
- Cherry-pick
A'
ontoC
- Failure: fail deploy
- Success: go on
from tic.
Great that you figured out the problem already!
Not sure if it helps, but the git commands we used in mlr
never triggered such problems.
Maybe you can get inspired by them to solve this problem here.
Looks very basic but does a robust job in practice.
https://github.com/mlr-org/mlr/blob/deaad6496df63de10b8d1af0b3f6b6663dea3fd5/.travis.yml#L52-L67
- git checkout master
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""
- R --no-save <<< "devtools::document(roclets=c('rd', 'collate', 'namespace'))"
- ./thirdparty/gen_families.sh > man/mlrFamilies.Rd
- git config user.name $GN
- git config user.email $GM
- git config credential.helper "store --file=.git/credentials"
- bash inst/convert_to_ascii_news.sh
- echo "https://$GT:@github.com" >> .git/credentials
- git config push.default matching
- git add --force NEWS
- git add --force man/*
- git add --force NAMESPACE
- git commit man DESCRIPTION NAMESPACE NEWS -m "update auto-generated documentation [ci skip]" || true
- git push
- "[ $TRAVIS_PULL_REQUEST == \"false\" -a $TRAVIS_BRANCH == \"master\" ] && curl -s -X POST -H \"Content-Type:application/json\" -H \"Accept:application/json\" -H \"Travis-API-Version:3\" -H \"Authorization:token $TT\" -d \"{\\\"request\\\":{\\\"branch\\\":\\\"gh-pages\\\", \\\"message\\\":\\\"commit $TRAVIS_COMMIT $TRAVIS_COMMIT_MSG\\\"}}\" https://api.travis-ci.org/repo/mlr-org%2Fmlr-tutorial/requests"
from tic.
Thanks. This does look interesting but how are race conditions dealt with in your script? It looks like the git push
will just fail -- not ideal.
Cherry-picking seems to work.
from tic.
It looks like the git push will just fail -- not ideal.
Probably. Not ideal but safe - and since we only use it for automatic man/ deployment, this will just be done in the last commit that isn't in a race.
But if you deploy other files its not perfect, sure.
Cherry-picking seems to work.
If that works, great 👍
from tic.
Implemented in e136aa2.
from tic.
Related Issues (20)
- Mention the `[Custom header]` tag in the vignette
- Drop Appveyor support? HOT 1
- Consider using `gh` for GitHub helpers
- GitLab CI support HOT 3
- `do_pkgdown()`: Deployment won't happen if default branch is not named "master"
- Cleaning up ropenscilabs HOT 7
- Travis-CI On MacOS `brew install ccache` fails HOT 7
- Error message when using GH actions HOT 3
- Fresh install of gfortran in macOS HOT 7
- service name for tic HOT 3
- Workflows broken after rlang v1.0.0 update
- Fix version requirement for rlang? HOT 1
- Test failures HOT 13
- [Failing `step_test_ssh()`]: maybe you could help me debug it ? HOT 4
- Update workflow action versions
- Add explanation how to disable pkgdown deployment
- Function to list available templates
- Pipeline fails with <simpleError: Cannot install packages: .... values must be length 1, but FUN(X[[1]]) result is length 0> HOT 4
- `pkgdown: false` is set but still getting built HOT 1
- error in stage install, "Packaging tic 0.13.0" lazy-load database corrupt ('../R6.rdb') HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tic.