Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Sonatype Nexus repository integration module#262

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MAVRICK-1 wants to merge28 commits intocoder:main
base:main
Choose a base branch
Loading
fromMAVRICK-1:feat/nexus-repository-module

Conversation

MAVRICK-1
Copy link
Contributor

@MAVRICK-1MAVRICK-1 commentedJul 29, 2025
edited
Loading

Add Sonatype Nexus Repository Integration Module

Summary

Implements a Coder module for Sonatype Nexus Repository Manager integration that automatically configures Maven, npm, PyPI, and Docker registries for development workspaces.

Demo Video & Screenshots

Screencast.from.2025-07-29.23-34-36.mp4

Nexus Repository Integration

Features

  • Maven Support: Automaticsettings.xml configuration
  • npm Support: Automatic.npmrc configuration with scoped packages
  • PyPI Support: Automaticpip.conf configuration
  • Docker Support: Registry authentication setup
  • Flexible Configuration: Support for multiple repositories per package manager
  • Secure Credentials: API token and password support
  • Username Options: Configurable username field (username or email)

Nexus Repository Manager Requirements

Version Requirements

Yes, this module requires Nexus Repository Manager Pro version for full functionality, though basic features work with the Community Edition (OSS).

Supported Authentication Methods

This module supports4 authentication methods:

  1. User Token Authentication (Recommended - Pro only)

    • Enhanced security with two-part tokens
    • Ideal for CI/CD and automated environments
    • Requiresnx-usertoken-current privilege
  2. API Token Authentication (Pro only)

    • Single-use access tokens via REST API
    • Programmatic token generation and management
  3. Basic Authentication (OSS & Pro)

    • Standard HTTP Basic Auth with username/password
    • Works with both OSS and Pro versions
  4. Base64 Encoded Credentials (OSS & Pro)

    • Base64 encodedusername:password format
    • Compatible with npm and other package managers

Testing Instructions

Prerequisites

  • Nexus Repository Manager instance (OSS or Pro)
  • Admin access to configure repositories
  • Test repositories for each package manager you want to test

Setup Test Environment

  1. Create Test Repositories in your Nexus instance:

    • Maven:maven-public,maven-releases
    • npm:npm-public,@company:npm-private
    • PyPI:pypi-public,pypi-private
    • Docker:docker-public,docker-private
  2. Configure Authentication:

    • For Pro: Generate user tokens via UI (User menu → User Token)
    • For OSS: Use username/password or base64 encoded credentials
    • Set up appropriate permissions for test repositories
  3. Test the Module:

    module"nexus" {source="registry.coder.com/mavrickrishi/nexus/coder"version="1.0.0"agent_id=coder_agent.main.idnexus_url="https://your-nexus-instance.com"nexus_password=var.nexus_api_token# or passwordpackage_managers={    maven= ["maven-public","maven-releases"]    npm= ["npm-public","@company:npm-private"]    pypi= ["pypi-public","pypi-private"]    docker= ["docker-public","docker-private"]  }}
  4. Verify Configuration:

    • Check generated config files in workspace
    • Test package installation from configured repositories
    • Verify authentication works for each package manager

EC2 Deployment Testing

Tested by deploying on EC2 instance with:

  • Ubuntu 22.04 LTS
  • Nexus Repository Manager Pro
  • All package managers (Maven, npm, PyPI, Docker)
  • Both token and basic authentication methods

Usage Example

module"nexus" {source="registry.coder.com/mavrickrishi/nexus/coder"version="1.0.0"agent_id=coder_agent.main.idnexus_url="https://nexus.company.com"nexus_password=var.nexus_api_tokenpackage_managers={    maven= ["maven-public","maven-releases"]    npm= ["npm-public","@company:npm-private"]    pypi= ["pypi-public","pypi-private"]    docker= ["docker-public","docker-private"]  }}

Testing

  • ✅ 11 comprehensive tests covering all functionality
  • ✅ Variable validation tests
  • ✅ Package manager configuration tests
  • ✅ Error handling tests
  • ✅ All tests passing
  • ✅ EC2 deployment tested

Files Added

  • registry/mavrickrishi/modules/nexus/main.tf - Main module configuration
  • registry/mavrickrishi/modules/nexus/README.md - Complete documentation
  • registry/mavrickrishi/modules/nexus/main.test.ts - Test suite

Checklist

  • Module follows existing patterns and conventions
  • Comprehensive test coverage (11 tests)
  • Complete documentation with examples
  • Input validation and error handling
  • Secure credential handling
  • All tests passing
  • Demo video included
  • Screenshots added
  • Testing instructions provided
  • Authentication methods documented
  • EC2 deployment tested

Closes#202
/claim#202

michaelbrewer reacted with heart emoji
- Add nexus module with support for Maven, npm, PyPI, and Docker registries- Includes comprehensive test suite with 11 passing tests- Supports configurable repositories per package manager- Automatic configuration of package manager settings- Secure credential handling with API token support- Flexible username configuration (username or email)- Complete documentation with usage examplesResolvescoder#202
Copilot

This comment was marked as outdated.

MAVRICK-1and others added4 commitsJuly 30, 2025 00:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Fix Terraform formatting with terraform fmt- Fix README formatting with prettier- All linting checks now pass
@MAVRICK-1
Copy link
ContributorAuthor

imagelinting issue fixed

@bpmct
Copy link
Member

How does the user authenticate their account?

@MAVRICK-1
Copy link
ContributorAuthor

@bpmct through url and password

Copy link
Member

@matifalimatifali left a comment

Choose a reason for hiding this comment

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

Left a few suggestions.

@matifali
Copy link
Member

Does it work withhttps://help.sonatype.com/en/user-tokens.html?

@matifali
Copy link
Member

Also,@michaelbrewer, do you usehttps://help.sonatype.com/en/user-tokens.html based authentication?

@MAVRICK-1
Copy link
ContributorAuthor

Does it work withhttps://help.sonatype.com/en/user-tokens.html?

yeah

@MAVRICK-1MAVRICK-1 requested a review frommatifaliJuly 30, 2025 09:38
Copy link
Member

@matifalimatifali left a comment

Choose a reason for hiding this comment

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

I think we should rename eModule to be valued Nexus repository as Nexus has multiple other products. Please also update all other references.

Co-authored-by: Atif Ali <me@matifali.dev>
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a comprehensive Sonatype Nexus Repository integration module for Coder that automatically configures Maven, npm, PyPI, and Docker registries for development workspaces with secure credential handling.

  • Implements a complete Nexus integration module with support for multiple package managers
  • Provides secure credential handling using API tokens and password authentication
  • Includes comprehensive test coverage with 11 tests covering all functionality

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
registry/mavrickrishi/modules/nexus/main.tfMain Terraform module with variable definitions, validation rules, and script configuration
registry/mavrickrishi/modules/nexus/run.shShell script that configures package managers (Maven, npm, PyPI, Docker) with Nexus repositories
registry/mavrickrishi/modules/nexus/main.test.tsComprehensive test suite with 11 tests covering all module functionality
registry/mavrickrishi/modules/nexus/README.mdComplete documentation with usage examples for all supported package managers
registry/mavrickrishi/README.mdRegistry metadata and module listing for the mavrickrishi namespace

MAVRICK-1and others added3 commitsJuly 30, 2025 15:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MAVRICK-1
Copy link
ContributorAuthor

imagetest passed

@MAVRICK-1MAVRICK-1 requested a review frommatifaliJuly 30, 2025 10:31
@matifali
Copy link
Member

One last thing
to make it in parity with JFrog is the go support. Can you add that too? I am setting up a Nexus Repository instance to test it as soon as I can.

@MAVRICK-1
Copy link
ContributorAuthor

MAVRICK-1 commentedAug 4, 2025
edited
Loading

image

test failed in other module,@matifali any update ?

matifali
matifali previously approved these changesAug 4, 2025
Copy link
Member

@matifalimatifali left a comment

Choose a reason for hiding this comment

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

Thanks for the Contribution. Can you please linnk the main demo video in the PR body? Also add some intsruction to test it on SonaType Nexus. Does it require a pro version of Nexus Sonatype? What Auth methods are supported?

@MAVRICK-1
Copy link
ContributorAuthor

@matifali yes it required pro, added everything in Pr

@MAVRICK-1
Copy link
ContributorAuthor

imagei took a free pro trail by reaching coreyw@sonatype.com

@MAVRICK-1
Copy link
ContributorAuthor

@DevelopmentCats done

@MAVRICK-1
Copy link
ContributorAuthor

MAVRICK-1 commentedAug 19, 2025
edited
Loading

@DevelopmentCats@matifali just a headsup , anything more needed to implement ?

@matifali
Copy link
Member

@MAVRICK-1 I am still waiting for a license to test this.

@MAVRICK-1
Copy link
ContributorAuthor

@MAVRICK-1 I am still waiting for a license to test this.

@matifali my pro version is expired

matifali reacted with confused emoji

@DevelopmentCats
Copy link
Contributor

I will work on getting a license to test this with tonight. Knock on wood we can get this all merged. Sorry for the delay@MAVRICK-1

@MAVRICK-1
Copy link
ContributorAuthor

@DevelopmentCats thanx for the follow-up

DevelopmentCats reacted with heart emoji

@DevelopmentCats
Copy link
Contributor

Just updating. Im waiting on my trial but I should be able to get this done.

@MAVRICK-1
Copy link
ContributorAuthor

@DevelopmentCats any updates?

@DevelopmentCats
Copy link
Contributor

@DevelopmentCats any updates?

Ill check on this now. I hadn't gotten an email from them

@DevelopmentCats
Copy link
Contributor

@MAVRICK-1 can you runbun run fmt on this in the meantime?

@MAVRICK-1
Copy link
ContributorAuthor

on it

@MAVRICK-1
Copy link
ContributorAuthor

@DevelopmentCats done

@DevelopmentCats
Copy link
Contributor

DevelopmentCats commentedOct 7, 2025
edited
Loading

@MAVRICK-1 Would this work with nexus repositories that allow anonymous connections?

Im testing it out now, and I notice that nexus_password is a required variable.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@matifalimatifalimatifali left review comments

@DevelopmentCatsDevelopmentCatsAwaiting requested review from DevelopmentCats

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add Sonatype Nexus repository integration module
4 participants
@MAVRICK-1@bpmct@matifali@DevelopmentCats

[8]ページ先頭

©2009-2025 Movatter.jp