You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
Copy file name to clipboardExpand all lines: AuthoringTests.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ The functional tests are built on NUnit 3, which is available as a set of NuGet
31
31
32
32
**Option 2:** Run `Scripts\BuildScalarForWindows.bat` from the command line
33
33
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>`
35
35
3. Run the tests **with elevation**. Elevation is required because the functional tests create and delete a test service.
36
36
37
37
**Option 1:** Run the `Scalar.FunctionalTests.Windows` project from inside Visual Studio launched as Administrator.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+18-18
Original file line number
Diff line number
Diff line change
@@ -45,23 +45,23 @@ The design review process is as follows:
45
45
46
46
## Tracing and Logging
47
47
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*
49
49
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.
53
53
54
54
-*Log full exception stacks*
55
55
56
56
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.
57
57
58
58
-*Do not display full exception stacks to users*
59
59
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.
61
61
62
62
-*Include relevant details when logging exceptions*
63
63
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.
65
65
66
66
Example:
67
67
```
@@ -78,9 +78,9 @@ The design review process is as follows:
78
78
79
79
## Error Handling
80
80
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*
82
82
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.
84
84
85
85
-*Do not catch exceptions that are indicative of a programmer error (e.g. `ArgumentNullException`)*
86
86
@@ -90,7 +90,7 @@ The design review process is as follows:
90
90
91
91
-*Do not use exceptions for normal control flow*
92
92
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.
94
94
95
95
Example: Handle errors where they occur (good):
96
96
@@ -171,36 +171,36 @@ The design review process is as follows:
171
171
172
172
-*Avoid using the thread pool (and avoid using async)*
173
173
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).
175
175
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.
177
177
178
178
- <aid="bgexceptions"></a>*Catch all exceptions on long-running tasks and background threads*
179
179
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()`).
181
181
182
182
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).
183
183
184
184
## Coding Conventions
185
185
186
186
-*Most C# coding style guidelines are covered by StyleCop*
187
187
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.
189
189
190
190
-*Prefer explicit types to interfaces and implicitly typed variables*
191
191
192
192
Avoid the use of `var` (C#), `dynamic` (C#), and `auto` (C++). Prefer concrete/explicit types to interfaces (e.g. prefer `List` to `IList`).
193
193
194
-
The Scalar4G codebase uses this approach because:
194
+
The Scalar codebase uses this approach because:
195
195
196
196
* 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).
197
197
* Interfaces can hide the thread safety (or lack thereof) of their underlying type. For example, an `IDictionary` could be a `Dictionary` or a `ConcurrentDictionary`.
198
198
* 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.
200
200
201
201
-*Method names start with a verb (e.g. "GetProjectedFolderEntryData" rather than "ProjectedFolderEntryData")*
202
202
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.
204
204
205
205
-*Aim to write self-commenting code. When necessary, comments should give background needed to understand the code.*
206
206
@@ -226,7 +226,7 @@ The design review process is as follows:
226
226
227
227
-*Add new interfaces when it makes sense for the product, not simply for unit testing*
228
228
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.
230
230
231
231
-*Check for `null` using the equality (`==`) and inequality (`!=`) operators rather than `is`*
232
232
@@ -279,7 +279,7 @@ The design review process is as follows:
279
279
280
280
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).
281
281
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*
283
283
284
284
Keeping the code separate helps ensure that bugs in the product code do not compromise the integrity of the functional tests.
0 commit comments