-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Move author identifiers to version-controlled YAML file #9769
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @fakegithub01! Will QA this branch after the requested changes have been made.
Co-authored-by: jimchamp <28732543+jimchamp@users.noreply.github.com>
Co-authored-by: jimchamp <28732543+jimchamp@users.noreply.github.com>
Co-authored-by: jimchamp <28732543+jimchamp@users.noreply.github.com>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn’t actually rename the author.yml
file as you changed the open()
call.
This is taking the same steps applied to editions[1] and authors[2] and applying it to works. `get_work_config()` is currently not used for anything, probably because we’re still waiting for an actual interface to edit the Work identifiers[3], so this is more a preliminary step to ensure that Works will be handled in the same way that Editions and Authors are. (And to allow for PRs to add Work identifiers while waiting for that UI.) [1] internetarchive#9234 internetarchive#9483 [2] internetarchive#9666 internetarchive#9769 [3] internetarchive#3430
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me. I have left a couple of comments about related documentation that is slightly off now, but I don’t know if Jim will want that changed or not. I just wanted to note the filename so once Jim is available to review this, he wouldn’t have to point that out, so you could get this PR done with sooner. :)
identifiers = [Storage(t.dict()) for t in thing.identifiers if 'name' in t] | ||
else: | ||
identifiers = {} | ||
# Load the author config from the author.yml file in the author directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We’re only loading identifiers
of the author config here… but that’s also currently the entirety of the config. I don’t know if that’s something that needs changing or not.
@@ -1222,13 +1222,16 @@ def _get_author_config(): | |||
|
|||
The results are cached on the first invocation. | |||
Any changes to /config/author page require restarting the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The /config/author
page isn’t getting loaded anymore, so restarting won’t do much… :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @fakegithub01!
I've tested this locally by adding a new author identifier entry. Verified that the new ID is present in the identifiers drop-down in the author edit screen. Newly added IDs were also present on the author view page.
Will open a follow-up PR that updates the documentation for these functions, and the equivalent edition identifier configuration functions, which, I suspect, were not updated.
This is taking the same steps applied to editions[1] and authors[2] and applying it to works. `get_work_config()` is currently not used for anything, probably because we’re still waiting for an actual interface to edit the Work identifiers[3], so this is more a preliminary step to ensure that Works will be handled in the same way that Editions and Authors are. (And to allow for PRs to add Work identifiers while waiting for that UI.) [1] internetarchive#9234 internetarchive#9483 [2] internetarchive#9666 internetarchive#9769 [3] internetarchive#3430
Closes #9666
Refactor
Technical
openlibrary/plugins/openlibrary/config/author/author.yml
._get_author_config()
function to load author identifiers from the newauthor.yml
file.Testing
author.yml
.Stakeholders
@jimchamp @mekarpeles