Skip to content

Commit de5a534

Browse files
DavidS-ovmactions-user
authored andcommitted
Eng 3140 phase 1 single adapter integration test pr (#4281)
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Adds a new Azure discovery adapter and wires it into global adapter registration, which can affect runtime discovery behavior and linked-item traversal. Also introduces a new Azure integration test that provisions real resources, increasing CI/config sensitivity if enabled. > > **Overview** > Adds support for Azure Private DNS Zone Virtual Network Links via a new `NetworkDNSVirtualNetworkLink` SearchableWrapper, including linked-item queries to the parent private DNS zone and the referenced virtual network (with cross-resource-group scope extraction). > > Registers the new adapter in `manual/adapters.go`, adds a thin `VirtualNetworkLinksClient` interface + generated mock, and updates `shared/utils.go` resource-ID path key mapping for this new type. > > Adds both unit tests and a full Azure integration test that provisions a VNet, private DNS zone, and virtual network link, then validates `Get`/`Search`, item attributes, and linked-item queries. Updates the adapter-creation skill docs to require bidirectional parent/child SEARCH links and to include integration test guidance. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b25ff898296056b50fc9562b4f7e7838b27fe2e8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> GitOrigin-RevId: 8865f06c70fba163edfa433bc7a66c8baa166ddb
1 parent 03eb745 commit de5a534

7 files changed

Lines changed: 1127 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package clients
2+
3+
import (
4+
"context"
5+
6+
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
7+
)
8+
9+
//go:generate mockgen -destination=../shared/mocks/mock_virtual_network_links_client.go -package=mocks -source=virtual-network-links-client.go
10+
11+
type VirtualNetworkLinksPager = Pager[armprivatedns.VirtualNetworkLinksClientListResponse]
12+
13+
type VirtualNetworkLinksClient interface {
14+
NewListPager(resourceGroupName string, privateZoneName string, options *armprivatedns.VirtualNetworkLinksClientListOptions) VirtualNetworkLinksPager
15+
Get(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, options *armprivatedns.VirtualNetworkLinksClientGetOptions) (armprivatedns.VirtualNetworkLinksClientGetResponse, error)
16+
}
17+
18+
type virtualNetworkLinksClient struct {
19+
client *armprivatedns.VirtualNetworkLinksClient
20+
}
21+
22+
func (c *virtualNetworkLinksClient) NewListPager(resourceGroupName string, privateZoneName string, options *armprivatedns.VirtualNetworkLinksClientListOptions) VirtualNetworkLinksPager {
23+
return c.client.NewListPager(resourceGroupName, privateZoneName, options)
24+
}
25+
26+
func (c *virtualNetworkLinksClient) Get(ctx context.Context, resourceGroupName string, privateZoneName string, virtualNetworkLinkName string, options *armprivatedns.VirtualNetworkLinksClientGetOptions) (armprivatedns.VirtualNetworkLinksClientGetResponse, error) {
27+
return c.client.Get(ctx, resourceGroupName, privateZoneName, virtualNetworkLinkName, options)
28+
}
29+
30+
func NewVirtualNetworkLinksClient(client *armprivatedns.VirtualNetworkLinksClient) VirtualNetworkLinksClient {
31+
return &virtualNetworkLinksClient{client: client}
32+
}

0 commit comments

Comments
 (0)