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

Investigate failing nexus badge tests #2347

Closed
paulmelnikow opened this issue Nov 17, 2018 · 8 comments · Fixed by #2520
Closed

Investigate failing nexus badge tests #2347

paulmelnikow opened this issue Nov 17, 2018 · 8 comments · Fixed by #2520
Labels
bug Bugs in badges and the frontend good first issue New contributors, join in! keep-service-tests-green Related to fixing failing tests of the services service-badge Accepted and actionable changes, features, and bugs

Comments

@paulmelnikow
Copy link
Member

paulmelnikow commented Nov 17, 2018

  18) Nexus
       search release version
         
	[ GET /r/https/repository.jboss.org/nexus/jboss/jboss-client.json ]:
     ValidationError: child "value" fails because ["value" with value "invalid" fails to match the required pattern: /^v4(\.\d+)+$/]
      at Object.exports.process (node_modules/joi/lib/errors.js:201:19)
      at internals.Object._validateWithOptions (node_modules/joi/lib/types/any/index.js:751:31)
      at module.exports.internals.Any.root.validate (node_modules/joi/lib/index.js:146:23)
      at Object.pathMatch.matchJSONTypes (node_modules/icedfrisby/lib/pathMatch.js:303:9)
      at _expect (node_modules/icedfrisby/lib/icedfrisby.js:563:10)
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1261:26)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1244:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1131:16)
      at Request.self.callback (node_modules/request/request.js:185:22)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickDomainCallback (internal/process/next_tick.js:219:9)

  19) Nexus
       search release version of an inexistent artifact
         
	[ GET /r/https/repository.jboss.org/nexus/jboss/inexistent-artifact-id.json ]:

      AssertionError: expected { name: 'nexus', value: 'invalid' } to deeply equal { name: 'nexus', value: 'no-artifact' }
      + expected - actual

       {
         "name": "nexus"
      -  "value": "invalid"
      +  "value": "no-artifact"
       }
      
      at Object.pathMatch.matchJSON (node_modules/icedfrisby/lib/pathMatch.js:138:38)
      at _expect (node_modules/icedfrisby/lib/icedfrisby.js:583:10)
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1261:26)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1244:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1131:16)
      at Request.self.callback (node_modules/request/request.js:185:22)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickDomainCallback (internal/process/next_tick.js:219:9)

  20) Nexus
       search snapshot version
         
	[ GET /s/https/repository.jboss.org/nexus/com.progress.fuse/fusehq.json ]:
     ValidationError: child "value" fails because ["value" with value "invalid" fails to match the required pattern: /-SNAPSHOT$/]
      at Object.exports.process (node_modules/joi/lib/errors.js:201:19)
      at internals.Object._validateWithOptions (node_modules/joi/lib/types/any/index.js:751:31)
      at module.exports.internals.Any.root.validate (node_modules/joi/lib/index.js:146:23)
      at Object.pathMatch.matchJSONTypes (node_modules/icedfrisby/lib/pathMatch.js:303:9)
      at _expect (node_modules/icedfrisby/lib/icedfrisby.js:563:10)
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1261:26)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1244:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1131:16)
      at Request.self.callback (node_modules/request/request.js:185:22)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickDomainCallback (internal/process/next_tick.js:219:9)

  21) Nexus
       search snapshot version of a release artifact
         
	[ GET /s/https/repository.jboss.org/nexus/jboss/jboss-client.json ]:

      AssertionError: expected { name: 'nexus', value: 'invalid' } to deeply equal { name: 'nexus', value: 'undefined' }
      + expected - actual

       {
         "name": "nexus"
      -  "value": "invalid"
      +  "value": "undefined"
       }
      
      at Object.pathMatch.matchJSON (node_modules/icedfrisby/lib/pathMatch.js:138:38)
      at _expect (node_modules/icedfrisby/lib/icedfrisby.js:583:10)
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1261:26)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1244:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1131:16)
      at Request.self.callback (node_modules/request/request.js:185:22)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickDomainCallback (internal/process/next_tick.js:219:9)

  22) Nexus
       search snapshot version of an inexistent artifact
         
	[ GET /s/https/repository.jboss.org/nexus/jboss/inexistent-artifact-id.json ]:

      AssertionError: expected { name: 'nexus', value: 'invalid' } to deeply equal { name: 'nexus', value: 'no-artifact' }
      + expected - actual

       {
         "name": "nexus"
      -  "value": "invalid"
      +  "value": "no-artifact"
       }
      
      at Object.pathMatch.matchJSON (node_modules/icedfrisby/lib/pathMatch.js:138:38)
      at _expect (node_modules/icedfrisby/lib/icedfrisby.js:583:10)
      at IcedFrisbyNock._invokeExpects (node_modules/icedfrisby/lib/icedfrisby.js:1261:26)
      at start (node_modules/icedfrisby/lib/icedfrisby.js:1244:12)
      at Request.runCallback [as _callback] (node_modules/icedfrisby/lib/icedfrisby.js:1131:16)
      at Request.self.callback (node_modules/request/request.js:185:22)
      at Request.<anonymous> (node_modules/request/request.js:1161:10)
      at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickDomainCallback (internal/process/next_tick.js:219:9)

Not sure what's up here. The shields.io badge examples look okay.

Ref: #1359

@paulmelnikow paulmelnikow added bug Bugs in badges and the frontend good first issue New contributors, join in! service-badge Accepted and actionable changes, features, and bugs keep-service-tests-green Related to fixing failing tests of the services labels Nov 17, 2018
@calebcartwright
Copy link
Member

I started looking into this one and must confess I'm a bit puzzled. When I run the Nexus tests locally, I get the same above failures (plus 3 additional ones).

However, when I look at the last couple daily service test runs (like 27 and 26), it seems like the Nexus tests are passing 🤷‍♂️

So are the Nexus tests fixed now?

@paulmelnikow
Copy link
Member Author

Huh, I just ran them locally on 58b2765 and everything passes:

  Nexus
    search release version
      ✓
	[ GET /r/https/repository.jboss.org/nexus/jboss/jboss-client.json ] (530ms)
    search release version of an inexistent artifact
      ✓
	[ GET /r/https/repository.jboss.org/nexus/jboss/inexistent-artifact-id.json ] (377ms)
    search snapshot version
      ✓
	[ GET /s/https/repository.jboss.org/nexus/com.progress.fuse/fusehq.json ] (484ms)
    search snapshot version not in latestSnapshot
      ✓
	[ GET /s/https/repository.jboss.org/nexus/com.progress.fuse/fusehq.json ]
    search snapshot version of a release artifact
      ✓
	[ GET /s/https/repository.jboss.org/nexus/jboss/jboss-client.json ] (612ms)
    search snapshot version of an inexistent artifact
      ✓
	[ GET /s/https/repository.jboss.org/nexus/jboss/inexistent-artifact-id.json ] (354ms)
    resolve version
      ✓
	[ GET /developer/https/repository.jboss.org/nexus/ai.h2o/h2o-automl.json ] (342ms)
    resolve version with query
      ✓
	[ GET /fs-public-snapshots/https/repository.jboss.org/nexus/com.progress.fuse/fusehq:c=agent-apple-osx:p=tar.gz.json ] (342ms)
    resolve version of an inexistent artifact
      ✓
	[ GET /developer/https/repository.jboss.org/nexus/jboss/inexistent-artifact-id.json ] (328ms)
    connection error
      ✓
	[ GET /r/https/repository.jboss.org/nexus/jboss/jboss-client.json ]
    json parsing error
      ✓
	[ GET /r/https/repository.jboss.org/nexus/jboss/jboss-client.json ]


  11 passing (4s)

Are they still failing for you?

We're returning "invalid," so I wonder if the server is returning some invalid JSON or a 5xx error. Has this been ported to BaseService? That might be a good next step; maybe it'll make these less flaky, or at least failing in a way that leaves behind more clues.

@calebcartwright
Copy link
Member

calebcartwright commented Dec 8, 2018

Yeah still failing for me locally. It's definitely still using the LegacyService so porting it to the new model is a good call. Two birds as they say! 🐦

I can get around to this in the near future, and could likely use this as an opportunity to add support for private Nexus' instances as requested in #1699 if that's still needed

@calebcartwright
Copy link
Member

Well porting legacy services looks like it will be fun 😄

if I have questions while working on this, where's the best place for those? should i just tack them on to this issue or do those types of questions/convos happen elsewhere?

@calebcartwright
Copy link
Member

also the tests are passing for me now, so the issue was most likely just my local environment

@paulmelnikow
Copy link
Member Author

We usually recommend they take place on the issue, though the #dev room on Discord is an equally good place!

@calebcartwright
Copy link
Member

calebcartwright commented Dec 12, 2018

I still need to join Discord (never used it before). One thing I've found is that Nexus has a pretty varied set of APIs between 2.x and 3.x versions of the platform, which may be pertinent especially if we want to support private Nexus instances (via self-hosted Shields instances) as requested in #1699

The current Nexus implementation in Shields (using the LegacyService) is leveraging the Nexus 2.x APIs (which are provided via a plugin that has a 1.x, confusingly enough)
https://repository.sonatype.org/nexus-restlet1x-plugin/default/docs/index.html
Also worth noting that Sonatype refers to those 2.x APIs as "Legacy" such as here: https://blog.sonatype.com/learn-the-nexus-rest-api-automating-sonatype-nexus#legacy-endpoint-documentation

Nexus 3.x rest API docs can be found here: https://help.sonatype.com/repomanager3/rest-and-integration-api/search-api

What I do not yet know is whether a Nexus 3.x deployment will still support those legacy/2.x API endpoints we're currently using.

I think I've got a grip on what I'd need to do to port the existing LegacyService to the new Service model, continuing to leverage the Nexus 2.x endpoints. However, it does beg the question of whether we should add support for Nexus 3.x as part of this process (and if so I have some follow up questions 😄)

@paulmelnikow
Copy link
Member Author

Supporting 3.x sounds good but would be good to do as a follow on. Smaller PRs are always easier to work with, and faster!

paulmelnikow pushed a commit that referenced this issue Dec 19, 2018
Ports the Nexus service to the new service model. Some related/relevant conversation in #2347 (and closes #2347). Also adds support for authentication which resolves #1699.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend good first issue New contributors, join in! keep-service-tests-green Related to fixing failing tests of the services service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants