-
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
iNat Import #2150
iNat Import #2150
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
- Gets multiple obss per request. For each request, gets pages; for each page gets obss - Gets commoa separated list of obss - Updates search obss mocks and InatObsTest accordingly
- Fixes controller test failuers
- Fixes error in prior commit
- Removes restriction in controller - Removes now-unneeded tests, translation string
- Includes test which exposed the typo
- Deletes obsolete `import_one_observation` method that made 1 iNatAPI request per observation
- Prevents MO user from importing other people's iNat obss (Currently doesn't completely prevent it; there's a workaround. But it can be prevented after authentication is functional.)
- Add checkbox to form - Add appropriate translation strings - Require user to (a) check import all, and/or (b) provide a list of obss
- Assert specific flash text (vs just any old warning) - Includes username in params - Removes unnecessary code. (If there's no consent, it never calls the iNat API.) - Trvial refacor of `create`
- Prominently display refresh button if job is incomplete - Alway display Your Observations button if job is done (including when there are errors).
@mo-nathan Here's what I did to the tracker page. I don't have strong feelings about this, so am happy to make any other changes you'd like. Some options:
|
- PUT instead of PATCH but also - `ignore_photos: 1` See https://www.inaturalist.org/pages/api+reference#put-observations-id https://forum.inaturalist.org/t/api-modify-observation-description/55665
- Update it if the job is successful enough to believe that inat_username likely belongs to the current MO user.
- Prevents user from importing someone else's iNat observation - Prevents user from "stealing" someone else's iNat username - Prevents user from accidentally changing his own`User.inat_username`
- Fixes finding mismatch - Displays plain-language message if a mismatch - Prevent stub persistence in `inat_import_job_test`
- Fixes bugs in test and un-Skips it. - Adds comment explaining setup and teardown
Seems unnecessary. Also hoping it fixes the stub-related CI failures.
Saving and auto-filling the iNat username is implemented as of Commiit #276338c |
Hoping this time it fixes CI failures. Also conforms stub url to other calls to iNat API
- Implements @mo-nathan's suggestion at #2150 (comment)
- Extracts method
- Adds 1 sec delay between 2 iNat API requests that are very close to each other in order to comply with iNat Policy. https://www.inaturalist.org/pages/developers#terms-of-use
- Tries to fix Codeclimate Line length offense
- Replaces a string with many interpolated values with iterating over a hash.
- Generates methods by iterating over an array, instead of many longhand defintions. - Responds to #2150 (comment)
- Fixes InatImportsController#create ABC offense See #2150 (comment)
PR aims to implement the minimum acceptable functionality for NEMF for importing iNat observations
Note
Questions for reviewers
Manual Test Protocol
Result: redirects to Observation Index (to be change to Inat Import Job Tracker)
Expected result: Index includes a new Observation
Expected result:
Description includes imported to MO and date of the import;
Observation Fields include Mushroom Observer URL linking to the newly created Local observation.
(In the production environment, it links to the live db.)