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

migration to Nexus 3.71 API #158

Merged
merged 21 commits into from
Sep 13, 2024
Merged

Conversation

stklcode
Copy link
Contributor

@stklcode stklcode commented Aug 12, 2024

Update the plugin structures and formats to latest Nexus 3.71 changes, i.e. drop OrientDB support, migrate to fluent API.

TODO:

  • add DAOs to store data with H2/PostgreSQL backends
  • add browse module
  • migration of recipes and handlers for hosted Composer
  • migrate proxy Composer
  • migrate group Composer
  • update unit tests
  • update integration tests
  • cleanup
  • feature: implement packages/list.json for hosted repository

Run-tested all 3 repository types in a local Nexus 3.71.0-06 container (Java 17, H2)


This is based on #154. Resolves #157

We re-generate the JSON on demand if it does not exist. But if the
requested package does not have any artifact, we should return 404
and not an empty response.
@stklcode stklcode marked this pull request as ready for review August 14, 2024 17:04
@stklcode stklcode changed the title migration to Nexus 3.71 API [WORK IN PROGRESS] migration to Nexus 3.71 API Aug 14, 2024
@stklcode
Copy link
Contributor Author

ping @bhamail

Could you have a look at this (or name someone who can)?
CI requirements are misconfigured (underscores vs. hyphens in job name) and he CLA bot is not running 🤷 But the (modified) tests succeed.

I know this is quite a breaking change, but I guess NXRM 3.71 is breaking for almost any plugin. We might want to add a migration utility 🤔
Few people have already given feedback to snapshot builds and there is also little discussion about further changes. But first place we'd like to see the plugin working agein (discussion in #157)

Copy link
Contributor

@bhamail bhamail left a comment

Choose a reason for hiding this comment

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

I am NOT a Nexus Repository expert, so please test these changes thoroughly to make sure they work well for you.

It is really great to see this contribution!!! There are lot's of community repo format plugins that could benefit from this sort of update to the new DB hotness. Thanks for diving into the deep end!

Another thought: It might be worth adding some documentation that states the current version of the Composer plugin ONLY works with NXRM v3.71+ or whatever. That way, people on older versions hopefully don't upgrade themselves into a bad place by accident. (There are likely to be a lot of upgrade challenges with the DB changes, and anything we can do to minimize that sort of pain is good(tm) ).

nexus-repository-composer/pom.xml Show resolved Hide resolved
<configuration>
<rules>
<!--
Ensure use of Java 8, as required by NXRM
Copy link
Contributor

Choose a reason for hiding this comment

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

Not certain about the Java rules going forward, but I think maybe Java 8 actually stops being supported after NXRM 3.70. See "Java" https://help.sonatype.com/en/sonatype-nexus-repository-system-requirements.html

This gets messy fast.

Maybe add a link to the docs in the comment. At some point, we probably want to PREVENT the use of Java 8...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just the JDK version required to build the plugin, not necessarily the same as the runtime requirement.

I’d be happy to raise this to 11 or 17. We could also clean up quite a few lines then.

@stklcode stklcode force-pushed the nexus371 branch 3 times, most recently from 2675bfc to 5e8a804 Compare August 21, 2024 06:20
* add Java 17
* add notice for NXRM 3.71+
* update plugin version in examples
* update dead or outdated links
@stklcode
Copy link
Contributor Author

I am NOT a Nexus Repository expert, so please test these changes thoroughly to make sure they work well for you.

Anyway thanks very much for your review.
I’m testing this on my backup instance and few people here also tested my snapshot builds (feedback already included in the code).

Another thought: It might be worth adding some documentation that states the current version of the Composer plugin ONLY works with NXRM v3.71+ or whatever. [...]

Updated the README, including a notice on NXRM compatibility, added Java 17 and updated some broken links.

@3v01ut10n
Copy link

Thanks for the new version, it allowed me to update my Nexus

@stklcode stklcode force-pushed the nexus371 branch 2 times, most recently from f4834ad to 3224e70 Compare August 26, 2024 16:48
@stklcode
Copy link
Contributor Author

stklcode commented Aug 26, 2024

Hmm, I thought I fixed the integration tests. Unfortunately the tests are passing locally, but not in CI.

[ERROR] Errors: 
[ERROR]   ComposerProxyIT.providersURLChangedToNXRM » ClassNotFound org.sonatype.nexus.testsuite.testsupport.RepositoryITSupport not found by PAXEXAM-PROBE-283c035a-7258-4d01-a77b-293598258c42 [108]
...

Update:

Got it! Had to add the -features.xml explicitly to Maven dependencies, s.t. it gets resolved during build and Pax Exam can pick it up.

    <dependency>
      <groupId>org.sonatype.nexus.testsuite</groupId>
      <artifactId>nexus-repository-testsupport</artifactId>
      <version>${nxrm-version}</version>
      <classifier>features</classifier>
      <type>xml</type>
      <scope>test</scope>
    </dependency>

The hint was

*SYSTEM org.sonatype.nexus.extender.NexusContextListener - Missing: nexus-repository-testsupport/3.71.0-06

in nexus-repository-composer-it/target/it-data/1/nexus3/log/nexus.log and corresponding some artifact resolving errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Composer plugin is not working on NXRM 3.71
4 participants