sitediff
sitediff copied to clipboard
Seems to use 'after' site for both before and after
Ubuntu 18.04, sitediff installed via Docker.
1.0.0
Unless I'm doing something wrong, sitediff seems to use the "after" site twice instead of both the "before" and "after" sites.
With the exception of CSRF tokens, the rest of the markup is reported as being the same, but the two sites differ in some other respects. For example:
before:
<input type="hidden" name="action" value="guestEntries/saveEntry">
after:
<input type="hidden" name="action" value="guest-entries/save">
But sitediff shows both before and after with the after site's input.
$ sudo docker run -p 13080:13080 -t -d --name sitediff evolvingweb/sitediff:1.0.0
$ sudo docker exec -it sitediff /bin/bash
root@7004949d432e:/sitediff# bundle install
root@7004949d432e:/sitediff# bundle exec thor fixture:serve
root@7004949d432e:/sitediff# sitediff init https://[site1].com/ https://[site2].co.uk/
[success] Created /sitediff/sitediff/sitediff.yaml
Reading config file: /sitediff/sitediff/sitediff.yaml
Visited <snip>
106 page(s) found.
[done] Created /sitediff/sitediff/paths.txt.
[success] You can now run "sitediff diff".
root@7004949d432e:/sitediff# sitediff diff
Reading config file: /sitediff/sitediff/sitediff.yaml
Read 106 paths from: /sitediff/sitediff/paths.txt
Using sites from cache: before
<snip>
All diff files written to /sitediff/sitediff/diffs
All failures written to /sitediff/sitediff/failures.txt
Report generated to /sitediff/sitediff/report.html
Run "sitediff serve" to see a report.
root@7004949d432e:/sitediff# sitediff serve
Reading config file: /sitediff/sitediff/sitediff.yaml
{"before"=>"https://site1.com/", "after"=>"https://site2.co.uk/", "cached"=>["before", "after"]}
Serving at http://localhost:13080
[2020-09-18 15:48:43] INFO WEBrick 1.6.0
[2020-09-18 15:48:43] INFO ruby 2.7.1 (2020-03-31) [x86_64-linux]
[2020-09-18 15:48:43] INFO WEBrick::HTTPServer#start: pid=176 port=13080
latest
I then tried with "latest" via Docker and found the same thing. Additionally, after adding dom_transform
:
---
before:
url: https://site1.com/
dom_transform:
- type: remove
- selector: input[name=CRAFT_CSRF_TOKEN]
after:
url: https://site2.co.uk/
dom_transform:
- type: remove
- selector: input[name=CSRF_TOKEN]
and running sitediff diff
I get:
Reading config file: /sitediff/sitediff/sitediff.yaml
Read 38 paths from: /sitediff/sitediff/paths.txt
Using sites from cache: before
Traceback (most recent call last):
10: from /usr/local/bundle/bin/sitediff:23:in `<main>'
9: from /usr/local/bundle/bin/sitediff:23:in `load'
8: from /usr/local/bundle/gems/sitediff-1.0.0/bin/sitediff:12:in `<top (required)>'
7: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
6: from /usr/local/bundle/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
5: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
4: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
3: from /usr/local/bundle/gems/sitediff-1.0.0/lib/sitediff/cli.rb:158:in `diff'
2: from /usr/local/bundle/gems/sitediff-1.0.0/lib/sitediff.rb:186:in `run'
1: from /usr/local/bundle/gems/sitediff-1.0.0/lib/sitediff.rb:186:in `map'
/usr/local/bundle/gems/sitediff-1.0.0/lib/sitediff.rb:186:in `block in run': undefined method `success?' for nil:NilClass (NoMethodError)
This is an issue that we're fixing in version 1.2.0.
This issue has been fixed in the latest 1.2 version. Version 1.2.3 fixes the error seen here.