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(fluid-build): Parse build-cli tasks properly in fluid-build #12988

Merged
merged 2 commits into from
Nov 17, 2022

Conversation

tylerbutler
Copy link
Member

@tylerbutler tylerbutler commented Nov 17, 2022

The new build-cli requires a bit more parsing to decompose the task into fluid-build's build graph. This change updates the parsing method to handle flub correctly.

The former implementation assumed that the command executable was the first argument of the command, but that doesn't hold for commands with subcommands.

The changed implementation assumes flags come at the end of the command, and that all subsequent arguments are flags. All non-flag arguments are then assumed to be the executable name. This is true for most of the commands today (and all of the ones that fluid-build needs to understand), but it is somewhat fragile.

@github-actions github-actions bot added the base: main PRs targeted against main branch label Nov 17, 2022
@tylerbutler tylerbutler marked this pull request as ready for review November 17, 2022 01:55
@tylerbutler tylerbutler requested a review from a team as a code owner November 17, 2022 01:55
Comment on lines +19 to +23
toReturn = commands.slice(0, flagsStartIndex).join(" ");
} else {
toReturn = commands[0];
}
return toReturn;
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
toReturn = commands.slice(0, flagsStartIndex).join(" ");
} else {
toReturn = commands[0];
}
return toReturn;
return commands.slice(0, flagsStartIndex).join(" ");
} else {
return commands[0];
}

Is this "better" in some objective way? Or is it just stylistic preferences?

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the modified way as it eliminates variable declaration 😄

@tylerbutler tylerbutler merged commit 2217e3d into microsoft:main Nov 17, 2022
@tylerbutler tylerbutler deleted the fluid-build-parsing branch November 17, 2022 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants