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

Liberate annotation projects #5286

Merged
merged 14 commits into from
Jan 27, 2020
Merged

Conversation

jisantuc
Copy link
Contributor

@jisantuc jisantuc commented Jan 21, 2020

Overview

For too long annotation projects have toiled under the heel of a datamodel we built for an entirely different purpose. No longer! Today, annotation projects raise their voices in unison and demand new tables and equal footing with their platform project brethren! etc. It's late and I'm not committed to this joke.

Anyway, this PR adds a batch job that creates annotation projects from existing projects that are marked as annotation projects.

Checklist

  • Description of PR is in an appropriate section of the changelog and grouped with similar changes if possible
  • Any new SQL strings have tests (these testing instructions -- everything's a private method so no one gets the wrong idea)

Notes

Why a batch job instead of a migration? Three reasons. Reason 1: I'm going to break staging for annotate to some extent when I move tasks to annotation projects. However, when we create new projects in staging, they'll still become old projects until the switchover is complete in the annotation UI. That means we'll probably have to run the job more than once. Reason 2 is that I looked at rerunnable java migrations and spent 10 minutes trying to get Flyway to know where java migrations were when I wrote them in Scala, and I failed in that 10 minutes, and it didn't seem worth it when I already had another nice rerunnable concept lying around. Reason three is because I was thinking about the sql I'd need to write and started to feel really not pumped about its complexity + the possibility I'd need to do error handling and recovery.

Testing Instructions

For code review, functions are pretty tightly scoped. For a sense of the overall flow, check out liberateProject, which is just a for comprehension that combines other actions. Then you can navigate the flow from there.

For functionality:

  • batch/assembly, wait until it's done...
  • then ./scripts/console batch 'java -cp /opt/raster-foundry/jars/batch-assembly.jar com.rasterfoundry.batch.Main liberate-annotation-projects http://localhost:8081'
  • then for a more reproducible test where I'm not gambling that your database state is compatible with assumptions here (though it's pretty flexible!):
    • ./scripts/load_development_data
    • ./scripts/psql -> update projects set tags = '{ "annotate" }' where id = 'df697018-68ea-4b4e-81b3-50481a4bf15f';
    • ./scripts/console batch 'java -cp /opt/raster-foundry/jars/batch-assembly.jar com.rasterfoundry.batch.Main liberate-annotation-projects http://localhost:8081'

Closes #5281

@jisantuc jisantuc force-pushed the feature/js/liberate-annotation-projects branch from 155612a to 2b79edd Compare January 23, 2020 22:52
@jisantuc jisantuc changed the title [wip] Liberate annotation projects Liberate annotation projects Jan 23, 2020
@jisantuc jisantuc merged commit 5238e3f into develop Jan 27, 2020
@jisantuc jisantuc deleted the feature/js/liberate-annotation-projects branch January 27, 2020 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add migration to extract all relevant information from projects.extras
2 participants