Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: platformsh/platformify
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: platformsh/platformify
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: refactor/abstract-fs-2-fsys
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 4 commits
  • 38 files changed
  • 2 contributors

Commits on Mar 23, 2026

  1. refactor(registry): load runtime and service versions from JSON

    Replace hardcoded string constants for Runtime and ServiceName types
    with struct types loaded from an embedded registry.json file at init
    time. This makes it possible to update supported versions without
    code changes.
    
    - Add registry.go and registry.json (embedded JSON data for all
      runtimes and services with their supported versions)
    - Rewrite Runtime from string const to struct with Name, Type,
      Versions, Docs fields
    - Rewrite ServiceName from string const to struct with Name, Type,
      Versions, Disk, Docs fields
    - Update RuntimeForStack to look up runtimes by type string
    - Update all callers to use runtime.Type string comparisons instead
      of const equality
    - Remove version.go and generate_versions.go (superseded by registry)
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    2 people authored and pjcdawkins committed Mar 23, 2026
    Configuration menu
    Copy the full SHA
    409547d View commit details
    Browse the repository at this point in the history
  2. fix(registry): address review feedback

    - type.go: add nil check for Runtime in defer to prevent panic when
      RuntimeByTitle returns an error before Runtime is assigned
    - registry.go: sort Runtimes and ServiceNames after loading from the
      map to ensure deterministic ordering
    - runtime.go: move Locations field inside Web struct to match the JSON
      nesting (docs.web.locations)
    - service_name.go: add json tags for relationship_name and
      min_disk_size so they unmarshal correctly from snake_case JSON keys
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
    2 people authored and pjcdawkins committed Mar 23, 2026
    Configuration menu
    Copy the full SHA
    3933935 View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2026

  1. refactor(platformifier): use fs.FS and return file map

    Abstract the filesystem using Go's standard fs.FS interface and change
    Platformify() to return a map[string][]byte of generated files instead
    of writing them to disk. This enables callers (like source-integration-
    apps) to operate on in-memory filesystems and handle file output
    themselves.
    
    Changes:
    - internal/utils: all file functions take fs.FS as first parameter,
      use fs.WalkDir/fs.ReadFile instead of os equivalents
    - internal/question/models: WorkingDirectory becomes fs.FS, add Cwd
      string field for the OS path
    - internal/question/*: update all callers for new utils signatures
    - platformifier: interface returns (map[string][]byte, error),
      generic/django/laravel collect files in map instead of writing
    - platformifier: remove custom FS interface (fs.go), mock (fs_mock_test),
      mock generator (platformifier_mock_test), and nextjs platformifier
    - platformifier: adapt all tests to use fstest.MapFS and new interface
    - commands/platformify.go: write returned file map to disk
    - validator: use os.DirFS for FindAllFiles call
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    2 people authored and pjcdawkins committed Mar 24, 2026
    Configuration menu
    Copy the full SHA
    e25608a View commit details
    Browse the repository at this point in the history
  2. fix(platformifier): address review feedback

    - utils.go: use "/" instead of os.PathSeparator in FindFile sort,
      since fs.WalkDir always returns forward-slash paths
    - stack.go: fix keywords type assertion from []string to []any,
      since JSON arrays unmarshal as []any
    - laravel.go: return empty map instead of nil for consistency
      with other platformifiers
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
    2 people authored and pjcdawkins committed Mar 24, 2026
    Configuration menu
    Copy the full SHA
    ac58a58 View commit details
    Browse the repository at this point in the history
Loading