Skip to content

COBOL -> Java: YAML target config, read by GitGalaxy's own YAML reader (#3613) - #3628

Merged
squid-protocol merged 2 commits into
mainfrom
feat/java-target-config
Sep 25, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
feat/java-target-config

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

The Java generator hardcoded Spring Boot 3.2.4, Java 17, Maven, PostgreSQL,
Lombok, JPA and Spring Batch; only --pkg / --header were options. Now a YAML
(or JSON) config chooses the target:

cobol-to-java --init-config modernize.yaml     # annotated defaults
cobol-to-java <staging dir> --config modernize.yaml
  • project: package, group_id, artifact_id, version, description, header_file
  • java: version (17 | 21), build_tool (maven | gradle), data_classes
    (lombok | plain -- explicit constructors / getters / setters), dto_style
    (class | record)
  • spring_boot: version (3.x.y)
  • database: engine (postgresql | db2 | oracle | mysql | h2: driver, dialect,
    URL), ddl_auto, credentials, show_sql
  • features: rest_controllers, services, batch, ebcdic_decoder, mock_services,
    agent_tickets

Every key is validated (unknown keys, unsupported values, and controllers
without services are errors naming the key). CLI flags beat the file, the file
beats the defaults. Without --config the output is byte-identical: the
refraction snapshot shows 0 files differing on all six corpora.

gitgalaxy/standards/yaml_reader.py: GitGalaxy's own strict YAML reader -- no
PyYAML. It reads the configuration subset (block mappings / sequences, flow
sequences, the YAML 1.2 core scalars, quotes, comments) and rejects the rest
(anchors, tags, block scalars, flow mappings, multi-document, tabs, duplicate
keys) with an error naming the line. Checked against PyYAML where installed.

tests/tools/java_target_matrix.py generates CardDemo under 13 configs and runs
the real build: Java 17 / 21, Maven / Gradle, Lombok / plain / records, Boot
3.2 / 3.3, all five databases, a minimal feature set -- 13/13 compile. (The
runner #3121 can put in CI.)

Closes #3613

Verification

  • Compile matrix (JDK 17 + Temurin 21, Maven 3.8, Gradle 8.10): 13/13 PASS on CardDemo.
  • refraction_snapshot check: 0 differ on all six corpora (default output unchanged).
  • New tests: test_yaml_reader.py (19), test_java_target.py (16). Full suite 11,536 passed; ruff (incl. py39 syntax) / mypy / dead-key audits clean.

Part of epic #3625.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

…der (#3613)

The Java generator hardcoded Spring Boot 3.2.4, Java 17, Maven, PostgreSQL,
Lombok, JPA and Spring Batch; only --pkg / --header were options. Now a YAML
(or JSON) config chooses the target:

    cobol-to-java --init-config modernize.yaml     # annotated defaults
    cobol-to-java <staging dir> --config modernize.yaml

- project: package, group_id, artifact_id, version, description, header_file
- java: version (17 | 21), build_tool (maven | gradle), data_classes
  (lombok | plain -- explicit constructors / getters / setters), dto_style
  (class | record)
- spring_boot: version (3.x.y)
- database: engine (postgresql | db2 | oracle | mysql | h2: driver, dialect,
  URL), ddl_auto, credentials, show_sql
- features: rest_controllers, services, batch, ebcdic_decoder, mock_services,
  agent_tickets

Every key is validated (unknown keys, unsupported values, and controllers
without services are errors naming the key). CLI flags beat the file, the file
beats the defaults. Without --config the output is byte-identical: the
refraction snapshot shows 0 files differing on all six corpora.

gitgalaxy/standards/yaml_reader.py: GitGalaxy's own strict YAML reader -- no
PyYAML. It reads the configuration subset (block mappings / sequences, flow
sequences, the YAML 1.2 core scalars, quotes, comments) and rejects the rest
(anchors, tags, block scalars, flow mappings, multi-document, tabs, duplicate
keys) with an error naming the line. Checked against PyYAML where installed.

tests/tools/java_target_matrix.py generates CardDemo under 13 configs and runs
the real build: Java 17 / 21, Maven / Gradle, Lombok / plain / records, Boot
3.2 / 3.3, all five databases, a minimal feature set -- 13/13 compile. (The
runner #3121 can put in CI.)

Closes #3613

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

…torage)

CodeQL flagged database.password flowing from the config into the generated
application.yml as clear text. A config is stored with the project, so it
must not carry a password at all: the key is gone (a config that sets
database.password is rejected with that reason), and the generated
application.yml keeps its historic placeholder, to be overridden by
SPRING_DATASOURCE_PASSWORD at runtime. Default output stays byte-identical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@squid-protocol
squid-protocol merged commit d7b31ba into main Sep 25, 2026
31 checks passed
@squid-protocol
squid-protocol deleted the feat/java-target-config branch September 25, 2026 15:12
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.

Java conversion: YAML target config (Java / Spring Boot versions, build tool, DTO style, database, features)

1 participant