-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Refactor several poorly named fields on Version
#856
Conversation
OK, I think I’m not going to change |
I did this using jq: $ cat db/seed_import.json | jq -c '. + {body_hash: .version_hash, body_url: .uri} | del(.version_hash) | del(.uri)' > db/seed_import.new.json $ mv db/seed_import.new.json db/seed_import.json
Migrated the seed file with the following quick
(No need to update |
Downstream update PRs:
Not going to worry about -versionista-scraper and -changed-terms-analysis since they are no longer in active use. |
OK, this should be good to go pending updates to downstream consumers. Going to let this bake for a while and come back with fresh eyes and and a careful review tomorrow or later in the week. |
Renames done in pairs like this that effectively change the meaning of term can create hard-to-find bugs:
Are we sure we like |
Ha! These are actually the ones I feel most confident about, even though you are right that they are the most technically risky. I feel confident about these for two reasons:
|
Those justifications are convincing. I had actually missed the |
Going to merge this in an hour or so after weekly sheets are done building. |
Deployed to staging and and ran the data migration there. Took 79 minutes, but otherwise worked great. Deploying to production now. :) |
Now that edgi-govdata-archiving/web-monitoring-db#856 is merged and fully migrated, we no longer need backwards compatibility with the old schema.
This is a first pass at the remaining items in #776. The
Version
model is pretty central to the whole system, so this is kind of a big and very tedious change. :\This makes the following changes to
Version
:capture_url
→url
uri
→body_url
version_hash
→body_hash
Maybe renamecontent_length
→body_length
headers
(a.k.a. movesource_metadata.headers
→headers
)Note that the
content_length
change hasn’t yet been implemented here. I’m a little on the fence. The current name is clear, and references a well known HTTP header. The proposed new name (body_length
) is still clear and is more concise, but departs from well-known convention.Remaining work to do here:
headers
from existingsource_metadata.headers
datacontent_length
→body_length
Fixes #776.