Skip to content

Migrate to salt extension - #26

Merged
jsandas merged 25 commits into
masterfrom
migrate-to-salt-ext
Mar 30, 2026
Merged

Migrate to salt extension#26
jsandas merged 25 commits into
masterfrom
migrate-to-salt-ext

Conversation

@jsandas

@jsandas jsandas commented Mar 29, 2026

Copy link
Copy Markdown
Owner

This pull request establishes the foundation for migrating the project to a modern Salt extension package layout. It removes the legacy file_root sync model, introduces a new CI/CD pipeline, updates documentation, and adds tooling for development and release workflows. The changes focus on standardizing installation, testing, and documentation processes to align with current Salt extension best practices.

Project structure and packaging:

  • Migrated the codebase to a Salt extension package layout under src/saltext/nexus3, removing the legacy _modules, _states, and _utils file_root sync paths. [1] [2] [3] [4] [5] [6]
  • Added initial changelog fragment and template to track migration and future changes. [1] [2]

Continuous Integration and Automation:

  • Replaced and expanded GitHub Actions workflows for PRs, pushes, and tags, including quality checks, multi-version testing, integration tests, and release artifact handling. [1] [2] [3] [4] [5]
  • Introduced pre-commit configuration with Ruff for linting and formatting.

Documentation overhaul:

  • Migrated documentation to Sphinx with autodoc from the extension package, added new reference and topic docs, and clarified installation and migration steps. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Development workflow improvements:

  • Enhanced the Makefile with new targets for testing, linting, formatting, documentation, changelog generation, and syncing source files. [1] [2] [3]
  • Updated Docker Compose setup to mount the new workspace structure and removed references to legacy loader folders. [1] [2]

Summary:
These changes lay the groundwork for a modern, maintainable Salt extension package, streamline CI/CD, and provide clear migration and development guidance.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Establishes a modern Salt extension package layout for the Nexus 3 modules/states, adding loader entry points, packaging metadata, updated docs, and CI/dev tooling to support the migration.

Changes:

  • Introduces the saltext.nexus3 Python package (modules/states/utils + loader entry points) and a compatibility shim.
  • Adds unit/functional test scaffolding plus nox/pre-commit/Towncrier-based developer workflows.
  • Reworks Docker/integration setup and GitHub Actions workflows to run quality gates and build artifacts/docs.

Reviewed changes

Copilot reviewed 57 out of 66 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/unit/test_utils_nexus3.py Unit coverage for NexusClient config defaults and request headers/payload behavior.
tests/unit/test_state_users.py Unit tests for users state behavior (test mode, drift detection, password updates).
tests/unit/test_state_security.py Unit tests for security states (anonymous access, realms).
tests/unit/test_state_scripts.py Unit tests validating scripts state payload wiring.
tests/unit/test_state_roles.py Unit tests for roles state create/update behavior and test mode.
tests/unit/test_state_repositories.py Unit tests for repositories state behavior (test mode absent, type/format immutability, no-drift).
tests/unit/test_state_privileges.py Unit tests for privileges state validation and test-mode update reporting.
tests/unit/test_state_email.py Unit tests for email state test-mode behavior and no-drift behavior.
tests/unit/test_state_blobstores.py Unit tests for blobstores state create/no-drift behavior.
tests/unit/test_loader.py Unit test asserting loader directory entry points exist.
tests/integration/pytest.ini Removes per-suite pytest config (moved into pyproject).
tests/functional/test_loader_smoke.py Functional smoke test that Salt loader discovers modules/states.
tests/functional/test_loader_calls.py Functional tests calling a loaded state in test/apply modes.
tests/functional/conftest.py Functional fixtures to initialize Salt loader with local module/state/utils dirs.
tests/files/integration.yml Updates integration compose to mount repo workspace and support package install.
tests/conftest.py Ensures src/ is on sys.path for tests.
src/saltext/nexus3/utils/nexus3.py Adds shared Nexus client/config helper under package layout.
src/saltext/nexus3/utils/init.py Declares utils package.
src/saltext/nexus3/states/nexus3_users.py Adds packaged users state module.
src/saltext/nexus3/states/nexus3_security.py Adds packaged security state module.
src/saltext/nexus3/states/nexus3_scripts.py Minor docstring formatting adjustments.
src/saltext/nexus3/states/nexus3_roles.py Fixes update-flag logic and avoids unnecessary update calls.
src/saltext/nexus3/states/nexus3_repositories.py Minor docstring whitespace tweaks.
src/saltext/nexus3/states/nexus3_privileges.py Adds packaged privileges state module.
src/saltext/nexus3/states/nexus3_email.py Adds packaged email state module.
src/saltext/nexus3/states/nexus3_blobstores.py Adds packaged blobstores state module.
src/saltext/nexus3/states/init.py Declares states package.
src/saltext/nexus3/modules/nexus3_users.py Updates imports to use packaged utils (saltext.nexus3.utils.nexus3).
src/saltext/nexus3/modules/nexus3_tasks.py Updates imports to use packaged utils.
src/saltext/nexus3/modules/nexus3_status.py Updates imports to use packaged utils.
src/saltext/nexus3/modules/nexus3_roles.py Updates imports to use packaged utils.
src/saltext/nexus3/modules/nexus3_repositories.py Updates imports to use packaged utils.
src/saltext/nexus3/modules/nexus3_realms.py Updates imports to use packaged utils.
src/saltext/nexus3/modules/nexus3_readonly.py Updates imports to use packaged utils.
src/saltext/nexus3/modules/nexus3_privileges.py Updates imports to use packaged utils.
src/saltext/nexus3/modules/nexus3_email.py Updates imports to use packaged utils; docstring formatting tweak.
src/saltext/nexus3/modules/nexus3_blobstores.py Updates imports to use packaged utils.
src/saltext/nexus3/modules/nexus3_anonymous_access.py Updates imports to use packaged utils.
src/saltext/nexus3/modules/init.py Declares modules package.
src/saltext/nexus3/loader.py Adds Salt loader entry points for module/state/utils dirs.
src/saltext/nexus3/init.py Adds package metadata and dynamic version lookup.
src/saltext/init.py Declares top-level saltext package.
src/nexus3.py Adds compatibility shim for legacy import nexus3.
pyproject.toml Defines packaging metadata, entry points, extras, ruff/pytest/towncrier config.
noxfile.py Adds nox sessions for tests, integration, lint, docs, changelog.
docs/topics/migration.md Adds migration guidance and current support statements.
docs/topics/installation.md Adds package-based installation guidance.
docs/topics/deprecation-policy.md Documents deprecation lifecycle and compatibility expectations.
docs/ref/states.rst Adds Sphinx autodoc reference for state modules.
docs/ref/modules.rst Adds Sphinx autodoc reference for execution modules.
docs/index.rst Adds Sphinx index/toctrees for topics and API refs.
docs/conf.py Adds Sphinx configuration with mocked Salt imports.
docker-compose.yml Updates compose volumes to mount workspace for editable installs.
changelog/.template.jinja Adds Towncrier template.
changelog/.gitkeep Keeps changelog directory in VCS.
changelog/+migration-foundation.added.md Adds Towncrier fragment describing migration foundation.
bin/sync_legacy_to_src.py Adds helper to sync legacy folders into src/ when present.
README.md Updates installation/dev/docs pointers for extension package workflow.
Makefile Adds nox/pre-commit/towncrier targets and updates integration/start workflows.
.pre-commit-config.yaml Adds Ruff lint/format hooks.
.gitignore Adds Python build artifacts and Sphinx build output.
.github/workflows/tag.yml Adds tag/dispatch release verification and GitHub release flow.
.github/workflows/push.yml Adds push workflow for lint/changelog/docs/build + test matrix.
.github/workflows/pr.yml Adds PR workflow for lint/changelog/build + test matrix + integration.
.github/workflows/integration.yaml Removes legacy integration-only workflow.
.github/dependabot.yml Adds Dependabot for GitHub Actions and pip dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/topics/migration.md
Comment thread Makefile Outdated
Comment thread noxfile.py Outdated
Comment thread tests/functional/conftest.py Outdated
jsandas and others added 4 commits March 29, 2026 20:11
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 57 out of 66 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/unit/test_state_repositories.py Outdated
Comment thread src/saltext/__init__.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jsandas
jsandas marked this pull request as ready for review March 30, 2026 02:39
@jsandas
jsandas merged commit 44a9ad0 into master Mar 30, 2026
5 checks passed
@jsandas
jsandas deleted the migrate-to-salt-ext branch March 30, 2026 02:42
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.

2 participants