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

npm support does not work with nexus #769

Closed
jensh007 opened this issue May 14, 2024 · 1 comment · Fixed by #782
Closed

npm support does not work with nexus #769

jensh007 opened this issue May 14, 2024 · 1 comment · Fixed by #782
Labels
component/ocm-cli OCM Command Line Interface component/ocm-core Open Component Model Core aka. go API kind/bugfix Bug

Comments

@jensh007
Copy link
Contributor

What happened:
npm artifact type does not work with nexus

What you expected to happen:
npm resources should work with any npm repository

How to reproduce it (as minimally and precisely as possible):

15:31:38  debug sapOcmCreateComponent - components:
15:31:38  debug sapOcmCreateComponent - - name: github.wdf.sap.corp/open-component-model/npm-ocm
15:31:38  debug sapOcmCreateComponent -   version: ...15:31:38  debug sapOcmCreateComponent -   resources:
15:31:38  debug sapOcmCreateComponent -   - name: npmpackage
15:31:38  debug sapOcmCreateComponent -     type: npmPackage
15:31:38  debug sapOcmCreateComponent -     version: ...
15:31:38  debug sapOcmCreateComponent -     access:
15:31:38  debug sapOcmCreateComponent -       type: npm
15:31:38  debug sapOcmCreateComponent -       registry: https://staging.repositories..../stage/repository/...
15:31:38  debug sapOcmCreateComponent -       package: npm-ocm
15:31:38  debug sapOcmCreateComponent -       version: ...

OCM CLI generates a 404 error.
It is not an ocm issue. It is a nexus issue. You can do the same with curl:
curl -u : https://staging.repositories.../stage/repository/.../npm-ocm/0.1.0-...
{"success":false,"error":"Package 'npm-ocm-0.1.0-...' not found"}

The problematic call is: https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#getpackageversion
The issue is documented here: sonatype/nexus-public#224

Is there any possibility to workaround this limitation?

Anything else we need to know:

Environment:

@jensh007 jensh007 added the kind/bugfix Bug label May 14, 2024
@jensh007 jensh007 changed the title npm support dies not work with nexus npm support does not work with nexus May 14, 2024
@morri-son morri-son added component/ocm-cli OCM Command Line Interface component/ocm-core Open Component Model Core aka. go API labels May 14, 2024
@morri-son
Copy link
Contributor

adding @hilmarf for awareness

@hilmarf hilmarf self-assigned this May 27, 2024
@hilmarf hilmarf moved this from 🆕 ToDo to 🏗 In Progress in OCM Backlog Board May 28, 2024
@hilmarf hilmarf added this to the 2024-Q2 milestone May 28, 2024
hilmarf added a commit that referenced this issue May 28, 2024
@hilmarf hilmarf linked a pull request May 28, 2024 that will close this issue
26 tasks
hilmarf added a commit that referenced this issue May 29, 2024
## Description

Two step token auth doesn't work with Nexus and the REST endpoint for a
dedicated version doesn't exist. With this PR, Read-Access is done only
via Basic-Auth and in case the specified version endpoint is not found,
it will now try to load the complete package description from one level
above. That should contain ALL existing versions, incl. the requested
one.

## What type of PR is this? (check all applicable)

- [ ] 🍕 Feature
- [ ] 🎇 Restructuring
- [ ] 🐛 Bug Fix
- [ ] 📝 Documentation Update
- [ ] 🎨 Style
- [ ] 🧑‍💻 Code Refactor
- [ ] 🔥 Performance Improvements
- [ ] ✅ Test
- [ ] 🤖 Build
- [ ] 🔁 CI
- [ ] 📦 Chore (Release)
- [ ] ⏩ Revert

## Related Tickets & Documents

- Fixes #753 and #769

## Added tests?

- [ ] 👍 yes
- [ ] 🙅 no, because they aren't needed
- [ ] 🙋 no, because I need help
- [ ] Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

## Added to documentation?

- [ ] 📜 README.md
- [ ] 🙅 no documentation needed

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to 🍺 Done in OCM Backlog Board May 29, 2024
@ocmbot ocmbot bot moved this from 🍺 Done to 🔒Closed in OCM Backlog Board Jun 7, 2024
@hilmarf hilmarf removed their assignment Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ocm-cli OCM Command Line Interface component/ocm-core Open Component Model Core aka. go API kind/bugfix Bug
Projects
Status: 🔒Closed
Development

Successfully merging a pull request may close this issue.

3 participants