feat: COBOL-to-Java Spring Boot migration (5 phases)#71
Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
feat: COBOL-to-Java Spring Boot migration (5 phases)#71devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
Phase 1: Spring Boot 3.2.4 project with Gradle, Java 17+ Phase 2: JPA entity, repository, DB migration for Account CRUD Phase 3: AccountService, StringUtils, NumericUtils, FileMergeService, SubProgramService Phase 4: JSON (Jackson), XML (JAXB), Report generation services Phase 5: CLI menu, CommandLineArgs, REST API controller - 41 tests passing (unit + integration) - H2 in-memory DB for tests, PostgreSQL for production - Comprehensive README.md and MIGRATION_NOTES.md - All Java classes include Javadoc referencing original COBOL sources - No COBOL files modified or deleted Co-Authored-By: Jerry Oliphant <jerry.oliphant@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Add application-h2.properties with H2 in-memory DB config - Add data-h2.sql with 11 seed records matching COBOL create_test_db.sql - Add H2 as runtimeOnly dependency for non-test profiles - Run locally with: ./gradlew bootRun --args='--spring.profiles.active=h2' Co-Authored-By: Jerry Oliphant <jerry.oliphant@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a complete Java Spring Boot migration of the COBOL-Examples codebase under a new
java-migration/directory. No existing COBOL files are modified. The migration covers 18 COBOL modules across 5 phases:Accountentity +AccountRepositoryreplacing 3 COBOL SQL cursors, with Flyway-style migration SQLAccountService,StringUtils,NumericUtils,FileMergeService,SubProgramService— business logic, string/numeric ops, file SORT/MERGE, and CALL BY CONTENT/REFERENCE patternsRecordDto/RecordXmlDtoDTOs with Jackson/JAXB annotations,JsonService,XmlService,ReportServicefor JSON GENERATE, XML GENERATE, and Report Writer replacementsAccountCli(Scanner menu),CommandLineArgsRunner,AccountController(REST API)78 test methods pass across 10 test classes (unit + integration) using H2 in PostgreSQL compatibility mode. Documentation includes
README.md(module mapping table, API docs) andMIGRATION_NOTES.md(type translations, cursor mappings, design decisions).Updates since last revision
application-h2.propertiesprofile anddata-h2.sqlseed data for running the app locally without PostgreSQLruntimeOnlydependency (previously test-only) to support theh2profileGET /accounts→ 11 seed accounts returned correctlyGET /accounts/disabled→ 3 disabled accounts (Bob, Paula, Bill)GET /accounts/search?q=Tester1→ 2 matches (Mike/Tester1, Richard/Tester10)Review & Testing Checklist for Human
CustomerRecord.fromFixedWidth()andStudentRecord.fromFixedWidth()— verify substring positions match the actual COBOL FD record layouts inmerge_sort/merge_sort_test.cblandreport_writer/report_test.cbl. These were not validated against real fixed-width input files.V1__create_accounts_table.sql) — verify the schema and 11 seed rows match the originalsql/create_test_db.sql. Column types, nullable constraints, and default values should be compared side-by-side. Note thatdata-h2.sqlduplicates the INSERT statements and could drift.AccountRepository.searchAccounts@Query— only tested against H2, not real PostgreSQL. The LIKE query across 4 columns should be validated against the actualcobol_db_exampledatabase.spring.datasource.password=passwordinapplication.properties— acceptable for a demo project but worth flagging.Recommended test plan: Clone the branch, then:
cd java-migration && ./gradlew test— confirm all 78 test methods pass./gradlew bootRun --args='--spring.profiles.active=h2'— start with H2 (no PostgreSQL needed)curl http://localhost:8080/accounts— verify 11 JSON accounts returnedcobol_db_exampledatabase, then./gradlew bootRun(default profile)Notes
AccountCliuses@Profile("cli")— confirmed it does NOT block the REST server in default modeBigDecimalused throughout for numeric precision (mirrors COBOL packed decimal behavior)SubProgramService.MutableStringinner class models COBOL CALL BY REFERENCE — non-standard Java pattern, but faithful to COBOL semantics@XmlAttributefor theenabledfield and null-suppression for blank fields replicate COBOLTYPE IS ATTRIBUTEandSUPPRESS WHEN SPACESView original video (rec-984cf386c2d94bd78ad06a29ef32b86e-edited.mp4)
Link to Devin session: https://app.devin.ai/sessions/6c03a93e63e24ca0a8feb138f0e525b9
Requested by: @jerryoliphant-cog