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

sundry fixes and improvements #8

Merged
merged 16 commits into from
Aug 6, 2019
Merged

sundry fixes and improvements #8

merged 16 commits into from
Aug 6, 2019

Conversation

jmartin-sul
Copy link
Collaborator

@jmartin-sul jmartin-sul commented Aug 2, 2019

connects to #1
closes LD4P/sinopia_editor#797

…rn an array of promises resulting from saveResourceTextFromServer calls (instead of undefined) (fix issue #3)
* add test scripts to package.json
* make getGroupRDF.js more testable by lazily instantiating the sinopia server client, to make mocking it easier
* add a test for the basic success case of getResourceTextFromServer, using a mock instance of the sinopia server client to avoid the need for network interactions
pull up some mockSinopiaClient setup code that can be shared from a prior test, and import fs functions
@jmartin-sul jmartin-sul marked this pull request as ready for review August 6, 2019 00:50
Copy link
Contributor

@ndushay ndushay left a comment

Choose a reason for hiding this comment

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

pls add copyright/license statement at top of each file ...

Copy link
Contributor

@ndushay ndushay left a comment

Choose a reason for hiding this comment

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

LGTM, modulo missing copyright/license statement

@@ -0,0 +1,61 @@
# Copyright 2019 Stanford University see LICENSE file
# CircleCI 2.0 configuration file
Copy link
Contributor

Choose a reason for hiding this comment

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

i think line 2 is sorta obvious, but 🤷

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was actually copypasta from the sinopia_acl circle config that i ripped off, but happy to remove if it irks you.

@jmartin-sul
Copy link
Collaborator Author

jmartin-sul commented Aug 6, 2019

@ndushay said:

pls add copyright/license statement at top of each file

good catch, added to __tests__/getGroupRDF.test.js.

not sure if that was the only one you intended that comment to apply to, but just in case: i didn't add to .babelrc, because it appears to be json, and when i last checked, there was no way to do comments in json. ditto the actual .json extension files. i was going to say i passed on adding it to the bash script because my understanding is that the #!/usr/bin/env bash comment has to come first (and because the sinopia_acl script i ripped off didn't have it 😆). but i could just as easily put it as the second line, or the last line? should we do that in the sinopia_acl bin scripts too?

Copy link
Contributor

@justinlittman justinlittman left a comment

Choose a reason for hiding this comment

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

Approve pending consideration of comment.

if(!clientInstance) {
clientInstance = new SinopiaServer.LDPApi()
clientInstance.apiClient.basePath = config.get('trellis.basePath')
console.debug(`Sinopia Server client lazily instantiated. base URL: ${clientInstance.apiClient.basePath}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Cruft?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm... despite it being debug, that was intentional, just so the user would see clearly what server they're hitting (since it's otherwise buried in a config file).

but happy to remove if that's overkill. i had a bit more logging of that sort that i removed because i ended up feeling like it was unnecessary noise.

@ndushay
Copy link
Contributor

ndushay commented Aug 6, 2019

copyright all good now. - N

@jmartin-sul
Copy link
Collaborator Author

merging because of the two approvals, but happy to reconsider the log statement that @justinlittman pointed out (can remove in a follow on PR if need be).

@jmartin-sul jmartin-sul merged commit f43bf10 into master Aug 6, 2019
@jmartin-sul jmartin-sul deleted the lots-o-fixes branch August 6, 2019 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants