Skip to content

chore: update compose-go (and yaml)#1933

Merged
lionello merged 3 commits intomainfrom
lio/update-compose-go
Feb 17, 2026
Merged

chore: update compose-go (and yaml)#1933
lionello merged 3 commits intomainfrom
lio/update-compose-go

Conversation

@lionello
Copy link
Member

@lionello lionello commented Feb 16, 2026

Description

They changed the model runner syntax slightly, reflected in our models test.

Linked Issues

Checklist

  • I have performed a self-review of my code
  • I have added appropriate tests
  • I have updated the Defang CLI docs and/or README to reflect my changes, if necessary

Summary by CodeRabbit

  • Chores

    • Updated YAML library from v3 to v4 across the codebase
    • Upgraded compose-go to v2.10.1
    • Updated vendor hash for a build dependency
  • Tests

    • Adjusted compose test fixtures: service entries restructured/renamed and warnings updated
    • Removed INF/NAN special-value cases from YAML tests

@lionello lionello requested review from edwardrf and removed request for jordanstephens February 16, 2026 23:22
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Upgrade Compose and YAML dependencies (compose-go/v2 → v2.10.1; go.yaml.in/yaml v3 → v4) across the repo, update YAML imports, adjust compose marshal tests (remove INF/NAN), and reshape model-related testdata and golden/warnings files; update Nix vendor hash.

Changes

Cohort / File(s) Summary
Go module & deps
src/go.mod
Bumped compose-go/v2 to v2.10.1; migrated YAML dependency to go.yaml.in/yaml v4; adjusted direct/indirect dependency entries.
Core YAML imports
src/pkg/cli/common.go, src/pkg/cli/compose/loader.go, src/pkg/cli/compose/marshal.go, src/pkg/migrate/migrate.go
Replaced go.yaml.in/yaml/v3 imports with go.yaml.in/yaml/v4.
CLI BYOC YAML import
src/pkg/cli/client/byoc/gcp/byoc.go
Updated YAML import from v3 → v4.
Cloud provider YAML usage (incl. tests)
src/pkg/clouds/gcp/cloudbuild.go, src/pkg/clouds/aws/ecs/cfn/template_test.go
Switched YAML imports (replaced prior libs/v3) to go.yaml.in/yaml/v4.
Compose tests & marshal behavior
src/pkg/cli/compose/load_content_test.go, src/pkg/cli/compose/marshal_test.go
Changed TestRoundTrip argument value; removed INF/NAN scalar cases from marshal test input/expected output.
Models testdata & fixtures
src/testdata/models/compose.yaml, .../compose.yaml.fixup, .../compose.yaml.golden, .../compose.yaml.warnings
Restructured services: appmodellist/modelmap, changed ai_model: {}ai_model: null, added x-defang-llm and network entries; updated golden and warnings accordingly.
Nix vendor hash
pkgs/defang/cli.nix
Updated vendorHash value only.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

go

Suggested reviewers

  • jordanstephens

Poem

🐰 I hopped through imports, swapped v3 for v4,
Nulls took the place of braces, models split to more,
Tests shed odd infinities, hashes got a tune,
A little rabbit flourish — dependencies in bloom! 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: update compose-go (and yaml)' directly and concisely summarizes the main changes: upgrading compose-go and YAML library dependencies across the codebase.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lio/update-compose-go

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

level=warning msg="[linters_context] running gomodguard failed: unable to read module file go.mod: current working directory must have a go.mod file: if you are not using go modules it is suggested to disable this linter"
level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
Verify each finding against the current code and only fix it if needed.


In `@src/go.mod`:
- Line 63: The go.mod entry currently pins the YAML module to the pre-release
version "go.yaml.in/yaml/v4 v4.0.0-rc.3"; update this dependency to either the
newer release candidate "v4.0.0-rc.4" or roll back to the latest stable v3
release depending on project policy. Locate the module line for
go.yaml.in/yaml/v4 in go.mod and change the version token from v4.0.0-rc.3 to
v4.0.0-rc.4 (or to the chosen v3 version), then run `go get`/`go mod tidy` to
refresh the lockfile and ensure builds pass.

@lionello lionello merged commit 2419d3f into main Feb 17, 2026
4 of 5 checks passed
@lionello lionello deleted the lio/update-compose-go branch February 17, 2026 23:00
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.

2 participants

Comments