Skip to content

Fix failing Go tests#950

Merged
leecalcote merged 1 commit intomasterfrom
copilot/fix-failing-go-tests
Mar 19, 2026
Merged

Fix failing Go tests#950
leecalcote merged 1 commit intomasterfrom
copilot/fix-failing-go-tests

Conversation

@fitzergerald
Copy link
Copy Markdown
Member

Summary

This PR fixes the failing Go test suite by aligning MeshKit with current schema/API changes and refreshing stale test fixtures.

Changes

  • update schema field usage from Id to ID in orchestration and policy code
  • restore keywordFromLocation for schema tests
  • update registry component handling for the current schema types and YAML-based component schema defaults
  • refresh design fixtures to use null for zero timestamp fields
  • replace the stale GitHub test URL with a live fixture source

Verification

  • go test ./...
  • make test

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>
Copilot AI review requested due to automatic review settings March 19, 2026 06:38
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Schema Field Usage Update: Updated schema field usage from Id to ID in orchestration and policy code to align with current API changes.
  • Schema Test Utility Restoration: Restored the keywordFromLocation utility function, essential for correct schema processing in tests.
  • Design Fixture Refresh: Refreshed design test fixtures to correctly represent zero timestamp fields as null instead of 0001-01-01T00:00:00Z.
  • Registry Component Handling Alignment: Updated the registry component handling to align with current schema types and to correctly process YAML-based component schema defaults.
  • GitHub Test URL Update: Replaced a stale GitHub test URL with a live fixture source to ensure test reliability.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 ID instead of Id for component identifiers.
  • Restore keywordFromLocation helper 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.

Comment on lines 41 to 45
{ // 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",
},
@leecalcote leecalcote merged commit 94b2e8f into master Mar 19, 2026
5 of 7 checks passed
@leecalcote leecalcote deleted the copilot/fix-failing-go-tests branch March 19, 2026 06:46
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.

4 participants