-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP - Add remote service interactions #6
base: main
Are you sure you want to change the base?
Conversation
- Improve test runtimes (set FakeTimeProvider dates on start, not using SetUTCNow())
- Updated `GetUserConfigurationForDayAsync` to always enable the remote provider. - Simplified lambda expressions for `RemoteUserStateProvider` and `HiddenForm` in `Program.cs`. - Refactored `IScreenTimeStateClient` creation in `ServiceCollectionExtensions.cs` to directly instantiate `ScreenTimeLocalService`. - Changed `IUserConfigurationProvider` registration logic to check for "develop" or "live" instead of "local" or "live".
- Introduced `SendHeartbeatAsync` method in `IUserConfigurationProvider` and implemented it in `LocalUserConfigurationProvider`. - Updated `RemoteUserConfigurationProvider` to send heartbeat data via HTTP POST. - Modified `SwitchableUserConfigurationProvider` to utilize the new heartbeat method. - Refactored variable declaration in `HiddenForm.cs` for clarity. - Simplified `AddScreenTimeClient` method in `Program.cs` and `ServiceCollectionExtensions` by removing unnecessary parameters. - Added `cacheFileExtension` constant in `RemoteUserStateProvider` for better cache file management. - Enhanced `LogHeartbeat` method in `ScreenTimeLocalService` to log and send heartbeat signals.
Updated solution files `screentime.sln` and `services.sln` to include a new project reference for `ScreenTIme.Common`. Modified `ScreenTimeService.csproj` to utilize functionalities from `ScreenTIme.Common`.
(no backend storage yet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 24 out of 39 changed files in this pull request and generated 3 comments.
Files not reviewed (15)
- client.sln: Language not supported
- screentime.sln: Language not supported
- services.sln: Language not supported
- src/ScreenTIme.Common/ScreenTIme.Common.csproj: Language not supported
- src/ScreenTimeClient/ExtensionResponseArgs.cs: Evaluated as low risk
- src/ScreenTimeClient/ComputerStateEventArgs.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/UserConfigurationResponseEventArgs.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/UserConfigurationRegistryReader.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserMessage.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserConfiguration.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserStatus.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/UserConfigurationEventArgs.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserActivityState.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/IUserConfigurationReader.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/LocalUserConfigurationProvider.cs: Evaluated as low risk
Comments suppressed due to low confidence (3)
src/ScreenTimeClient/Configuration/SwitchableUserConfigurationProvider.cs:41
- Redundant null check for localProvider. It is already initialized in the constructor.
if (localProvider is null)
src/ScreenTimeClient/Configuration/SwitchableUserConfigurationProvider.cs:52
- Redundant null check for localProvider. It is already initialized in the constructor.
if (localProvider is null)
src/ScreenTimeClient/Configuration/IUserConfigurationProvider.cs:14
- [nitpick] The parameter name 'v' is ambiguous. It should be renamed to something more descriptive, like 'minutes'.
public Task RequestExtensionAsync(int v);
src/ScreenTimeClient/Configuration/RemoteUserConfigurationProvider.cs
Outdated
Show resolved
Hide resolved
src/ScreenTimeClient/Configuration/RemoteUserConfigurationProvider.cs
Outdated
Show resolved
Hide resolved
src/ScreenTimeClient/Configuration/SwitchableUserConfigurationProvider.cs
Outdated
Show resolved
Hide resolved
…ider.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ider.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Add Enumerate Extensions
(No notification system yet.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 67 out of 82 changed files in this pull request and generated 2 comments.
Files not reviewed (15)
- client.sln: Language not supported
- screentime.sln: Language not supported
- services.sln: Language not supported
- src/ScreenTIme.Common/ScreenTIme.Common.csproj: Language not supported
- src/ScreenTimeClient/ComputerStateEventArgs.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserMessage.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserStatus.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserActivityState.cs: Evaluated as low risk
- .github/workflows/dotnet-desktop.yml: Evaluated as low risk
- src/ScreenTIme.Common/DailyConfiguration.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/DailyConfigurationRegistryReader.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/DailyConfigurationLocalProvider.cs: Evaluated as low risk
- src/ScreenTIme.Common/Heartbeat.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/DailyConfigurationEventArgs.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserState.cs: Evaluated as low risk
Comments suppressed due to low confidence (4)
src/ScreenTimeClient/Configuration/DailyConfigurationRemoteProvider.cs:8
- [nitpick] The parameter name 'connectionProvider' should be consistent with the rest of the class, where 'serviceClient' is used. Rename 'connectionProvider' to 'serviceClient'.
public class DailyConfigurationRemoteProvider(ScreenTimeServiceClient connectionProvider, ILogger<DailyConfigurationRemoteProvider> logger) : IDailyConfigurationProvider, IDisposable
src/ScreenTimeClient/Configuration/ClientConfigurationRegistryReader.cs:7
- The variable name _baseKey should be renamed to BaseKey to follow naming conventions.
const string _baseKey = @"HKEY_CURRENT_USER\Software\ScreenTime";
src/ScreenTimeClient/Configuration/ClientConfigurationRegistryReader.cs:18
- [nitpick] The method name GetRegistryIntValue should be reviewed for clarity and consistency.
private static int GetRegistryIntValue(string key, string valueName, int defaultValue)
src/ScreenTIme.Common/Extensions.cs:12
- The parameter name 'requestId' should be renamed to 'RequestId' to follow the PascalCase naming convention.
public record AdminExtensionRequest(Guid requestId, User User, DateTimeOffset SubmissionDate, TimeSpan Duration);
|
||
# Build the application to populate the obj folder with RuntimeIdentifiers | ||
- name: Build the application | ||
run: dotnet build $env:Solution_Name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build command does not correctly use the Configuration environment variable. It should be passed as an argument to the dotnet build command.
run: dotnet build $env:Solution_Name | |
run: dotnet build $env:Solution_Name --configuration ${{ matrix.configuration }} |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 70 out of 85 changed files in this pull request and generated no comments.
Files not reviewed (15)
- client.sln: Language not supported
- screentime.sln: Language not supported
- services.sln: Language not supported
- src/ScreenTIme.Common/ScreenTIme.Common.csproj: Language not supported
- src/ScreenTimeClient/Configuration/DailyConfigurationLocalProvider.cs: Evaluated as low risk
- .github/workflows/dotnet-service.yml: Evaluated as low risk
- src/ScreenTIme.Common/DailyConfiguration.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/DailyConfigurationRemoteProvider.cs: Evaluated as low risk
- src/ScreenTimeClient/Configuration/DailyConfigurationRegistryReader.cs: Evaluated as low risk
- src/ScreenTimeClient/ComputerStateEventArgs.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserMessage.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserStatus.cs: Evaluated as low risk
- src/ScreenTIme.Common/UserActivityState.cs: Evaluated as low risk
- .github/workflows/dotnet-desktop.yml: Evaluated as low risk
- src/ScreenTIme.Common/Heartbeat.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
src/ScreenTimeClient/Configuration/ClientConfigurationRegistryReader.cs:25
- The 'else' statement after 'if (objectValue == null)' is redundant and can be removed for cleaner code.
else if (objectValue is int intValue)
No description provided.