Repointing Job history hides unfinished built-in runs from migration checks

Open
#100 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start by reading the migration steps and the Jobs verification and cleanup behavior described in the issue, then trace how Repoint references handles a scheduled Job that has not run yet. Check how the queued task retains its built-in Script association after the Job is repointed. Done means verification still identifies the unfinished built-in run and cleanup preserves the Script until that run is resolved.

Written by the indexing model from the issue text.

Description

app: scripts Bucket: KTLO severity: low status: backlog type: bug
Plugin Version

v0.0.1

NetBox Version

v4.7.4

Python Version

3.12

Steps to Reproduce
  1. On a test installation, upload a simple built-in Custom Script under Customization > Scripts.
  2. Under Scripts > Migration, complete the passes through Activate Projects, leaving Repoint references pending.
  3. As a superuser, schedule the built-in Script for the following day.
  4. Run Repoint references, then Verify.
  5. Run Clean up before the scheduled time, then let the run become due.

Step 3 deliberately submits a built-in run after cutover, outside the documented maintenance procedure. The issue is how migration treats that run once it exists.

Expected Behavior

The run remains identifiable as unfinished built-in work. Verification reports it, and cleanup preserves its built-in Script until the run is resolved.

Observed Behavior

Repoint references associates the Scheduled Job with the replacement Script. Verify's Jobs check then reports "No Job names the built-in feature", although the queued task still executes the built-in Script.

Clean up deletes the built-in module and marks the migration complete while the Job and its queued task remain. When the run becomes due, it ends Errored with DoesNotExist('Script matching query does not exist.').

If the run executes before cleanup instead, it runs the built-in Script, and its Job returns to the built-in association when execution starts.

Related to #4 and #99. Here, Repoint references moves an unfinished Job's association, so verification and cleanup no longer find it as built-in work. #4 covered how verification classifies Jobs that retain that association.
#99 concerns replaying a captured schedule after its deleted Job returns.

Also related: #1 and #65.

Dominant language
Python
Stars
8
Forks
0
Avg merge
11h 41m
Merged PRs (30d)
38

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from netbox-community/netbox-scripts

All issues in netbox-community/netbox-scripts

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.