feat: Switch from 'country' to 'location'#421
Conversation
Use the 'x/iata' package for this. Signed-off-by: Cezar Craciunoiu <cezar@unikraft.io>
There was a problem hiding this comment.
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
countrywithlocationacross 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.
| // Location is the IATA code for where the metro is located. | ||
| Location string `json:"location" field:",short"` |
There was a problem hiding this comment.
@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
Use the 'x/iata' package for this.
Closes: TOOL-1150