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

Already on GitHub? Sign in to your account

QA: Simplify Comparison Between Local And Remote Site Files #776

Merged
merged 1 commit into from Feb 27, 2015

Conversation

Projects
None yet
2 participants
Contributor

harding commented Feb 26, 2015

This commit adds an extra step to the build process to SHA256 checksum all the files that are built purely based on repository contents. The checksums file is uploaded to the webserver with the rest of the site content.

A separate target is added to the Makefile to compare the remote sha256sums file to a locally-built file to see if they differ. This allows us to detect when a remote build may have gone astray. (This is for QA only, not security.)

I will be adding this step to my usual merge workflow:

  1. Merge pull request(s) at the command line.
  2. git diff HEAD^ to review the patchset
  3. git commit -a -S --amend to sign the merge
  4. make all to build the site locally and run the automated tests
  5. (Optional) manually preview significantly changed pages using my localhost webserver and browser
  6. git push upstream master to push the merged commits
  7. Wait a few minutes for the revised site to build and be uploaded. Then run make manual-checks to run this new check to see if the actual Bitcoin.org site matches what I built locally.

Some background info on my desire for this change can be found in issue #773

QA: Simplify Comparison Between Local And Remote Site Files
This commit adds an extra step to the build process to SHA256 checksum
all the files that are built purely based on repository contents.  The
checksums file is uploaded to the webserver with the rest of the site
content.

A separate target is added to the Makefile to compare the remote
sha256sums file to a locally-built file to see if they differ.  This
allows us to detect when a remote build may have gone astray.
Contributor

saivann commented Feb 26, 2015

@harding Half untested LGTM, you made it more simple than I thought!

Contributor

harding commented Feb 26, 2015

@saivann thanks!

I'll merge this we the next other thing that I merge, and then confirm that it works once the site gets updated.

@harding harding merged commit 584e191 into bitcoin-dot-org:master Feb 27, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

harding added a commit that referenced this pull request Feb 27, 2015

Merge pulls #774 and #776
* #774: SVG optimisation; the return
* #776: QA: Simplify Comparison Between Local And Remote Site Files
Contributor

harding commented Feb 27, 2015

Just a quick follow-up that this commit does not work as expected because the site build does not use the same version of the less (CSS) compiler/compressor we have in our Gemfile, so the main CSS file is slightly different than what I compile locally. For example:

-h1{font-size:2em;margin:0.67em 0}
+h1{font-size:2em;margin:.67em 0}

That wouldn't be a problem, except that we use the MD5 hash of the CSS file as its filename to ensure that browsers download the most recent CSS file---so a slightly different CSS filename means every HTML file on the site now has a different hash.

Once we get the site build script added to the repository, I'll work on making it use the same build process we describe in the README.md and that we use on Travis.

Contributor

saivann commented Feb 27, 2015

@harding Ah.. Well actually I kept using the ubuntu packages for the build machine (are the gems used by bundle secure, properly signed and verified?). If you feel comfortable with it, please feel free to update and test the build machine configuration, and updated the update_site.sh script once it's merged.

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