Skip to content

Consolidate CLI, core, and config modules; move scope_registry to common#7452

Draft
galvana wants to merge 5 commits intoflatten-api-structurefrom
cli-and-core-cleanup
Draft

Consolidate CLI, core, and config modules; move scope_registry to common#7452
galvana wants to merge 5 commits intoflatten-api-structurefrom
cli-and-core-cleanup

Conversation

@galvana
Copy link
Contributor

@galvana galvana commented Feb 22, 2026

Summary

Continues the module structure cleanup from flatten-api-structure. This PR focuses on three areas:

CLI consolidation — Moves connectors/ and core/ modules under cli/, since they are CLI-only functionality with no API/service consumers. Eliminates the top-level connectors/ and core/ packages.

Config cleanup — Merges config/create.py and config/helpers.py into cli/create_config.py and config/utils.py, co-locating config generation logic with the CLI that drives it and consolidating shared config utilities.

Architectural layering fixes:

  • Moves scope_registry to fides.common.scope_registry so it can be consumed by both CLI and API without the CLI depending on the API layer
  • Extracts V1_URL_PREFIX to fides.common.constants (re-exported from urn_registry for backward compatibility)
  • Inlines the /registration path in cli/utils.py to remove the CLI's import dependency on fides.api.v1.urn_registry

Also consolidates shared utility functions (sanitize_fides_key, get_all_level_fields, FIDES_ASCII_ART, etc.) into fides.common.utils, removing duplicates from cli/core/utils.py.

Test plan

  • nox -s static_checks passes
  • nox -s pytest -- tests/ctl/cli/ passes (CLI tests)
  • nox -s pytest -- tests/ctl/core/ passes (core tests)
  • Full test suite passes in CI

Made with Cursor

@vercel
Copy link
Contributor

vercel bot commented Feb 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Feb 28, 2026 1:34am
fides-privacy-center Ignored Ignored Feb 28, 2026 1:34am

Request Review

@galvana galvana force-pushed the cli-and-core-cleanup branch from 8572883 to 551e7d3 Compare February 27, 2026 02:33
Adrian Galvan and others added 3 commits February 27, 2026 17:08
- Move core/ to cli/core/ and connectors/ to cli/connectors/
- Move common/api/ to fides/api/ (scope_registry, urn_registry)
- Extract common utils from core/utils to common/utils
- Split config/create.py into cli/create_config.py and config/utils.py
- Merge config/helpers.py into config/utils.py
- Consolidate config generation logic into config/utils.py
- Update all imports across fides src and tests

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Move cli/connectors/models.py to config/schemas/credentials.py
- Move credential functions from cli/core/utils.py to common/credentials.py
- Move full urn_registry from api/v1/ to common/urn_registry.py
- Move get_db to common/session, update oauth/utils.py to use it
- Use TYPE_CHECKING for FidesConfig in config/utils.py
- Update all imports across 73+ files

Co-authored-by: Cursor <cursoragent@cursor.com>
@galvana galvana force-pushed the flatten-api-structure branch from 09f6ccf to b6baf7c Compare February 28, 2026 01:09
@galvana galvana force-pushed the cli-and-core-cleanup branch from 551e7d3 to 8fcef2b Compare February 28, 2026 01:09
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.

1 participant