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

Do not deploy github pages if there were no changes #703

Open
jsquyres opened this issue Aug 25, 2018 · 8 comments
Open

Do not deploy github pages if there were no changes #703

jsquyres opened this issue Aug 25, 2018 · 8 comments

Comments

@jsquyres
Copy link
Member

(I asked this in mtt-devel but got no reply, so I figured I'd ask here)

It looks like every time there is a PR merged, there's a new gh-pages deployment. This is generally fine, except that sometimes the deployments are not as a result of any actual documentation changes, but just changes in the timestamps of the documentation. I.e., no doc changes occurred, but the doc generator ran, it updated the timestamps, and therefore those timestamp changes were recorded as a git diff, which then resulted in another gh-pages deployment.

Can such spurious commits / deployments be avoided?

@rhc54
Copy link
Contributor

rhc54 commented Aug 25, 2018

If you can figure it out, please go ahead and make the change. I have no idea how to get Travis to do it. Akshaya's internship is over and she has departed for the school year. I'm not sure if someone else can chase it down.

@jsquyres
Copy link
Member Author

FWIW, I don't think it's a matter of not invoking Travis -- I think it's fine to invoke Travis every time. What would be nice is if Travis runs the generator, do the git commit, and then perhaps take a cursory examination of the git diff and see "oh, this just has timestamp updates" and therefore decide not to git push.

I don't know if I have the cycles, either.

@beardeddog
Copy link
Contributor

I found this https://stackoverflow.com/questions/48455623/skip-travis-build-if-an-unimportant-file-changed, maybe it close to what you want to do?

@rhc54
Copy link
Contributor

rhc54 commented Aug 26, 2018

I guess it begs this question:

Git only sees the content of the file to determine if it is changed. It is not concerned with the timestamp if the content is the same. Make sure there really isn't any change in the content, including line endings.

So it sounds like the doc generator runs, but there isn't any change? If all that changes is the timestamp, then there shouldn't have been a diff, yes?

I guess I'm confused as to how just timestamp updates resulted in a diff being committed at all.

@jsquyres
Copy link
Member Author

Sorry, I should be more clear -- the timestamps I'm referring to are text items in the file. Not the actual filesystem timestamp. For example, here's a recent diff -- 09098d0.

diff --git a/latex/refman.tex b/latex/refman.tex
index 8d05a7b..e903547 100644
--- a/latex/refman.tex
+++ b/latex/refman.tex
@@ -67,8 +67,8 @@
\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}}
\fancyfoot[LE]{\fancyplain{}{}}
\fancyfoot[CE]{\fancyplain{}{}}
-\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Aug 24 2018 18\-:46\-:00 for pymtt by Doxygen }}
-\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Aug 24 2018 18\-:46\-:00 for pymtt by Doxygen }}
+\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Aug 24 2018 18\-:46\-:09 for pymtt by Doxygen }}
+\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Aug 24 2018 18\-:46\-:09 for pymtt by Doxygen }}
\fancyfoot[CO]{\fancyplain{}{}}
\fancyfoot[RO]{\fancyplain{}{}}
\renewcommand{\footrulewidth}{0.4pt}
@@ -120,7 +120,7 @@
\vspace*{1cm}
{\large Generated by Doxygen 1.8.6}\\
\vspace*{0.5cm}
-{\small Fri Aug 24 2018 18:46:00}\\
+{\small Fri Aug 24 2018 18:46:09}\\
\end{center}
\end{titlepage}
\clearemptydoublepage

@rhc54
Copy link
Contributor

rhc54 commented Aug 27, 2018

Hmmm - I wonder why that information even needs to be committed? Maybe the problem would go away if we removed that file (or at least the timestamps in it) from the repo?

@jsquyres
Copy link
Member Author

I think those timestamps are just part of the files that Doxygen generates.

I think it's ok to generate those timestamps -- it shows that the files are current, after all. It would just be nice if we can somehow determine that the timestamps are the only thing in the diff, and therefore it's not worth pushing.

@ribab
Copy link
Contributor

ribab commented Aug 27, 2018

I think the solution to this is:

Only run gh-pages travisci IF something in mtt/docs changes

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

No branches or pull requests

4 participants