Skip to content

feat: Switch from 'country' to 'location'#421

Open
craciunoiuc wants to merge 1 commit into
prod-stagingfrom
craciunoiuc/country-to-iata
Open

feat: Switch from 'country' to 'location'#421
craciunoiuc wants to merge 1 commit into
prod-stagingfrom
craciunoiuc/country-to-iata

Conversation

@craciunoiuc

@craciunoiuc craciunoiuc commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Use the 'x/iata' package for this.

Closes: TOOL-1150

Use the 'x/iata' package for this.

Signed-off-by: Cezar Craciunoiu <cezar@unikraft.io>

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the CLI’s metro configuration and presentation to use an IATA-based location field instead of country, aligning metro metadata with the unikraft.com/x/iata package and propagating the rename through config parsing, CLI resources, tests, and CI.

Changes:

  • Replace metro country with location across config models and CLI resource output.
  • Normalize metro IATA codes when fetching metros from the control plane using unikraft.com/x/iata.
  • Update unit/golden help fixtures and GitHub Actions integration config to use location.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/multimetro/client.go Switches fetched metro metadata to populate Location and normalizes via x/iata.
internal/integration/config.go Updates integration config shaping to set Metro.Location.
internal/config/profile.go Renames the persisted metro field from Country to Location in the profile schema.
internal/config/config_test.go Adds coverage around parsing location, missing location, and legacy country behavior.
internal/cmd/metros.go Updates the metro resource fields/output to expose location instead of country.
go.mod Adds dependency on unikraft.com/x/iata.
go.sum Adds checksums for unikraft.com/x/iata.
cmd/unikraft/testdata/TestHelp/config Updates golden help output field list from country to location.
cmd/unikraft/testdata/TestHelp/auth Updates golden help output field list from country to location.
.github/workflows/test.yaml Updates generated integration config snippets to use location.

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

Comment on lines +159 to +160
// Location is the IATA code for where the metro is located.
Location string `json:"location" field:",short"`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jedevc We should discuss this:

Currently if no location is set the column will just not appear, so basically on output the metros will just not show the country anymore

Alternative to this is to support both for a while, but it's such a small change I'm not sure it makes sense to do

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