Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix importing nested model files #1548

Merged
merged 7 commits into from
May 22, 2023
Merged

Fix importing nested model files #1548

merged 7 commits into from
May 22, 2023

Conversation

rkodev
Copy link
Contributor

@rkodev rkodev commented May 11, 2023

Overview

Fixes import statements for go imports in nested builder folders
Fixes microsoftgraph/msgraph-sdk-go#474

Demo

E.g creating worklow https://learn.microsoft.com/en-us/graph/api/identitygovernance-lifecycleworkflowscontainer-post-workflows?view=graph-rest-beta&tabs=go

Current

import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models//identityGovernance"
//other-imports
)

Fix

import (
	  "context"
	  abstractions "github.com/microsoft/kiota-abstractions-go"
	  msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
	  graphidentitygovernance "github.com/microsoftgraph/msgraph-beta-sdk-go/identitygovernance"
	  //other-imports
)

Testing Instructions

Added unit tests

public HashSet<String> GetReferencedNamespaces(Boolean shimmedMePackage = false)
{

HashSet<String> result = new HashSet<string>();
Copy link
Member

Choose a reason for hiding this comment

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

Does casing matter here?

Copy link
Member

Choose a reason for hiding this comment

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

If it doesn't, you can prevent potential duplicate entries due to different casing

HashSet<String> result = new HashSet<string>(StringComparer.OrdinalIgnoreCase);

@baywet baywet self-requested a review May 16, 2023 16:12
baywet
baywet previously approved these changes May 16, 2023
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

approving to avoid blocking this PR while I'm gone but I haven't had time to review the latest changes. Please have somebody else review it

public HashSet<String> GetReferencedNamespaces(Boolean shimmedMePackage = false)
{

HashSet<String> result = new HashSet<string>();
Copy link
Member

Choose a reason for hiding this comment

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

If it doesn't, you can prevent potential duplicate entries due to different casing

HashSet<String> result = new HashSet<string>(StringComparer.OrdinalIgnoreCase);

@rkodev rkodev requested a review from a team as a code owner May 22, 2023 09:58
@rkodev rkodev enabled auto-merge (squash) May 22, 2023 10:00
@sonarcloud
Copy link

sonarcloud bot commented May 22, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

87.5% 87.5% Coverage
0.0% 0.0% Duplication

@rkodev rkodev merged commit 4738af2 into dev May 22, 2023
8 checks passed
@rkodev rkodev deleted the fix/go-statements branch May 22, 2023 10:04
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.

Application Registration and setting the secret
3 participants