Skip to content

refactor: use docker compose api for parsing#465

Open
lucarin91 wants to merge 4 commits into
arduino:mainfrom
lucarin91:provisoning-volume-with-docekr-api
Open

refactor: use docker compose api for parsing#465
lucarin91 wants to merge 4 commits into
arduino:mainfrom
lucarin91:provisoning-volume-with-docekr-api

Conversation

@lucarin91

@lucarin91 lucarin91 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Motivation

Remove manual Docker Compose parsing in multiple places

Change description

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.
@lucarin91 lucarin91 changed the title refactor: use docker compose api for pre-create volumes Jun 17, 2026
@lucarin91 lucarin91 marked this pull request as ready for review June 17, 2026 16:04
@lucarin91 lucarin91 requested review from Copilot and dido18 June 17, 2026 16:04
@lucarin91 lucarin91 force-pushed the provisoning-volume-with-docekr-api branch from bec037f to 791320b Compare June 23, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Docker Compose parsing in the orchestrator to rely on the official compose-go loader/types instead of manual YAML parsing and regex-based volume expansion, aiming to reduce duplicated parsing logic across the codebase.

Changes:

  • Switch service extraction to compose-go (loader.LoadWithContext) for reading service user/healthcheck metadata.
  • Switch volume provisioning to compose-go parsing of bind mounts (and simplify call sites/tests accordingly).
  • Switch brick compose port extraction to compose-go port types rather than string-splitting YAML.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
internal/orchestrator/provision.go Replaces manual compose parsing with compose-go for service metadata and volume provisioning.
internal/orchestrator/provision_test.go Updates tests to call volume provisioning directly (no separate volume extraction step).
internal/orchestrator/bricksindex/bricks_index.go Refactors port extraction from compose files to use compose-go loader/types.
Comments suppressed due to low confidence (2)

internal/orchestrator/provision.go:554

  • The comment above provisionComposeVolumes still claims volumes are "manually" parsed, but the implementation now uses compose-go. This is misleading documentation and also has a couple grammar issues ("ourself").
	}
	if e := writeOverrideCompose(); e != nil {
		return e
	}

internal/orchestrator/bricksindex/bricks_index.go:277

  • loader.LoadWithContext is called without Filename/WorkingDir. If brick compose files use relative paths or compose features that rely on the file location, port extraction can fail or behave inconsistently depending on the CLI working directory.
	if err != nil {
		return nil, err
	}


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/orchestrator/provision.go
Comment thread internal/orchestrator/provision.go
Comment thread internal/orchestrator/provision.go
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@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

2 participants