Skip to content

Feature: Recruitment Babysitter [WIP] - #406

Draft
SimplyJpk wants to merge 32 commits into
masterfrom
feat/recruitment-babysitter
Draft

SimplyJpk wants to merge 32 commits into
masterfrom
feat/recruitment-babysitter

Conversation

@SimplyJpk

Copy link
Copy Markdown
Member

This branch has a whole heap of nonsense. I was trying to get a recruitment babysitter functional without being overcomplicated, which I don't think I can say was the result.

I've made this as a Draft PR as I will probably give it another crack at some point, but some main areas need improvements, and I don't like how complicated the service became. Probably trying to do too many things, and a simpler solution would be more appropriate.

  1. DiscordNet (maybe Discord) doesn't allow bots to make GuideLine posts longer than 1,000 characters for forums, this makes including details in guidelines a bit awkward.
  2. This bot creates a pinned message under the relevant channels, but makes no attempt to manage the post in question, it is left for Moderators/Admins (I think this might be fine, more flexible).
  3. When the Bot is starting, it initialises, it very aggressively does a lot of channel/post checks. I do worry that this could easily become something that throttles UDC Bot if deployed. How it manages posts and the time checks between everything probably needs to be improved.
  4. There are a lot of moving parts, this is probably a feature that may benefit from being moved into database rather than keeping it all in json. Something to explore another time.
image

Note

This PR summary was generated with Copilot and reviewed/edited by @SimplyJpk.
It appears accurate but may not cover every change.

This pull request introduces several improvements to the development workflow and adds comprehensive unit tests for recruitment-related features. The main changes include standardizing editor and build configurations, refining the .NET build and run process for the DiscordBot project, and adding new test coverage for recruitment content analysis.

Development workflow and configuration improvements:

  • Standardized editor settings in .editorconfig to enforce consistent line endings, whitespace trimming, UTF-8 encoding, and indentation across all files, with specific rules for C# and JSON files.
  • Updated .vscode/tasks.json and .vscode/launch.json to streamline build and run tasks: builds now output to a dedicated bin/vscode directory, and new tasks are added for running and watching the project with improved argument handling and working directory configuration. [1] [2] [3]

.NET project configuration:

  • Added <RollForward>Major</RollForward> to DiscordBot.Tests.csproj to ensure tests run on compatible newer .NET runtimes if available.

Recruitment feature test coverage:

  • Added RecruitmentContentTests to verify correct parsing and summarization of payment terms, portfolio links, media attachments, behavioral cues, and contact links in recruitment posts.
  • Added ListingAnalysisTests to test domain name matching, preservation of summary and evidence with empty registries, and correct literal display handling for Discord display text.

- Enforce one listing and accepted-only creation cooldowns
- Add Guidelines setup, owner controls and moderator recovery
- Persist recoverable workflows and add regression coverage
…ging and output paths

docs: add local development section to README for .NET 8 setup and usage instructions
- Cache observations and defer Discord throttles
- Add responsive status and a recovering feed overview
- Preserve queued evidence before automatic actions
- Retain bounded starter evidence and moderator review notices.
- Keep the staff overview fixed and quiet routine processing.
@github-actions

Copy link
Copy Markdown

🚀 Deploy this PR

Code-only changes

  1. Make sure the udc-bot-dev ArgoCD app target revision is set to master.
  2. Go to the Deploy to Dev workflow and click Run workflow with this PR number.

Manifest changes (e.g. new services in k8s/dev/)

  1. Comment /build on this PR to build the Docker image (without deploying to master).
  2. Once the build succeeds, update the image tag in k8s/dev/bot.yaml on your branch with the SHA from the build comment, then push.
  3. In ArgoCD, switch the udc-bot-dev app target revision from master to your branch (App Details → Source → Edit → Save).
  4. ArgoCD will sync your manifest changes + new image. Test your changes.
  5. When done, switch ArgoCD target revision back to master.

foreach (var word in words) { if (line.Length + word.Length > 16 && line.Length > 0) { lines.Add(line); line = ""; } line += (line.Length > 0 ? " " : "") + word; }
lines.Add(line);
d.FillColor(MagickColors.White).FontPointSize(40);
for (var n = 0; n < Math.Min(3, lines.Count); n++) d.Text(x + 16, y + 92 + n * 40, lines[n].Length > 17 ? lines[n][..16] + "…" : lines[n]);
{
if (!ready() || State?.Listings.GetValueOrDefault(thread) is not { } post) return;
await _workflow!.ProcessSafelyAsync(post, ct);
foreach (var waiting in State.Listings.Values.Where(p => p.Id != post.Id && p.OwnerId == post.OwnerId &&
}

public Listing? Owner(string guild, string thread, string owner) =>
ready() && State?.GuildId == guild && State.Listings.TryGetValue(thread, out var post) && post.OwnerId == owner ? post : null;
return safe.Length == 0 ? null : safe;
}
public static string? SafeAvatarUrl(string? value) => Uri.TryCreate(value, UriKind.Absolute, out var uri) && uri.Scheme == "https" &&
uri.Host is "cdn.discordapp.com" or "media.discordapp.net" && value.Length <= 500 ? value : null;
else if (endpoint == "channels/11/threads" && method == "POST")
{
CreatePayload = patch!; StarterContent = (string)patch!["message"]!["content"]!;
Thread["owner_id"] = "999"; Thread["applied_tags"] = patch["applied_tags"]!.DeepClone(); body = Thread.ToString();
{
using var rig = new RecruitmentRig(); await rig.Start(); var post = await rig.Post();
var received = post.Deadline!.Value.AddSeconds(-1);
rig.Clock.Now = post.Deadline.Value.AddMinutes(1);
await entered.Task;
rig.Clock.Now = received;
var submission = service.RunAsync((engine, ct) => engine.AcknowledgeAsync("1", "100", "200", code, ct, received), "100");
rig.Clock.Now = post.Deadline.Value.AddMinutes(1);
private bool _disposed;
public bool Change(TimeSpan dueTime, TimeSpan period)
{
lock (this)
}
public void Fire()
{
lock (this)
}
callback(state);
}
public void Dispose() { lock (this) { _disposed = true; _due = null; } }

This branch has not been deployed

No deployments
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.

1 participant