Skip to content

Clean up deprecated serialization API across F Prime codebase#1

Open
devin-ai-integration[bot] wants to merge 6 commits intodevelfrom
devin/1775079687-deprecated-serialization-cleanup
Open

Clean up deprecated serialization API across F Prime codebase#1
devin-ai-integration[bot] wants to merge 6 commits intodevelfrom
devin/1775079687-deprecated-serialization-cleanup

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot commented Apr 1, 2026

Related Issue(s) Cleanup of deprecated serialization API surface
Has Unit Tests (y/n) n (existing tests updated, no new tests)
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) y

Change Description

Removes all deprecated serialization API shims from the F Prime framework, completing the migration to the new method names. This was done in 5 phases:

Phase 1 – SerializeBufferBaseLinearBufferBase (~95 files)

  • Global rename of the type alias SerializeBufferBase to the canonical name LinearBufferBase in all .hpp and .cpp files (class inheritance, parameter types, comments).
  • Renamed test class SerializeBufferBaseTesterLinearBufferBaseTester.
  • Removed the using SerializeBufferBase = LinearBufferBase; alias from Fw/Types/Serializable.hpp.

Phase 2 – Deprecated accessor removal

  • Removed getBuffCapacity(), getBuffLength(), getBuffLeft() deprecated shim declarations and implementations from all buffer subclasses (DataBuffer, CmdArgBuffer, ComBuffer, LogBuffer, PrmBuffer, TlmBuffer, SmSignalBuffer, StatementArgBuffer, SerialBuffer, HashBuffer, FileBuffer) and from LinearBufferBase/ExternalSerializeBuffer in Serializable.hpp/.cpp.

Phase 3 – Deprecated serialize()/deserialize() shim removal

  • Removed ~60 deprecated serialize()/deserialize() wrapper methods from LinearBufferBase (declarations in Serializable.hpp, implementations in Serializable.cpp).
  • Removed deprecated serialize()/deserialize() inline methods from Serializable base class.
  • Removed deprecated serialize() inline methods from ConstStringBase.
  • No callers needed migration — all existing .serialize()/.deserialize() calls in the codebase are on CircularBuffer objects (which have their own non-deprecated API).

Phase 4 – getSerializeRepr() removal

  • Removed the deprecated getSerializeRepr() declaration from Fw::Buffer. No callers existed.

Phase 5 – Fw/Deprecate.hpp include removal

  • Removed #include "Fw/Deprecate.hpp" from Serializable.hpp since no DEPRECATED macros remain. The Fw/Deprecate.hpp file itself is preserved for downstream use.

Rationale

The deprecated API surface created maintenance burden and confusion. All callers had already been migrated to the new names (serializeFrom/deserializeTo, getCapacity/getSize/getDeserializeSizeLeft, getSerializer/getDeserializer), making the shims dead code ready for removal.

Testing/Review Recommendations

⚠️ Build and test verification was not completed locally. Reviewers should verify CI passes. Key areas to scrutinize:

  1. File rename: SerializeBufferBaseTester.hppLinearBufferBaseTester.hpp — verify CMakeLists/build references are updated.
  2. Type alias removal: Confirm no code outside this diff still references SerializeBufferBase. Generated/autocoded files may need regeneration.
  3. Fw/Deprecate.hpp include removal from Serializable.hpp: Any file that transitively relied on this include for its own DEPRECATED macros will now fail to compile. Verify no such files exist.
  4. CircularBuffer distinction (Phase 3): CircularBuffer::serialize() is intentionally not touched — it is a separate, non-deprecated API. Verify no LinearBufferBase-derived .serialize() calls were missed.
  5. m_serialize_repr member in Fw::Buffer: The deprecated getSerializeRepr() accessor was removed, but the underlying m_serialize_repr member is still used internally by Buffer.cpp constructors and setters — this is intentional and correct.

Future Work

  • Downstream/external projects using SerializeBufferBase, getBuffCapacity(), or the deprecated serialize()/deserialize() shims will need to update their code.
  • Consider removing the m_serialize_repr member from Fw::Buffer if it is no longer needed after getSerializeRepr() removal (it is currently still used internally).

AI Usage (see policy)

AI (Devin by Cognition) was used for the entire implementation: planning the phased approach, performing the global find-and-replace operations, analyzing call sites to distinguish CircularBuffer vs LinearBufferBase usage, removing deprecated declarations/implementations, and drafting this PR description.

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/f4fa8fb484cd4e59ad68cb2a7b6d4c78
Requested by: @jakexcosme


Open with Devin

jakexcosme and others added 5 commits April 1, 2026 21:46
- Global find-and-replace of SerializeBufferBase -> LinearBufferBase in ~95 .hpp/.cpp files
- Renamed SerializeBufferBaseTester class to LinearBufferBaseTester
- Removed the 'using SerializeBufferBase = LinearBufferBase' type alias from Serializable.hpp

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…accessors

- Removed deprecated getBuffCapacity() declarations from all buffer subclass headers
- Removed deprecated getBuffCapacity() implementations from all buffer subclass .cpp files
- Removed deprecated getBuffLength() and getBuffLeft() from LinearBufferBase in Serializable.hpp/cpp
- Removed deprecated getBuffCapacity() from ExternalSerializeBuffer in Serializable.hpp/cpp
- Removed deprecated getBuffCapacity() from ActiveComponentExitSerializableBuffer

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ferBase, Serializable, and ConstStringBase

- Removed deprecated serialize()/deserialize() methods from Serializable class (lines 76-84)
- Removed deprecated serialize()/deserialize() shim declarations for LinearBufferBase (lines 1082-1084, 1266-1319)
- Removed deprecated serialize()/deserialize() shim implementations from Serializable.cpp
- Removed deprecated serialize() methods from ConstStringBase (lines 75-83)
- No callers needed migration - all existing calls are on CircularBuffer (not deprecated)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Removed deprecated getSerializeRepr() declaration from Buffer.hpp
- No callers existed - all usage already migrated to getSerializer()/getDeserializer()

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- No DEPRECATED macros remain in Serializable.hpp after cleanup
- Fw/Deprecate.hpp file itself is preserved for downstream projects

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@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. Add '(aside)' to your comment to have me ignore it.
  • 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 and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

…r.hpp

- The class inside was renamed in Phase 1 but the file itself was not
- This caused a fatal include error in Fw/Buffer/test/ut/TestBuffer.cpp

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