-
Notifications
You must be signed in to change notification settings - Fork 154
Resolve all jr:// URIs to media directory #879
Conversation
This comment has been minimized.
This comment has been minimized.
c5c11dd
to
52c586d
Compare
I don't understand why the test fails on CI. It passes locally. CI says
That is indeed the path structure I would expect. |
52c586d
to
cb03b74
Compare
I SSHed into the build and saw @ggalmazor I'd love it if you could take a quick peek when you have a moment. Hopefully this one will be very quick. |
cb03b74
to
5f284ac
Compare
|
Hi, @lognaturel! I'd need to wait until the weekend to take a look. Does that work for you? |
That works, @ggalmazor! |
Needed to build a FormDef for files with external secondary instances.
5f284ac
to
2845985
Compare
Tested with success!
|
Verified on Mac. The main issue is no longer visible. @getodk-bot unlabel "needs testing" |
That seems good and expected to me! Are you thinking about the issue you identified in #872 (comment)? That only applies to XML files that are attached to instances, not to form definitions. |
Needed to build a FormDef for files with external secondary instances.
Closes #878
What has been done to verify that this works as intended?
Wrote a test that fails with the user-reported error on master. Tried downloading a real form with external secondary instances and then exporting it. @getodk/testers I think it would be good to try with some of the other ones that you have with both xml and csv external instances and a few submissions.
Why is this the best possible solution? Were any other approaches considered?
The core of the solution is setting up a
ReferenceFactory
for the singletonReferenceManager
. I don't see any alternatives to that. The decision points I saw were around where to actually build the media directory paths and how much of theReferenceFactory
to implement. It felt reasonable to makegetMediaDirectory
public andJavaRosaWrapper
andBriefcaseFormDefinition
call it.For the
ReferenceFactory
, I only implementedgetLocalURI
because I believe that's all we need. The other methods throwUnsupportedOperationException
so we should be able to tell easily if I was wrong. I had all media of every type resolve to the same directory and don't do any check on thejr://
prefix provided because I consider that a form design concern.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
I changed the implementation of
getMediaDirectory
to not create the directory if it didn't exist but just get the path. The only risk I could think of associated with that was when media attachments are present so I verified that. I could have missed something. Other than that the changes are additive so low-risk.Does this change require updates to documentation? If so, please file an issue at https://github.com/getodk/docs/issues/new and include the link below.
No.