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

Get Sony Ci ID from GUID via UI #604

Merged
merged 2 commits into from
Aug 26, 2021
Merged

Get Sony Ci ID from GUID via UI #604

merged 2 commits into from
Aug 26, 2021

Conversation

afred
Copy link
Contributor

@afred afred commented Aug 13, 2021

  • Updates sony_ci_api gem to use sony_ci_api_rewrite in github, branch v0.1.
    • Had to create a branch that was compatible with Faraday v0.17.x, b/c Hyrax dependencies
      would not allow Faraday v1.3.
  • Customizes Sony Ci ID input to include filename fetched from Sony Ci.
  • Customizes Sony Ci ID input partial to include button that will populate Sony Ci ID
    entries from Sony Ci, where the filename matches a translated form of the Asset ID.
  • Replaces old instances of SonyCiBasic with SonyCiApi::Client.
  • Adds a SonyCi::APIController to wrap very specific requests to Sony Ci API using the
    new gem. Endpoints include:
    • /sony_ci/api/find_media&query={QUERY}&fields={FIELDS}
      This will search the API for records matching {QUERY} and return JSON objects having properties
      specified by the comma-separated field list {FIELDS}
    • /sony_ci/api/get_filename&sony_ci_id={SONY_CI_ID}
      This will find the Sony Ci record and return a JSON object containing fields 'sony_ci_id' and 'name'.

NOTE: this PR hinges on the new version of the sony_ci_api gem, which is currently being pulled from Github, branch v0.1. Reviewing the state of this branch should accompany this review: https://github.com/WGBH-MLA/sony_ci_api_rewrite/tree/v0.1

Closes #585.

@afred
Copy link
Contributor Author

afred commented Aug 13, 2021

Here's the screenshot of the passing specs from my local machine until we get CI up again.
image

@afred afred force-pushed the 585-sony-ci-id-from-asset branch 10 times, most recently from a777ec6 to d2bce49 Compare August 17, 2021 09:11
* Updates sony_ci_api gem to use sony_ci_api_rewrite in github, branch v0.1.
	* Had to create a branch that was compatible with Faraday v0.17.x, b/c Hyrax dependencies
	  would not allow Faraday v1.3.
* Customizes Sony Ci ID input to include filename fetched from Sony Ci.
* Customizes Sony Ci ID input partial to include button that will populate Sony Ci ID
  entries from Sony Ci, where the filename matches a translated form of the Asset ID.
* Replaces old instances of SonyCiBasic with SonyCiApi::Client.
* Adds a SonyCi::APIController to wrap very specific requests to Sony Ci API using the
  new gem. Endpoints include:
  * /sony_ci/api/find_media&query={QUERY}&fields={FIELDS}
  	This will search the API for records matching {QUERY} and return JSON objects having properties
	specified by the comma-separated field list {FIELDS}
  * /sony_ci/api/get_filename&sony_ci_id={SONY_CI_ID}
    This will find the Sony Ci record and return a JSON object containing fields 'sony_ci_id' and 'name'.
* Handles SonyCiApi gem errors.

Closes #585.
…ting the PR.

* Updates Sony Ci gem with updated error handling.
* refactors error specs a bit to better guarantee we are ALWAYS returning JSON.
* Removes unused error class
* Tests error responses for controller action sony_ci/api/find_media
* Defines all routes under /sony_ci/* in the same place in routes.rb.
* Sets default format to JSON for routes under /sony_ci/api/*.
app/controllers/sony_ci/api_controller.rb Outdated Show resolved Hide resolved
app/controllers/sony_ci/api_controller.rb Show resolved Hide resolved
app/controllers/sony_ci/api_controller.rb Outdated Show resolved Hide resolved
config/routes.rb Show resolved Hide resolved
spec/controllers/sony_ci/api_controller_spec.rb Outdated Show resolved Hide resolved
@afred
Copy link
Contributor Author

afred commented Aug 25, 2021

@jasoncorum @foglabs this is ready for re-review. All conversations have been resolved.

@afred
Copy link
Contributor Author

afred commented Aug 25, 2021

Here's the latest specs passing

Finished in 23 minutes 53 seconds (files took 18.15 seconds to load)
548 examples, 0 failures, 23 pending

Randomized with seed 19090

andrew_myers@ml-20017580:~/Projects/WGBH/ams/code/ams
;^) git br
...
* 585-sony-ci-id-from-asset
...
andrew_myers@ml-20017580:~/Projects/WGBH/ams/code/ams
;^) date
Wed Aug 25 16:50:12 EDT 2021
andrew_myers@ml-20017580:~/Projects/WGBH/ams/code/ams
;^) 

Copy link
Contributor

@jasoncorum jasoncorum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@afred afred merged commit cee3cee into develop Aug 26, 2021
@afred afred deleted the 585-sony-ci-id-from-asset branch August 26, 2021 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add capability to get Sony Ci ID from GUID
2 participants