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

Eventgrid arm package is not packaged due to matching service and dat… #14301

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .scripts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,31 @@ function isPackageFolderPath(folderPath: string, packagesToIgnore: string[]): bo
return result;
}

function shouldProcessFolderPath(folderPath: string, folderNamesToIgnore: string[]): boolean {
if (!contains(folderNamesToIgnore, getName(folderPath))) {
Copy link
Member

@HarshaNalluru HarshaNalluru Mar 19, 2021

Choose a reason for hiding this comment

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

It looks harder to understand.
Would it help better if you add a comment above with an example?
Such as..

folderNamesToIgnore = [ "service-bus", "eventgrid", ... ]; // Coming from /sdk/service/<service-sdk-name> 
folderPath = "..../sdk/servicebus/service-bus"
getName(folderPath) = "service-bus" 

Copy link
Member

Choose a reason for hiding this comment

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

Similarly, at other places too.

// If current path is not in folder to ignore list then process it.
return true;
Comment on lines +116 to +118
Copy link
Member

Choose a reason for hiding this comment

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

I think this returns true for the track 1 perf test packages since it isn't a rush package.
Track 1 perf test packages should also be ignored.
Logged a new issue to handle this case #14304.

Copy link
Member Author

Choose a reason for hiding this comment

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

@HarshaNalluru : Do we need any more change in this PR or is it good to merge?

Copy link
Member

Choose a reason for hiding this comment

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

This looks good. (perf track 1 can be handled in a separate PR.)

But I think if you can elaborate in comments with examples on what gets filtered at each step, it would help a lot.

}

// if current folder name is in folder to ignore list then make sure this path is package root path
// eventgrid service name and dataplane package name are same and it is added in ignore list
// So this causes an issue to skip processing eventgrid service folder itself
const packageJsonFilePath: string = joinPath(folderPath, "package.json");
if (!fileExistsSync(packageJsonFilePath)) {
return true;
}

// Skip current path since it is package root path and also added in ignore folder list
return false;
}

export const packagesToIgnore: string[] = generateDataplaneList().packageList;
export var folderNamesToIgnore: string[] = generateDataplaneList().folderList;
folderNamesToIgnore.push("node_modules");

export function getPackageFolderPaths(packagesFolderPath: string): string[] | undefined {
return getChildFolderPaths(packagesFolderPath, {
recursive: true,
condition: (folderPath: string) => isPackageFolderPath(folderPath, packagesToIgnore),
folderCondition: (folderPath: string) => !contains(folderNamesToIgnore, getName(folderPath))
folderCondition: (folderPath: string) => shouldProcessFolderPath(folderPath, folderNamesToIgnore)
});
}