Conversation
Align Meshery schema field usage, restore schema helper coverage, and refresh stale test fixtures and URLs so the Go test suite passes again. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on resolving failing Go tests by bringing MeshKit into alignment with recent schema and API updates. The changes encompass correcting field names, re-enabling a crucial schema processing utility, and updating outdated test data to ensure the test suite executes successfully and accurately reflects current system behavior. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request standardizes the representation of empty date-time fields in YAML test files from zero-value timestamps to null. It updates a GitHub package generation test case from k8s-config-connector to gateway-api. Code changes include minor formatting, updating component ID field access from Id to ID, adding null checks for the Log object before error logging, refactoring schema types for component styles, and switching schema file processing from JSON to YAML with a generic unmarshalling function. Additionally, a new utility function keywordFromLocation was added to extract and unescape JSON Pointer segments for improved schema processing.
There was a problem hiding this comment.
Pull request overview
This PR updates MeshKit to align with recent schema/API changes and refreshes test fixtures so the Go test suite passes again.
Changes:
- Update code paths to use
IDinstead ofIdfor component identifiers. - Restore
keywordFromLocationhelper for schema/compiler tests. - Refresh registry/component schema handling (YAML-based schema defaults) and update several test fixtures (timestamps and OCI design sample), plus a GitHub generator test URL.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
schema/compiler.go |
Reintroduces keywordFromLocation for schema error/location parsing tests. |
registry/component.go |
Updates capability defaults extraction to use YAML schema and adjusts schema/core type usage; adds safer logging around capability parsing. |
orchestration/design.go |
Switches component ID usage from Id to ID when enriching metadata. |
models/meshmodel/core/policies/rego_policy_relationship.go |
Updates component ID comparison to ID and minor formatting fixes. |
generators/github/package_test.go |
Replaces a stale GitHub raw URL fixture with a new one for generation tests. |
files/tests/samples/valid_design.yml |
Updates zero timestamp fields to null in the design fixture. |
files/tests/samples/valid-design-oci.tar |
Adds an OCI-packaged design fixture for sanitization/type detection tests. |
converter/tests/samples/edge-firewall-relationship.yml |
Updates zero timestamp fields to null across the fixture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| { // Source pointing to a directly downloadable file (not a repo per se) | ||
| ghPackageManager: GitHubPackageManager{ | ||
| PackageName: "k8s-config-connector", | ||
| SourceURL: "https://raw.githubusercontent.com/GoogleCloudPlatform/k8s-config-connector/master/crds/alloydb_v1beta1_alloydbbackup.yaml", | ||
| PackageName: "gateway-api", | ||
| SourceURL: "https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/main/config/crd/standard/gateway.networking.k8s.io_gatewayclasses.yaml", | ||
| }, |
Summary
This PR fixes the failing Go test suite by aligning MeshKit with current schema/API changes and refreshing stale test fixtures.
Changes
IdtoIDin orchestration and policy codekeywordFromLocationfor schema testsnullfor zero timestamp fieldsVerification
go test ./...make test