-
Notifications
You must be signed in to change notification settings - Fork 500
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
:ExcludeEmailFromExport setting no longer has an effect #5185
Comments
@pameyer thanks for opening this issue. I tweaked the title a bit and I'll paste a screenshot of http://guides.dataverse.org/en/4.9.4/installation/config.html#excludeemailfromexport to explain what the :ExcludeEmailFromExport setting does: Based on the timing I suspect pull request #5047 may have introduced this regression from a quick look at the code, I can't tell. I can definitely reproduce the regression on my laptop. Here's how it looks in Netbeans: |
@qqmyers @pameyer and I talked this out at http://irclog.iq.harvard.edu/dataverse/2018-10-15#i_76022 and I just made pull request #5191 to get :ExcludeEmailFromExport working again. Or at least for the specific test that was failing to pass. |
@pdurbin thanks - looks good to me (Tests run: 76, Failures: 0, Errors: 0, Skipped: 1). Still not sure where the skip is coming from, but that's a different problem. |
It seems a little strange to have a static reference to an EJB. (but it also looks as if that was there before and you are just setting it*). Not necessarily for this issue, but as tech debt cleanup, I wonder if Json Printer should be a service bean as well (and then could just inject the setting service). (*) one issue is for example changes like this were a change could break things, if the service bean is not set; the other thing I'm not sure if is that ejbs are supposed to be part of a pool and reused. This one bean would effectively reduce the size of the pook by one? |
@qqmyers would you mind opining on my comment above and if you have any bandwidth to work on this tech debt now? |
@scolapasta - I don't know. The entire class is a bunch of static methods, one of which needs the exclude email setting, which it then sends as a parameter to DatasetFieldWalker (could this be an EJB instead?). Based on that, it seems a bit odd to me to have JsonPrinter be an EJB, but DatasetFieldWalker is mostly static as well and the other options above in our discussion aren't perfect either. A simple improvement might be to just store the exclude email boolean value rather than the whole settingsService. However, I see that api calls like "{id}/versions/{versionNumber}/metadata/{block}" and any call to JsonPrinter.json(DatasetVersion) use the same code but currently doesn't appear to set the settingsService, so their return values will change depending on whether its called before or after a ddi export has been made. Given that, perhaps making DatasetFieldWalker and EJB or setting a static exclude email boolean in it at start-up might be best. (I think we could just propagate the excludeemail value as a (an optional?) method param through the JsonPrinter methods. That affects about 3 methods in JsonPrinter and gets rid of all state, but if its a required parameter, there's the web of calling methods that would need to look up that setting (unless those api and internal calls should include emails... and can just send false...) Guess this is why things get left alone :-) (FWIW, this sounds most similar to how the Workflow system worked/works - originally the doiProvider setting was passed into the workflow context rather than bringing the workflow steps into the EJB context and I just made that mechanism configurable so steps can define what settings they need.) |
In theory, we'd want the settings to be changeable without having to restart (that is one differences between settings and jvm options and why we generally use jvm options more for "configuration" options instead of "customization" options). Changing to an ejb would mean changing all the static methods to non static, so that does seem like overkill for this fix / cleanup (since the static reference to the ejb existed before), but still seems to me the right approach. The other "right" way would be to do as you say and pass the parameter along, but I fear that would be messy and not scalable, if/when other settings are needed (like what you ran into with workflows. (for example, when we do convert this to ejb, you would have to go back and remove all these methods and calls, since then the Json printer could just call the SettingsService directly. So I guess we can live with this current approach until someone has the time / need to convert this to an EJB. |
@qqmyers This fails to build with complier errors: [ERROR] COMPILATION ERROR : |
@kcondon - OK, try that. I updated the tests and will try to at least compile the test classes locally to not waste your time (trying to run the tests gives me lots of errors locally so I don't yet have a good way to test unless I merge changes into the build from QDR which runs at least some tests as part of an auto-build). |
@kcondon @qqmyers you (and everyone) can all observe if unit tests are passing or failing at https://travis-ci.org/IQSS/dataverse/pull_requests @scolapasta or I should have caught this earlier. Sorry. |
@qqmyers This works for 2 of the 3 formats that export contact email: ddi, and json, but fails for OAI_ORE. |
@kcondon - the OAI-ORE export doesn't use JsonPrinter for this. I can fix that so OAI-ORE supports the setting, but it's nominally a separate problem. Do you want it in this pull or a separate one? |
@qqmyers If it is simple enough just add here, thanks. |
@kcondon - ready to go. |
in docker-aio:
which would appear to break #3443.
Not fully clear on where the 1 skip is coming from, but that's a problem for another day.
IQSS jenkins appears to be showing same behavior https://build.hmdc.harvard.edu:8443/job/phoenix.dataverse.org-apitest-develop/.
The text was updated successfully, but these errors were encountered: