Skip to content

Reorganize modules into cli/build/tools packages with full import compatibility (WP8) - #26

Closed
devin-ai-integration[bot] wants to merge 1 commit into
devin/wp7-test-hardeningfrom
devin/wp8-module-reorg
Closed

devin-ai-integration[bot] wants to merge 1 commit into
devin/wp7-test-hardeningfrom
devin/wp8-module-reorg

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Related Issue(s)
Has Unit Tests (y/n) y
Documentation Included (y/n) n

Change Description

Moves modules into an understandable layout — fprime.cli (argument parsing/dispatch), fprime.build (cmake/builder/targets/gcovr), fprime.tools (cookiecutter, formatter, versioning) — while keeping every old import path working. Old paths are sys.modules aliases of the new modules (same module object, so monkeypatching through either path works):

import fprime.fbuild.builder as old, fprime.build.builder as new
assert old is new

Entry points (fprime.util.__main__:main, fprime.util.versioning:main), shipped cookiecutter hook imports, and nasa/fprime's from fprime.fbuild.settings import IniSettings all unchanged. Internal tests import the new paths; test_import_compat.py keeps the old paths and gains one module-identity assertion per mapping row.

Rationale

WP8 of 9, stacked on #24. Zero logic changes — file moves plus alias shims only.

Testing/Review Recommendations

243 passed + 9 skipped (base: 221 + 9; +22 identity assertions); black clean; wheel built and verified in a clean venv (fprime-util --help, fprime-version-check). Note: the plan's target tree listed a templates/ alias with no mapping row; not created.

Future Work

WP9 (fpp_to_json disposition) — pending maintainer sign-off.

Pushed by Devin AI

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/bba39c1277854bf8a1fd63a094f20e24
Requested by: @thomas-bc-autobot


Open in Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Author
Original prompt from thomas.boyer.chammard

I want this session to be a large effort to make fprime-tools more maintainable and cleaner code/less technical debt. Please make a plan to study that and deliver a master plan. Allocate subagent to find areas that can be improved, then more subagents to study it in detail and make a plan, then iterate on the plan with other review agents until the review agent and planner agent agree on an approved plan. Once the approved plan is done, have other implementer agents implement the plan, and review agents that build and test the result. Iterate until everyone agrees the code is correct and an improvement. Use subagents, high importance goals:

  • CLI and external APIs should ideally be left unchanged, or backwards compatibility layer left in
  • The less line of code changes, the easier the review. But if lots of LOC for high value simplification, it is ok.

Let’s go! Don’t stop, keep iterating until my goals are met.

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

… shims (WP8)

Move modules to the approved target tree:
- fprime.cli: entry (util/cli), commands, help_text, build_helper, versioning,
  fbuild (fbuild/cli), fpp (fpp/cli)
- fprime.build: builder, cmake, settings, types; fprime.build.targets:
  __init__ (target_definitions), target, check, gcovr, enumerator
- fprime.tools: clang_format (code_formatter), cookiecutter
  (cookiecutter_wrapper); fprime.tools.fpp: common, impl, merge, visualize

Every old module path is kept as a real file whose body aliases the new module
via sys.modules[__name__] = <new module>, so old and new paths are the same
module object (imports, from-imports, and monkeypatching through old paths all
keep working). fprime.util keeps __main__.py and file_util.py as real modules;
fprime.fpp keeps utils/fpp_to_json and fprime.common is unchanged.

Internal src and test imports are rewritten to the new paths, except the
import-compat test which deliberately keeps importing the old paths and now
also asserts old-path/new-path module identity for every mapping row.

Entry points fprime.util.__main__:main and fprime.util.versioning:main are
unchanged; shipped cookiecutter hooks continue importing
fprime.util.cookiecutter_wrapper. No logic changes.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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