Skip to content

new job changes#14

Merged
raymondjstone merged 1 commit into
masterfrom
develop
Apr 9, 2026
Merged

new job changes#14
raymondjstone merged 1 commit into
masterfrom
develop

Conversation

@raymondjstone
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 9, 2026 15:51
@raymondjstone raymondjstone merged commit 263fae5 into master Apr 9, 2026
2 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Qodana for JVM

It seems all right 👌

No new problems were found according to the checks applied

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “JSA Activity Mode” background job/category intended to periodically mark random unchecked jobs as unsuitable (to simulate job-search activity) when running in LocalMode.

Changes:

  • Introduces JobCategory.JsaActivity and a new JsaActivityModeJob scheduled via LocalBackgroundService.
  • Updates the Background Jobs UI to show the new category icon and job description.
  • Updates portable build ZIP LFS pointers.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Services/LocalBackgroundService.cs Adds new job default/category and conditionally schedules the new job loop in LocalMode.
Services/JsaActivityModeJob.cs Implements the long-running “JSA Activity Mode” job logic.
Components/Pages/BackgroundJobs.razor Adds icon + description text for the new category/job.
Portable/JobTracker-x86.zip.001 Updates Git LFS pointer for portable artifact part.
Portable/JobTracker-x86.zip.002 Updates Git LFS pointer for portable artifact part.
Portable/JobTracker-x64.zip.001 Updates Git LFS pointer for portable artifact part.
Portable/JobTracker-x64.zip.002 Updates Git LFS pointer for portable artifact part.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +424 to +428
private async Task RunJsaActivityMode()
{
using var scope = _scopeFactory.CreateScope();
var job = scope.ServiceProvider.GetRequiredService<JsaActivityModeJob>();
await job.RunAsync();
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

RunJsaActivityMode resolves JsaActivityModeJob from DI, but the job is not registered in Program.cs (no AddTransient/AddScoped entry). This will throw at runtime the first time the loop runs. Register JsaActivityModeJob in the service container the same way other background jobs are registered.

Copilot uses AI. Check for mistakes.
Comment on lines +203 to +205
if (_jsaActivityEnabled)
tasks = [.. tasks, RunLoop("JsaActivityMode", RunJsaActivityMode, stoppingToken)];

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

JsaActivityModeJob supports cancellation via CancellationToken, but RunLoop/RunJsaActivityMode don’t pass the stoppingToken through, meaning the host may be unable to shut down promptly (this job can run up to 4 hours). Consider updating RunLoop to accept a token-aware delegate (e.g., Func<CancellationToken, Task>) and call job.RunAsync(ct) so shutdown cancels the session.

Copilot uses AI. Check for mistakes.
Comment on lines 94 to +98
_configPath = Path.Combine(env.ContentRootPath, "Data", "background-jobs.json");

// JSA Activity Mode is only available when the data directory contains "passp"
_jsaActivityEnabled = _configPath.Contains("passp", StringComparison.OrdinalIgnoreCase);

Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

Feature-gating via _configPath.Contains("passp") is brittle and can enable/disable the job based on an incidental substring in the install path. If this is meant to be a controllable feature flag, prefer an explicit config setting (appsettings/env var) or a dedicated marker file in the Data directory; also the comment says “data directory” but the check is on the full config file path.

Suggested change
_configPath = Path.Combine(env.ContentRootPath, "Data", "background-jobs.json");
// JSA Activity Mode is only available when the data directory contains "passp"
_jsaActivityEnabled = _configPath.Contains("passp", StringComparison.OrdinalIgnoreCase);
var dataDirectory = Path.Combine(env.ContentRootPath, "Data");
_configPath = Path.Combine(dataDirectory, "background-jobs.json");
// JSA Activity Mode is only available when the Data directory contains the explicit marker file.
_jsaActivityEnabled = File.Exists(Path.Combine(dataDirectory, "jsa-activity.enabled"));

Copilot uses AI. Check for mistakes.
}

var pick = browseJobs[random.Next(browseJobs.Count)];
jobService.SetSuitabilityStatus(pick.Id, SuitabilityStatus.Unsuitable, HistoryChangeSource.Manual,
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

This job changes suitability automatically but records the history source as Manual, which can make the audit trail misleading (it will look like a user action). Consider using HistoryChangeSource.System (or a dedicated source) so downstream views/reports can distinguish automated activity from real user clicks.

Suggested change
jobService.SetSuitabilityStatus(pick.Id, SuitabilityStatus.Unsuitable, HistoryChangeSource.Manual,
jobService.SetSuitabilityStatus(pick.Id, SuitabilityStatus.Unsuitable, HistoryChangeSource.System,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants