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

unpack schema sample data into folders, produce mef files at build time #7457

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

jodygarnett
Copy link
Contributor

@jodygarnett jodygarnett commented Oct 26, 2023

Following example of HNAP plugin metadata101/iso19139.ca.HNAP#350 I had offered to do the same change for core-geonetwork.

  • plugin sample data folders are unzipped, so we can manage changes in pull-requests
  • pom.xml packages up sample data into target/sample-data mef files.
  • assembly modified to exclude sample-data folders contents, and include generated mef files

The iso19115-3.2018 sample data for service record was ... odd:

  • was included in the plugin as a zip file, not a mef file.
  • contents of zip had similar files as the mef format, but arranged in a different folder structure
unzip -l 0dbac056-cd5a-4c9c-bbec-564e47c4507c.zip   
0beee14d-aa34-46ba-9f43-de5cf2308b53/
0beee14d-aa34-46ba-9f43-de5cf2308b53/metadata/
0beee14d-aa34-46ba-9f43-de5cf2308b53/public/
0beee14d-aa34-46ba-9f43-de5cf2308b53/private/
info.xml
metadata.xml

This build change is prepared to update sample data for #7363

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests)
  • User documentation provided for new features or enhancements in mannual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

@jodygarnett
Copy link
Contributor Author

@ianwallen you expressed interest in this activity

@jodygarnett
Copy link
Contributor Author

Testing these sample records, appear to work as before - however the records content themselves are outdated.

@jodygarnett
Copy link
Contributor Author

@ianwallen do not have sufficient permissions to request your review. If anyone else is interested this is a straightforward change to test locally.

@josegar74 josegar74 added this to the 4.4.1 milestone Nov 1, 2023
@fxprunayre fxprunayre modified the milestones: 4.4.1, 4.4.2 Nov 22, 2023
@jodygarnett
Copy link
Contributor Author

@fxprunayre can this be merged now? I wish to have an updated sample records to document online-help functionality.

@fxprunayre
Copy link
Member

@fxprunayre can this be merged now? I wish to have an updated sample records to document online-help functionality.

No objection here, but I'm a bit short in time to check it. If you've tested it on projects with @josegar74 or @ianwallen don't hesitate to go ahead.

schemas/dublin-core/pom.xml Outdated Show resolved Hide resolved
schemas/iso19115-3.2018/pom.xml Outdated Show resolved Hide resolved
schemas/iso19139/pom.xml Outdated Show resolved Hide resolved
@josegar74
Copy link
Member

josegar74 commented Dec 7, 2023

@jodygarnett about your comments in the PR:

The iso19115-3.2018 sample data for service record was ... odd
was included in the plugin as a zip file, not a mef file.

MEF is just a regular zip with a folder structure.

contents of zip had similar files as the mef format, but arranged in a different folder structure

It seems a MEF 2 format, that allows multiple metadata included. MEF 1 format only allows 1 metadata.

@jodygarnett
Copy link
Contributor Author

This should be good to merge and backport

@jodygarnett
Copy link
Contributor Author

jodygarnett commented Dec 15, 2023

feedback has been addressed; I have also rebased against main to ensure the changes are clean.

@ianwallen
Copy link
Contributor

ianwallen commented Dec 17, 2023

@jodygarnett

I did a sample build on my system and I looked for sample-data folder in the target zip file that was created.

  • I was able to find the sample-data folder in iso19139 and dublin-core
  • I was not able to find the sample-data folder in schemas/iso19115-3.2018/target/gn-schema-iso19115-3.2018-4.4.2-SNAPSHOT.zip

Can you double check iso19115-3.2018 to ensure that it is properly creating the sample-data folder

@jodygarnett
Copy link
Contributor Author

jodygarnett commented Jan 12, 2024

Can you double check iso19115-3.2018 to ensure that it is properly creating the sample-data folder

I concur, it did not show up as expected - let me fix that.

Checking dublin core the empty folders are not included:

unzip -l gn-schema-dublin-core-4.4.2-SNAPSHOT.zip | grep sample
        0  01-12-2024 15:11   dublin-core/sample-data/
     1201  01-12-2024 15:11   dublin-core/sample-data/natural_polar_ecosystems.mef

Comparing with main branch which includes empty folders:

unzip -l dublin-core.mef   
      485  01-12-2011 16:58   info.xml
     1097  03-12-2007 22:02   metadata.xml
        0  03-12-2007 22:02   private/
        0  03-12-2007 22:02   public/

Update: I was able to fix this with a change to the ant zip task : whenempty="create"

@jodygarnett
Copy link
Contributor Author

iso19115-3.2018 service_record.mef now reports back:

unzip -l target/sample-data/service_record.mef
        0  12-15-2023 10:10   metadata/
        0  12-15-2023 10:10   private/
        0  12-15-2023 10:10   public/
      741  12-15-2023 10:10   info.xml
    22322  12-15-2023 10:10   metadata.xml

And this is included in the plugin:

unzip -l target/gn-schema-iso19115-3.2018-4.4.2-SNAPSHOT.zip | grep sample-data
        0  01-12-2024 17:13   iso19115-3.2018/sample-data/
     4602  01-12-2024 17:13   iso19115-3.2018/sample-data/service_record.mef

@jodygarnett
Copy link
Contributor Author

jodygarnett commented Jan 13, 2024

With feedback addressed I am going to rebase, and am in position to merge on Monday.

@fxprunayre you are still listed as a requested reviewer, let me know if you still wish to review this change.

Update: Rebased done for a clean change history suitable for backport

@josegar74 josegar74 modified the milestones: 4.4.2, 4.4.3 Jan 17, 2024
Copy link
Member

@josegar74 josegar74 left a comment

Choose a reason for hiding this comment

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

Works fine, @jodygarnett as the 4.4.2 release is next week, I moved the target to 4.4.3.

@jodygarnett
Copy link
Contributor Author

Works fine, @jodygarnett as the 4.4.2 release is next week, I moved the target to 4.4.3.

Why not merge now?

@josegar74 josegar74 modified the milestones: 4.4.3, 4.4.2 Jan 18, 2024
@josegar74 josegar74 merged commit 22cbf18 into geonetwork:main Jan 18, 2024
6 checks passed
josegar74 pushed a commit that referenced this pull request Jan 18, 2024
…ld time (#7457)

* unpack iso19139 sample data, create mef file at build time

Signed-off-by: Jody Garnett <[email protected]>

* unpack iso19155-3.2018 sample data, create mef file at build time

Signed-off-by: Jody Garnett <[email protected]>

* unpack dublin-core sample data, create mef file at build time

Signed-off-by: Jody Garnett <[email protected]>

---------

Signed-off-by: Jody Garnett <[email protected]>
@jodygarnett jodygarnett deleted the sample-data branch January 19, 2024 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants