Skip to content

Reindex resource when link status changes - #1147

Merged
fbacall merged 3 commits into
masterfrom
linkmonitor-reindex
Sep 15, 2025
Merged

Reindex resource when link status changes#1147
fbacall merged 3 commits into
masterfrom
linkmonitor-reindex

Conversation

@fbacall

@fbacall fbacall commented Sep 11, 2025

Copy link
Copy Markdown
Member

Summary of changes

  • Trigger a reindex of an event/material if its URL is detected as being broken (or back online)

Motivation and context

Resources with dead links were showing up in search results due to not being indexed after the link monitor updated.

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree
    to license it to the TeSS codebase under the
    BSD license.

@fbacall
fbacall requested a review from Copilot September 11, 2025 16:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds functionality to automatically reindex search resources when their link status changes between working and broken states. This ensures that resources with dead links are properly excluded from search results and resources that come back online are re-included.

  • Adds a status_changed? method to detect transitions between working and failing link states
  • Implements automatic reindexing via an after_commit callback when link status changes
  • Includes comprehensive test coverage for the status change detection logic

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/models/link_monitor.rb Adds status change detection and automatic reindexing callback
test/models/link_monitor_test.rb Adds test coverage for the new status change detection method

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread app/models/link_monitor.rb Outdated
fbacall and others added 2 commits September 12, 2025 15:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@fbacall
fbacall merged commit bdf7ab1 into master Sep 15, 2025
11 checks passed
@fbacall
fbacall deleted the linkmonitor-reindex branch September 15, 2025 17:00
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