Skip to content

Commit c147b3d

Browse files
committed
Rename cleanup: Old "VFS4G" now "Scalar"
When doing the rename, I converted all instances of "VFS" to "Scalar" without first replacing the string "VFS4G". This left a bunch of "Scalar4G" instances around the codebase. Fix that using the same replace logic as before. Signed-off-by: Derrick Stolee <[email protected]>
1 parent 12cfb18 commit c147b3d

File tree

11 files changed

+31
-31
lines changed

11 files changed

+31
-31
lines changed

AuthoringTests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The functional tests are built on NUnit 3, which is available as a set of NuGet
3131

3232
**Option 2:** Run `Scripts\BuildScalarForWindows.bat` from the command line
3333

34-
2. Run the Scalar4G installer that was built in step 2. This will ensure that Scalar4G will be able to find the correct version of the pre/post-command hooks. The installer will be placed in `BuildOutput\Scalar.Installer.Windows\bin\x64\<Debug or Release>`
34+
2. Run the Scalar installer that was built in step 2. This will ensure that Scalar will be able to find the correct version of the pre/post-command hooks. The installer will be placed in `BuildOutput\Scalar.Installer.Windows\bin\x64\<Debug or Release>`
3535
3. Run the tests **with elevation**. Elevation is required because the functional tests create and delete a test service.
3636

3737
**Option 1:** Run the `Scalar.FunctionalTests.Windows` project from inside Visual Studio launched as Administrator.

CONTRIBUTING.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,23 @@ The design review process is as follows:
4545

4646
## Tracing and Logging
4747

48-
- *The "Error" logging level is reserved for non-retryable errors that result in I/O failures or the Scalar4G process shutting down*
48+
- *The "Error" logging level is reserved for non-retryable errors that result in I/O failures or the Scalar process shutting down*
4949

50-
The expectation from our customers is that when Scalar4G logs an "Error" level message in its log file either:
51-
* Scalar4G had to shut down unexpectedly
52-
* Scalar4G encountered an issue severe enough that user-initiated I/O would fail.
50+
The expectation from our customers is that when Scalar logs an "Error" level message in its log file either:
51+
* Scalar had to shut down unexpectedly
52+
* Scalar encountered an issue severe enough that user-initiated I/O would fail.
5353

5454
- *Log full exception stacks*
5555

5656
Full exception stacks (i.e. `Exception.ToString`) provide more details than the exception message alone (`Exception.Message`). Full exception stacks make root-causing issues easier.
5757

5858
- *Do not display full exception stacks to users*
5959

60-
Exception call stacks are not usually actionable for the user. Users frequently (sometimes incorrectly) assume that Scalar4G has crashed when shown a full stack. The full stack *should* be included in Scalar4G logs, but *should not* be displayed as part of the error message provided to the user.
60+
Exception call stacks are not usually actionable for the user. Users frequently (sometimes incorrectly) assume that Scalar has crashed when shown a full stack. The full stack *should* be included in Scalar logs, but *should not* be displayed as part of the error message provided to the user.
6161

6262
- *Include relevant details when logging exceptions*
6363

64-
Sometimes an exception call stack alone is not enough to root cause failures in Scalar4G. When catching (or throwing) exceptions, log relevant details that will help diagnose the issue. As a general rule, the closer an exception is caught to where it's thrown, the more relevant details there will be to log.
64+
Sometimes an exception call stack alone is not enough to root cause failures in Scalar. When catching (or throwing) exceptions, log relevant details that will help diagnose the issue. As a general rule, the closer an exception is caught to where it's thrown, the more relevant details there will be to log.
6565

6666
Example:
6767
```
@@ -78,9 +78,9 @@ The design review process is as follows:
7878

7979
## Error Handling
8080

81-
- *Fail fast: An error or exception that risks data loss or corruption should shut down Scalar4G immediately*
81+
- *Fail fast: An error or exception that risks data loss or corruption should shut down Scalar immediately*
8282

83-
Preventing data loss and repository corruption is critical. If an error or exception occurs that could lead to data loss, it's better to shut down Scalar4G than keep the repository mounted and risk corruption.
83+
Preventing data loss and repository corruption is critical. If an error or exception occurs that could lead to data loss, it's better to shut down Scalar than keep the repository mounted and risk corruption.
8484

8585
- *Do not catch exceptions that are indicative of a programmer error (e.g. `ArgumentNullException`)*
8686

@@ -90,7 +90,7 @@ The design review process is as follows:
9090

9191
- *Do not use exceptions for normal control flow*
9292

93-
Prefer writing code that does not throw exceptions. The `TryXXX` pattern, for example, avoids the performance costs that come with using exceptions. Additionally, Scalar4G typically needs to know exactly where errors occur and handle the errors there. The `TryXXX` pattern helps ensure errors are handled in that fashion.
93+
Prefer writing code that does not throw exceptions. The `TryXXX` pattern, for example, avoids the performance costs that come with using exceptions. Additionally, Scalar typically needs to know exactly where errors occur and handle the errors there. The `TryXXX` pattern helps ensure errors are handled in that fashion.
9494

9595
Example: Handle errors where they occur (good):
9696

@@ -171,36 +171,36 @@ The design review process is as follows:
171171

172172
- *Avoid using the thread pool (and avoid using async)*
173173

174-
`HttpRequestor.SendRequest` makes a [blocking call](https://github.com/Microsoft/Scalar/blob/4baa37df6bde2c9a9e1917fc7ce5debd653777c0/Scalar/Scalar.Common/Http/HttpRequestor.cs#L135) to `HttpClient.SendAsync`. That blocking call consumes a thread from the managed thread pool. Until that design changes, the rest of Scalar4G must avoid using the thread pool unless absolutely necessary. If the thread pool is required, any long running tasks should be moved to a separate thread managed by Scalar4G itself (see [GitMaintenanceQueue](https://github.com/Microsoft/Scalar/blob/4baa37df6bde2c9a9e1917fc7ce5debd653777c0/Scalar/Scalar.Common/Maintenance/GitMaintenanceQueue.cs#L19) for an example).
174+
`HttpRequestor.SendRequest` makes a [blocking call](https://github.com/Microsoft/Scalar/blob/4baa37df6bde2c9a9e1917fc7ce5debd653777c0/Scalar/Scalar.Common/Http/HttpRequestor.cs#L135) to `HttpClient.SendAsync`. That blocking call consumes a thread from the managed thread pool. Until that design changes, the rest of Scalar must avoid using the thread pool unless absolutely necessary. If the thread pool is required, any long running tasks should be moved to a separate thread managed by Scalar itself (see [GitMaintenanceQueue](https://github.com/Microsoft/Scalar/blob/4baa37df6bde2c9a9e1917fc7ce5debd653777c0/Scalar/Scalar.Common/Maintenance/GitMaintenanceQueue.cs#L19) for an example).
175175

176-
Long-running or blocking work scheduled on the managed thread pool can prevent the normal operation of Scalar4G. For example, it could prevent downloading file sizes, loose objects, or file contents in a timely fashion.
176+
Long-running or blocking work scheduled on the managed thread pool can prevent the normal operation of Scalar. For example, it could prevent downloading file sizes, loose objects, or file contents in a timely fashion.
177177

178178
- <a id="bgexceptions"></a>*Catch all exceptions on long-running tasks and background threads*
179179

180-
Wrap all code that runs in the background thread in a top-level `try/catch(Exception)`. Any exceptions caught by this handler should be logged, and then Scalar4G should be forced to terminate with `Environment.Exit`. It's not safe to allow Scalar4G to continue to run after an unhandled exception stops a background thread or long-running task. Testing has shown that `Environment.Exit` consistently terminates the Scalar4G mount process regardless of how background threads are started (e.g. native thread, `new Thread()`, `Task.Factory.StartNew()`).
180+
Wrap all code that runs in the background thread in a top-level `try/catch(Exception)`. Any exceptions caught by this handler should be logged, and then Scalar should be forced to terminate with `Environment.Exit`. It's not safe to allow Scalar to continue to run after an unhandled exception stops a background thread or long-running task. Testing has shown that `Environment.Exit` consistently terminates the Scalar mount process regardless of how background threads are started (e.g. native thread, `new Thread()`, `Task.Factory.StartNew()`).
181181

182182
An example of this pattern can be seen in [`BackgroundFileSystemTaskRunner.ProcessBackgroundTasks`](https://github.com/Microsoft/Scalar/blob/4baa37df6bde2c9a9e1917fc7ce5debd653777c0/Scalar/Scalar.Virtualization/Background/BackgroundFileSystemTaskRunner.cs#L233).
183183

184184
## Coding Conventions
185185

186186
- *Most C# coding style guidelines are covered by StyleCop*
187187

188-
Fix any StyleCop issues reported in changed code. When adding new projects to Scalar4G, be sure that StyleCop is analyzing them as part of the build.
188+
Fix any StyleCop issues reported in changed code. When adding new projects to Scalar, be sure that StyleCop is analyzing them as part of the build.
189189

190190
- *Prefer explicit types to interfaces and implicitly typed variables*
191191

192192
Avoid the use of `var` (C#), `dynamic` (C#), and `auto` (C++). Prefer concrete/explicit types to interfaces (e.g. prefer `List` to `IList`).
193193

194-
The Scalar4G codebase uses this approach because:
194+
The Scalar codebase uses this approach because:
195195

196196
* Interfaces can hide the performance characteristics of their underlying type. For example, an `IDictionary` could be a `SortedList` or a `Dictionary` (or several other data types).
197197
* Interfaces can hide the thread safety (or lack thereof) of their underlying type. For example, an `IDictionary` could be a `Dictionary` or a `ConcurrentDictionary`.
198198
* Explicit types make these performance and thread safety characteristics explicit when reviewing code.
199-
* Scalar4G is not a public API and its components are always shipped together. Develoepers are free to make API changes to Scalar4G's public methods.
199+
* Scalar is not a public API and its components are always shipped together. Develoepers are free to make API changes to Scalar's public methods.
200200

201201
- *Method names start with a verb (e.g. "GetProjectedFolderEntryData" rather than "ProjectedFolderEntryData")*
202202

203-
Starting with a verb in the name improves readability and helps ensure consistency with the rest of the Scalar4G codebase.
203+
Starting with a verb in the name improves readability and helps ensure consistency with the rest of the Scalar codebase.
204204

205205
- *Aim to write self-commenting code. When necessary, comments should give background needed to understand the code.*
206206

@@ -226,7 +226,7 @@ The design review process is as follows:
226226

227227
- *Add new interfaces when it makes sense for the product, not simply for unit testing*
228228

229-
When a class needs to be mocked (or have a subset of its behavior mocked), prefer using virtual methods instead of adding a new interface. Scalar4G uses interfaces when multiple implementations of the interface exist in the product code.
229+
When a class needs to be mocked (or have a subset of its behavior mocked), prefer using virtual methods instead of adding a new interface. Scalar uses interfaces when multiple implementations of the interface exist in the product code.
230230

231231
- *Check for `null` using the equality (`==`) and inequality (`!=`) operators rather than `is`*
232232

@@ -279,7 +279,7 @@ The design review process is as follows:
279279

280280
Comprehensive tests are essential for maintaining the health and quality of the product. For more details on writing tests see [Authoring Tests](https://github.com/Microsoft/Scalar/blob/master/AuthoringTests.md).
281281

282-
- *Functional tests are black-box tests and should not build against any Scalar4G product code*
282+
- *Functional tests are black-box tests and should not build against any Scalar product code*
283283

284284
Keeping the code separate helps ensure that bugs in the product code do not compromise the integrity of the functional tests.
285285

Protocol.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See Protocol.md in microsoft/vfsforgit.
1+
See Protocol.md in microsoft/vfsforgit.

Scalar.Common/ScalarPlatform.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ public static void Register(ScalarPlatform platform)
4545
/// This method should only be called by processes whose code we own as the background process must
4646
/// do some extra work after it starts.
4747
/// </remarks>
48-
public abstract void StartBackgroundScalar4GProcess(ITracer tracer, string programName, string[] args);
48+
public abstract void StartBackgroundScalarProcess(ITracer tracer, string programName, string[] args);
4949

5050
/// <summary>
5151
/// Adjusts the current process for running in the background.
5252
/// </summary>
5353
/// <remarks>
54-
/// This method should be called after starting by processes launched using <see cref="ScalarPlatform.StartBackgroundScalar4GProcess"/>
54+
/// This method should be called after starting by processes launched using <see cref="ScalarPlatform.StartBackgroundScalarProcess"/>
5555
/// </remarks>
5656
/// <exception cref="Win32Exception">
5757
/// Failed to prepare process to run in background.

Scalar.FunctionalTests/Tests/EnlistmentPerFixture/ScalarUpgradeReminderTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ public void NoReminderForLeftOverDownloads()
6666

6767
// This test should not use Nuget upgrader because it will usually find an upgrade
6868
// to download. The "None" ring config doesn't stop the Nuget upgrader from checking
69-
// its feed for updates, and the Scalar4G binaries installed during functional test
69+
// its feed for updates, and the Scalar binaries installed during functional test
7070
// runs typically have a 0.X version number (meaning there will always be a newer
71-
// version of Scalar4G available to download from the feed).
71+
// version of Scalar available to download from the feed).
7272
this.ReadNugetConfig(out string feedUrl, out string feedName);
7373
this.DeleteNugetConfig();
7474
this.VerifyUpgradeVerbStopsReminder();

Scalar.Mount/InProcessMountVerb.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void Execute()
8282
{
8383
if (this.StartedByVerb)
8484
{
85-
// If this process was started by a verb it means that StartBackgroundScalar4GProcess was used
85+
// If this process was started by a verb it means that StartBackgroundScalarProcess was used
8686
// and we should be running in the background. PrepareProcessToRunInBackground will perform
8787
// any platform specific preparation required to run as a background process.
8888
ScalarPlatform.Instance.PrepareProcessToRunInBackground();

Scalar.Platform.POSIX/POSIXPlatform.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public override void IsServiceInstalledAndRunning(string name, out bool installe
5353
throw new NotImplementedException();
5454
}
5555

56-
public override void StartBackgroundScalar4GProcess(ITracer tracer, string programName, string[] args)
56+
public override void StartBackgroundScalarProcess(ITracer tracer, string programName, string[] args)
5757
{
5858
string programArguments = string.Empty;
5959
try
@@ -75,7 +75,7 @@ public override void StartBackgroundScalar4GProcess(ITracer tracer, string progr
7575
// way to ensure they're properly closed.
7676
//
7777
// Note that this approach requires that the child process know that it needs to redirect its standard input/output to /dev/null and
78-
// so this method can only be used with Scalar4G processes that are aware they're being launched in the background
78+
// so this method can only be used with Scalar processes that are aware they're being launched in the background
7979
processInfo.RedirectStandardError = true;
8080
processInfo.RedirectStandardInput = true;
8181
processInfo.RedirectStandardOutput = true;

Scalar.Platform.Windows/WindowsPlatform.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public override string GetDataRootForScalarComponent(string componentName)
141141
return WindowsPlatform.GetDataRootForScalarComponentImplementation(componentName);
142142
}
143143

144-
public override void StartBackgroundScalar4GProcess(ITracer tracer, string programName, string[] args)
144+
public override void StartBackgroundScalarProcess(ITracer tracer, string programName, string[] args)
145145
{
146146
string programArguments = string.Empty;
147147
try

Scalar.Service/ScalarService.Windows.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ private void CreateAndConfigureProgramDataDirectories()
249249
Directory.CreateDirectory(this.serviceDataLocation, serviceDataRootSecurity);
250250
Directory.CreateDirectory(ProductUpgraderInfo.GetUpgradeProtectedDataDirectory(), serviceDataRootSecurity);
251251

252-
// Ensure the ACLs are set correctly on any files or directories that were already created (e.g. after upgrading Scalar4G)
252+
// Ensure the ACLs are set correctly on any files or directories that were already created (e.g. after upgrading Scalar)
253253
Directory.SetAccessControl(serviceDataRootPath, serviceDataRootSecurity);
254254

255255
// Special rules for the upgrader logs, as non-elevated users need to be be able to write

Scalar.UnitTests/Mock/Common/MockPlatform.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public override bool TryGetDefaultLocalCacheRoot(string enlistmentRoot, out stri
141141
throw new NotImplementedException();
142142
}
143143

144-
public override void StartBackgroundScalar4GProcess(ITracer tracer, string programName, string[] args)
144+
public override void StartBackgroundScalarProcess(ITracer tracer, string programName, string[] args)
145145
{
146146
throw new NotSupportedException();
147147
}

Scalar/CommandLine/MountVerb.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ private bool TryMount(ITracer tracer, ScalarEnlistment enlistment, string mountE
238238

239239
tracer.RelatedInfo($"{nameof(this.TryMount)}: Launching background process('{mountExecutableLocation}') for {enlistment.EnlistmentRoot}");
240240

241-
ScalarPlatform.Instance.StartBackgroundScalar4GProcess(
241+
ScalarPlatform.Instance.StartBackgroundScalarProcess(
242242
tracer,
243243
mountExecutableLocation,
244244
new[]

0 commit comments

Comments
 (0)