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

Skip check for source control integration if noSourceControl: true is set in config. #4767

Closed
wants to merge 4 commits into from

Conversation

Markionium
Copy link
Contributor

@Markionium Markionium commented Aug 11, 2024

This PR adds the option to add noSourceControl: true to the relay config which will skip the git status and sl --version commands when creating the configuration.

Those checks are run to help the compiler add/remove files from source control for you. However in cases where the generated files are not checked into source control this isn't helpful, especially when git status is "slow".

I noticed a significant decrease in performance between 16 and 17 when git status was introduced.

Another issue we have internally in Microsoft is that we use BuildXL in some of our repos, which distributes building of our packages. However it will not allow reads to undeclared dependencies, a git status check will break that "rule" as it read across the whole repo.

In the repo I work on we do not check in our artefacts and thus do not need source control integration.

@facebook-github-bot
Copy link
Contributor

@tyao1 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@tyao1
Copy link
Contributor

tyao1 commented Aug 12, 2024

For making it a config, you could add the config here:
https://github.com/facebook/relay/blob/main/compiler/crates/relay-compiler/src/config.rs

@Markionium Markionium changed the title Skip check for source control integration if --noSourceControl Skip check for source control integration if noSourceControl: true is set in config. Aug 12, 2024
@Markionium
Copy link
Contributor Author

Markionium commented Aug 12, 2024

@tyao1 Updated the PR, tested to make sure it works for both scenarios (Single and Multi project config files). I'm not sure if there any tests for this source control integration that I could have updated/added to?

[Edit]: I realized we can keep everything in config.rs now that we're making it a config. I'll update the PR tomorrow :)

@Markionium
Copy link
Contributor Author

@tyao1 should be good to go now!

Mark Polak and others added 3 commits August 13, 2024 18:38
This PR adds the option to pass `--noSourceControl` which will skip the `git status` and `sl --version` commands when creating the configuration.

Those checks are run to help the compiler add/remove files from source control for you.
However in cases where the generated files are not checked into source control this isn't helpful, especially when `git status` is "slow".

I noticed a significant decrease in performance between 16 and 17 when `git status` was introduced.
@facebook-github-bot
Copy link
Contributor

@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@captbaritone
Copy link
Contributor

Looks good!

@facebook-github-bot
Copy link
Contributor

@captbaritone merged this pull request in 4d140d2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants