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

Updates to support new rubygems.org API #9

Merged
merged 24 commits into from
Aug 2, 2023

Conversation

headius
Copy link
Member

@headius headius commented Jul 13, 2023

This PR will address #8 by updating the backend protocol to use the new v2 APIs at rubygems.org.

There will also be updates to plugins and dependencies along the way.

The entirety of the API subsystem for this endpoint will be
removed but I leave these in place to know where they are called
from.

There are other places in the actual build of mavengem that also
try to use the Marshal.4.8-based API.
headius added a commit to jruby/jruby-maven-plugins that referenced this pull request Jul 20, 2023
A few minor tweaks were needed here to make this work properly.
Part of work to get mavengem updated and working with the new
RubyGems.org API (jruby/mavengem#9).

For the gem installer change background, see rubygems/rubygems@de3f8d0

For the bold/escape change, see jruby/jruby#7864
Several changes needed here due to restructuring of the standard
library and changes to some of the rubygems APIs.

* Using 2.0.2-SNAPSHOT of the jruby-maven-plugins, which contains
  updates for JRuby 9.4.3.0.
* Minitest is a bundled gem now and needs to be installed and
  activated.
* Gem.inflate is no longer available; use Zlib::Inflater.inflate
  which is largely equivalent after requiring zlib.
* Some typos in bundle_runner.rb error handling that were not seen
  until the current upgrade produced errors.
* Hardcoded a change to always_verify_ssl_certificates to call
  `Timeout.timeout` since the top-level method is gone. This may
  need to be fixed in the real gem, but it has been abandoned.
* Minor updates for bundler output.
@headius headius force-pushed the rubygems_api_update branch 2 times, most recently from 516a6bb to 8523fca Compare July 21, 2023 06:11
Will revisit the fragility of this setup later.
@headius headius marked this pull request as draft July 21, 2023 20:41
This is a preliminary attempt; the single API does not provide
enough information for this requirement (specifically, it does not
list other gem platforms, so we might choose the best for the
current platform) so more integration of other APIs will be
necessary.
This is the big drop to get all the major features working
properly atop the v2 and compact index APIs rather than the now-
defunct v1 dependencies API.

I was guessing my way through this codebase a bit but the new APIs
are hooked up as follows:

* The v1 dependencies API (dependencies?gems=foo,bar) has been
  mostly replaced with the compact index API. This API provides
  all versions of one specified gem. Any features that depend on
  the dependencies API to get multiple gems at once are still
  broken and will need to iterate over all given gems using the
  compact index.
* The creation of gemspecs and poms from the old gzipped spec
  format has been moved to the v2 gem info API.

All tests are passing in mavengem-protocol, which only depends on
features like poms and gems, all of which have been moved to the
new APIs.

This is close to addressing jruby#8.
Group ID is changed to "com.headius" because I do not have push
privileges for "org.torquebox.mojo".

Inter-library dependencies switched to use "com.headius" for
snapshot deploy, but build still uses the previous release of
mavengem extension (did not seem to like me using snapshot
extensions from the same project, or at least refused to resolve
them.

maven-tools updated to latest to fix a bug in gem logic that tried
to gsub! on an empty string that now appears to be coming in
frozen:

jruby/maven-tools@1188743#diff-e4394efc5b28617f42311627dd8af1193c01d1a39b939959085c6836f3e9e5b7R149

With these changes, I have successfully been able to:

* Deploy 1.0.4-SNAPSHOT versions of all three artifacts
* Show JRuby build failing with a patched 1.0.3 that uses a
  non-"Java" User-Agent when contacting rubygems.org (causing the
  v1 deps API to reject requests and gems fail to resolve.
* Show JRuby build working with the same User-Agent patch but the
  new logic to use v2 and compact APIs.

Nearly complete solution for jruby#8 but not all features in
rubygems-tools are updated and not all v1 deps API and gz data
file uses have been purged yet.
Torquebox is defunct and we don't have push rights to that group
ID anyway. We are now the maintainers of this, so it makes sense
to move under org.jruby.
I believe this is the last reference to the fictional "pre" gem in
the tests. Almost all tests are now running only against real gems
and real data from rubygems.org.
@headius headius requested a review from mkristian August 1, 2023 20:02
@headius
Copy link
Member Author

headius commented Aug 1, 2023

@mkristian Could you have a quick look at this and make sure I did not do something silly?

It's passing all tests now, but as I mention in some of the commits, some of those tests are for the defunct v1/dependencies API and only pass because they use local data.

@headius headius linked an issue Aug 2, 2023 that may be closed by this pull request
@headius headius added this to the 2.0 milestone Aug 2, 2023
headius added a commit to headius/jruby that referenced this pull request Aug 2, 2023
Mavengem has used the v1/dependencies API on rubygems.org to get
gem information, but that API has now gone away (whitelisted for
us until August 8). This change migrates to a newer version of
mavengem that uses newer APIs to make up the same functionality.

See jruby/mavengem#9
@headius headius merged commit 3007e4c into jruby:master Aug 2, 2023
1 check passed
@headius headius deleted the rubygems_api_update branch August 2, 2023 18:14
headius added a commit to headius/jruby that referenced this pull request Aug 3, 2023
This update is necessary to get JRuby 9.4.3.0 running throughout
the JRuby/Maven stack, which is necessary to move to the new
mavengems.

See jruby/jruby-maven-plugins#126

See jruby/mavengem#9
headius added a commit to headius/jruby that referenced this pull request Aug 3, 2023
This update is necessary to get JRuby 9.4.3.0 running throughout
the JRuby/Maven stack, which is necessary to move to the new
mavengems.

See jruby/jruby-maven-plugins#126

See jruby/mavengem#9
headius added a commit to headius/jruby that referenced this pull request Aug 3, 2023
This update is necessary to get JRuby 9.4.3.0 running throughout
the JRuby/Maven stack, which is necessary to move to the new
mavengems.

See jruby/jruby-maven-plugins#126

See jruby/mavengem#9

There is also a change to replace the use of `jruby_plugin` in
test/pom.rb with a normal `plugin` DSL call, due to the former
hardcoding an old package for the jruby-maven-plugins.

See jruby/maven-tools#37
headius added a commit to headius/jruby that referenced this pull request Aug 3, 2023
This update is necessary to get JRuby 9.4.3.0 running throughout
the JRuby/Maven stack, which is necessary to move to the new
mavengems.

See jruby/jruby-maven-plugins#126

See jruby/mavengem#9

There are also changes to replace the use of `jruby_plugin` in
several poms with a normal `plugin` DSL call, due to the former
hardcoding an old package for the jruby-maven-plugins.

See jruby/maven-tools#37
headius added a commit to headius/polyglot-maven that referenced this pull request Aug 3, 2023
This is part of work to update the entire JRuby/Maven stack, in
order to update the version of JRuby used and to address API
deprecations at rubygems.org.

This PR updates JRuby to latest (9.4.3.0) and moves all plugins
to their new org.jruby.maven group ID with latest versions.

Fixes takari#37.

We will need to coordinate getting this released along with the
maven plugins in the very near term. Because of the rubygems.org
API being shut down next week (the 8th), we are under the gun.

See jruby/mavengem#9, jruby/jruby-maven-plugins#126,
jruby/maven-tools#38 and jruby/jruby#7872.
headius added a commit to headius/polyglot-maven that referenced this pull request Aug 3, 2023
This is part of work to update the entire JRuby/Maven stack, in
order to update the version of JRuby used and to address API
deprecations at rubygems.org.

This PR updates JRuby to latest (9.4.3.0) and moves all plugins
to their new org.jruby.maven group ID with latest versions.

Part of the fix for jruby/maven-tools#37.

We will need to coordinate getting this released along with the
maven plugins in the very near term. Because of the rubygems.org
API being shut down next week (the 8th), we are under the gun.

See jruby/mavengem#9, jruby/jruby-maven-plugins#126,
jruby/maven-tools#38 and jruby/jruby#7872.
headius added a commit to headius/polyglot-maven that referenced this pull request Aug 4, 2023
This is part of work to update the entire JRuby/Maven stack, in
order to update the version of JRuby used and to address API
deprecations at rubygems.org.

This PR updates JRuby to latest (9.4.3.0) and moves all plugins
to their new org.jruby.maven group ID with latest versions.

Part of the fix for jruby/maven-tools#37.

We will need to coordinate getting this released along with the
maven plugins in the very near term. Because of the rubygems.org
API being shut down next week (the 8th), we are under the gun.

See jruby/mavengem#9, jruby/jruby-maven-plugins#126,
jruby/maven-tools#38 and jruby/jruby#7872.
headius added a commit to headius/polyglot-maven that referenced this pull request Aug 4, 2023
This is part of work to update the entire JRuby/Maven stack, in
order to update the version of JRuby used and to address API
deprecations at rubygems.org.

This PR updates JRuby to latest (9.4.3.0) and moves all plugins
to their new org.jruby.maven group ID with latest versions.

The maven-tools gem is updated to 1.2.

Part of the fix for jruby/maven-tools#37.

We will need to coordinate getting this released along with the
maven plugins in the very near term. Because of the rubygems.org
API being shut down next week (the 8th), we are under the gun.

See jruby/mavengem#9, jruby/jruby-maven-plugins#126,
jruby/maven-tools#38 and jruby/jruby#7872.
headius added a commit to headius/jruby that referenced this pull request Aug 4, 2023
This update is necessary to get JRuby 9.4.3.0 running throughout
the JRuby/Maven stack, which is necessary to move to the new
mavengems.

See jruby/jruby-maven-plugins#126

See jruby/mavengem#9

There are also changes to replace the use of `jruby_plugin` in
several poms with a normal `plugin` DSL call, due to the former
hardcoding an old package for the jruby-maven-plugins.

See jruby/maven-tools#37
@mkristian
Copy link
Member

all looks sane. Somehow my email replies did not get through. Any ways already merged.

headius added a commit to headius/jruby that referenced this pull request Aug 9, 2023
Mavengem has used the v1/dependencies API on rubygems.org to get
gem information, but that API has now gone away (whitelisted for
us until August 8). This change migrates to a newer version of
mavengem that uses newer APIs to make up the same functionality.

See jruby/mavengem#9
headius added a commit to headius/jruby that referenced this pull request Aug 9, 2023
This update is necessary to get JRuby 9.4.3.0 running throughout
the JRuby/Maven stack, which is necessary to move to the new
mavengems.

See jruby/jruby-maven-plugins#126

See jruby/mavengem#9

There are also changes to replace the use of `jruby_plugin` in
several poms with a normal `plugin` DSL call, due to the former
hardcoding an old package for the jruby-maven-plugins.

See jruby/maven-tools#37
headius added a commit to headius/jruby that referenced this pull request Aug 10, 2023
Mavengem has used the v1/dependencies API on rubygems.org to get
gem information, but that API has now gone away (whitelisted for
us until August 8). This change migrates to a newer version of
mavengem that uses newer APIs to make up the same functionality.

See jruby/mavengem#9
@headius
Copy link
Member Author

headius commented Aug 10, 2023

@mkristian Thanks for the review!

cstamas added a commit to takari/polyglot-maven that referenced this pull request Aug 25, 2023
This is part of work to update the entire JRuby/Maven stack, in order to update the version of JRuby used and to address API deprecations at rubygems.org.

This PR updates JRuby to latest (9.4.3.0) and moves all plugins to their new org.jruby.maven group ID with latest versions.

Part of the fix for jruby/maven-tools#37. (incorrectly tagged as #37 here before)

We will need to coordinate getting this released along with the maven plugins in the very near term. Because of the rubygems.org API being shut down next week (the 8th), we are under the gun.

See jruby/mavengem#9, jruby/jruby-maven-plugins#126, jruby/maven-tools#38 and jruby/jruby#7872.
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.

can not run pom.rb build on Java 11
2 participants