Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of gh-pages fails on new pull-request #957

Open
pjljvandelaar opened this issue Mar 23, 2020 · 13 comments
Open

Update of gh-pages fails on new pull-request #957

pjljvandelaar opened this issue Mar 23, 2020 · 13 comments
Assignees

Comments

@pjljvandelaar
Copy link
Member

See https://semaphoreci.com/torxakis-admin/torxakis/branches/develop/builds/742
The statement
if [ "$BRANCH_NAME" = "develop" ] && [ "$SEMAPHORE_TRIGGER_SOURCE" != "scheduler" ]; then git config --global user.email "semaphore@example.com"; git config --global user.name "SemaphoreCI"; ./ci/cleanup.sh; ./ci/updateAndPushGhPagesFromDevelop.sh; fi
fails with

Switched to branch 'gh-pages'
First, rewinding head to replay your work on top of it...
Applying: Earlier changes were made in the wrong branch
Using index info to reconstruct a base tree...
M	ci/setup.sh
M	sys/server/src/TxsServer.hs
Falling back to patching base and 3-way merge...
Auto-merging sys/server/src/TxsServer.hs
CONFLICT (content): Merge conflict in sys/server/src/TxsServer.hs
Auto-merging ci/setup.sh
error: Failed to merge in the changes.
Patch failed at 0001 Earlier changes were made in the wrong branch
hint: Use 'git am --show-current-patch' to see the failed patch
@pjljvandelaar
Copy link
Member Author

@keremispirli Any ideas that could help?

@pjljvandelaar
Copy link
Member Author

On windows rebase works:

$> git checkout gh-pages
Checking out files: 100% (4206/4206), done.
Switched to a new branch 'gh-pages'
Branch 'gh-pages' set up to track remote branch 'gh-pages' from 'origin'.
$> git rebase develop
First, rewinding head to replay your work on top of it...
Generating patches: 100% (40/40), done.
Applying: Set theme jekyll-theme-slate
Applying: Haddock @ 20170823_102409
Applying: Haddock @ 20170831_094417
Applying: Haddock @ 20170831_101106
Applying: Haddock @ 20170921_112018
Applying: Haddock @ 20170925_070619
Applying: Haddock @ 20170926_084510
Applying: Haddock @ 20171031_155103
Applying: Haddock @ 20171101_091900
Applying: Haddock @ 20171101_092108
Applying: Haddock @ 20180416_200524
Applying: Haddock @ 20180419_092135
Applying: Haddock @ 20180420_093404
Applying: Haddock @ 20180423_100040
Applying: Haddock @ 20180423_161349
Applying: Haddock @ 20180425_074041
Applying: Haddock @ 20180428_155142
Applying: Haddock @ 20180507_111503
Applying: Haddock @ 20180507_153405
Applying: Haddock @ 20180508_150632
Applying: Haddock @ 20180627_121832
Applying: Haddock @ 20180627_123010
Applying: Haddock @ 20180628_170200
Applying: Haddock @ 20180706_112010
Applying: Haddock @ 20180709_145735
Applying: Haddock @ 20180711_112138
Applying: Haddock @ 20180711_171513
Applying: Haddock @ 20180820_103602
Applying: Haddock @ 20180820_150155
Applying: Haddock @ 20190508_150519
Applying: Haddock @ 20190528_144525
Applying: Haddock @ 20190611_141804
Applying: Haddock @ 20190620_155613
Applying: Haddock @ 20190626_080715
Applying: Haddock @ 20190702_055802
Applying: Haddock @ 20190827_132918
Applying: Haddock @ 20190928_103747
Applying: Haddock @ 20190930_143121
Applying: Haddock @ 20191214_164847
Applying: Haddock @ 20200108_162129

Is the issue linux specific? Did I do something wrong to try to reproduce?

@pjljvandelaar
Copy link
Member Author

@pjljvandelaar
Copy link
Member Author

pjljvandelaar commented Mar 23, 2020

Why complain on sys/server/src/TxsServer.hs, since this isn't changed in the pull request of Djurre?
Has this issue been introduced earlier (and ignore then)?
Last change to TxsServer.hs was #926 - A pull request of Djurre....
@ikbendedjurre do you have any clue what might go wrong here?

@pjljvandelaar
Copy link
Member Author

pjljvandelaar commented Mar 24, 2020

In the current solution, gh-pages is a permanent branch to which develop changes are merged.
This merge went wrong, since the actual merge happened outside the TorXakis archive: it happened in Djurre's archive.
The current solution archives all generated documentation.
As a developer, I never had the need to look up old documentation.
And If I had the urge would stack not be able to regenerate exactly the same documentation?

So, I propose to make develop leading and generate a new gh-pages branch when needed.
To see if this method would work, I first do it manual and test that the issue is indeed (temporarily) solved.

Actions done:

My attempt failed: it seems that my changes to gh-pages are later in the archive, so are ignored by the earlier made pull request.
Furthermore, the new gh-pages is equal to develop so a pull request can't be made.

@pjljvandelaar
Copy link
Member Author

To delete a git branch remotely see:
https://www.educative.io/edpresso/how-to-delete-remote-branches-in-git

@pjljvandelaar
Copy link
Member Author

pjljvandelaar commented Mar 24, 2020

@keremispirli Where are the gh-pages actually used?
Am I right it is https://torxakis.github.io?
How can I check I haven't broken anything?
Is there some documentation about the gh-pages I should be aware of?
I found
https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
and
https://pages.github.com/

@pjljvandelaar
Copy link
Member Author

What is in commit 9154a5d Set theme jekyll-theme-slate?
It seems only _config.yml file with content

theme: jekyll-theme-slate

@pjljvandelaar
Copy link
Member Author

pjljvandelaar commented Mar 25, 2020

First attempt fails:

rm: cannot remove ‘./*.zip’: No such file or directory
Deleted branch gh-pages (was 47768908).
Username for 'https://github.com': 

despite

if [ "$BRANCH_NAME" = "develop" ] && [ "$SEMAPHORE_TRIGGER_SOURCE" != "scheduler" ]; then git config --global user.email "semaphore@example.com"; git config --global user.name "SemaphoreCI"; ./ci/cleanup.sh; ./ci/updateAndPushGhPagesFromDevelop.sh; fi

user name seems not to be set ;-(

@pjljvandelaar
Copy link
Member Author

pjljvandelaar commented Mar 25, 2020

Currently, we have a script that is hard to test: it is only executed when develop changes.

A better alternative would be to have a hook that updates gh-pages whenever develop is changed.
See e.g. https://stackoverflow.com/questions/15285324/is-there-a-way-to-use-a-pre-post-commit-hook-in-github-to-update-gh-pages-branch and the references therein
And https://stackoverflow.com/questions/24713112/why-does-my-github-page-do-not-update-its-content

Maybe also look at similar concepts in other languages like java and javaDoc: https://stackoverflow.com/questions/11938270/how-i-can-move-javadoc-from-master-branch-to-gh-pages-branch-on-github-using-egi
and
https://stackoverflow.com/questions/41467429/auto-upload-generated-documentation-on-github

@pjljvandelaar
Copy link
Member Author

pjljvandelaar commented Mar 25, 2020

See how cabal handle haddock on travis-ci:
For pointers see haskell/cabal#3543

Similar on travis-ci: https://chromabits.com/posts/2016/07/04/haddock-travis/

@pjljvandelaar
Copy link
Member Author

@pjljvandelaar
Copy link
Member Author

For better traceability, I propose to use 'set -v' in our scripts. See e.g. https://stackoverflow.com/questions/2853803/how-to-echo-shell-commands-as-they-are-executed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants