{% extends "generic/_base.html" %} {% load i18n %} {% comment %} The page every migration pass is started from. Job details and results come only from Jobs the user may view. Workflow state, including next_action and staging_blocked, is independent of Job visibility. Context: - inventory_job: The most recent inventory Job, or None - staging_job: The most recent staging Job, or None - staging_queued: Whether a staging pass is already under way - staging_running: The staging Jobs that show Running, newest first, which hold the pass back - blocking_findings: The blocking findings the last inventory recorded, each {path, code, message} - staging_blocked: Whether the last inventory recorded a blocking finding, whether or not the user may view it - warning_count: How many modules the last inventory reported a warning for - branch_import_count: How many modules import something absent, but only inside a branch - undefined_script_count: How many published Scripts their own module does not define - reports_excluded: Whether the last inventory reported built-in report modules it excludes - helper_count: How many modules the last inventory reported would publish nothing - rows: One {key, name, project, project_exists, revision} per Project either pass named, project if visible - run: The open MigrationRun, else the most recent closed one, or None before the first staging pass - cutover_job: The most recent cutover Job, or None - cutover_queued: Whether a cutover is already under way - cutover_running: The cutover Jobs that show Running, newest first, which hold the pass back - can_cut_over: Whether the crossing has not been recorded yet and can be served past the fence - cutover_interrupted: Whether the state reached cutover with the crossing unrecorded, so the fence may have closed - unservable_projects: The staged Projects that could serve nothing past the fence, each {project_key, reason} - activation_job: The most recent activation Job, or None - activation_queued: Whether an activation is already under way - activation_running: The activation Jobs that show Running, newest first, which hold the pass back - can_activate: Whether the fence has been crossed, which is activation's only precondition - references_job: The most recent reference pass Job, or None - references_queued: Whether a reference pass is already under way - references_running: The reference pass Jobs that show Running, newest first, which hold the pass back - can_repoint: Whether every migrated Project that still exists serves, so a reference has a row to name - projects_not_serving: The migrated Projects that exist and serve nothing, which a reference pass would refuse over - cleanup_job: The most recent cleanup Job, or None - cleanup_queued: Whether a cleanup is already under way - cleanup_running: The cleanup Jobs that show Running, newest first, which hold the pass back - can_clean_up: Whether every reference step is done and every mapped Project serves, which is what deletion waits for - verification_job: The most recent verification Job, or None - verification_status: Its report's status, or None unless it completed, queued after the newest run began or closed - hidden_jobs: Per pass, whether its most recent Job exists but the user may not view it - guide_url: The published migration guide, which the notes beside the passes link to - next_action: Which pass to run next, or None when the next move is not a button here {% endcomment %} {% block title %} {% trans "Custom Script migration" %} {% endblock title %} {% block content %}

{% trans "Migrate from the built-in feature" %}

{% trans "The inventory reports what a migration would do and changes nothing. Staging creates the Script Projects it proposes, every one inactive, and leaves the built-in Custom Scripts serving. Every step from the cutover onwards changes what this installation runs, and there is no way back." %}

{% if verification_job %} {% endif %}
{% trans "State" %} {% if run %} {{ run.get_state_display }} {% else %} {% trans "Not started" %} {% endif %}
{% trans "Last inventory" %} {% include "netbox_scripts/inc/migration_job.html" with job=inventory_job hidden=hidden_jobs.inventory %}
{% blocktrans trimmed %} A script at a Data Source's root makes the whole source one Project. {% endblocktrans %} {% trans "Migration guide" %}
{% trans "Last staging" %} {% include "netbox_scripts/inc/migration_job.html" with job=staging_job running=staging_running queued=staging_queued hidden=hidden_jobs.staging %}
{% trans "Last cutover" %} {% include "netbox_scripts/inc/migration_job.html" with job=cutover_job running=cutover_running queued=cutover_queued hidden=hidden_jobs.cutover %}
{% trans "Last activation" %} {% include "netbox_scripts/inc/migration_job.html" with job=activation_job running=activation_running queued=activation_queued hidden=hidden_jobs.activation %}
{% trans "Last reference pass" %} {% include "netbox_scripts/inc/migration_job.html" with job=references_job running=references_running queued=references_queued hidden=hidden_jobs.references %}
{% trans "Moves supported Event Rules, permissions and Job history onto the plugin, then recreates eligible runs. Source files are not changed." %} {% trans "Migration guide" %}
{% trans "Last cleanup" %} {% include "netbox_scripts/inc/migration_job.html" with job=cleanup_job running=cleanup_running queued=cleanup_queued hidden=hidden_jobs.cleanup %}
{% trans "Last verification" %} {% include "netbox_scripts/inc/migration_job.html" with job=verification_job hidden=hidden_jobs.verification %}
{% trans "Checks migration records, references and queued work. It does not run Scripts or check stored source files. A completed Job can still report warnings or blockers." %} {% trans "Migration guide" %}
{% trans "Verification result" %} {% if verification_status == "ready" %} {% badge _("Ready") bg_color="green" %} {% elif verification_status == "warning" %} {% badge _("Warning") bg_color="yellow" %} {% elif verification_status == "blocking" %} {% badge _("Blocking") bg_color="red" %} {% else %} {% trans "No result available" %} {% endif %}
{% if blocking_findings %} {% elif staging_blocked %} {% endif %} {% if unservable_projects and perms.netbox_scripts.migrate_scriptproject %} {% endif %} {% if projects_not_serving and perms.netbox_scripts.migrate_scriptproject %} {% endif %} {% if warning_count %}

{% blocktrans count total=warning_count %} One module imports the legacy authoring API, which stops working at NetBox v5.0. Staging is not blocked by it. {% plural %} {{ total }} modules import the legacy authoring API, which stops working at NetBox v5.0. Staging is not blocked by them. {% endblocktrans %} {% trans "The inventory names each one." %}

{% endif %} {% if branch_import_count %}

{% blocktrans count total=branch_import_count %} One module imports something this host cannot provide, but only inside a conditional branch. If that branch runs, the revision fails validation and says so. Staging is not blocked by it. {% plural %} {{ total }} modules import something this host cannot provide, but only inside a conditional branch. If those branches run, the revisions fail validation and say so. Staging is not blocked by them. {% endblocktrans %} {% trans "The inventory names each one." %}

{% endif %} {% if undefined_script_count %}

{% blocktrans count total=undefined_script_count %} One Script the built-in feature publishes is not defined in the module it publishes from, so a migration cannot keep it under that identity. {% plural %} {{ total }} Scripts the built-in feature publishes are not defined in the modules they publish from, so a migration cannot keep them under those identities. {% endblocktrans %} {% trans "The inventory names each one." %}

{% endif %} {% if reports_excluded %}

{% trans "Built-in report modules are not part of this migration, because reports use an authoring API this plugin does not serve." %} {% trans "The inventory says how many, and the cutover withdraws any permission naming them." %}

{% endif %} {% if helper_count %}

{% blocktrans count total=helper_count %} One module publishes no Script, so it migrates as a helper file rather than a script file. {% plural %} {{ total }} modules publish no Script, so they migrate as helper files rather than script files. {% endblocktrans %} {% trans "The inventory names each one." %}

{% endif %} {% if rows %}

{% trans "Projects" %}

{% trans "Every Project the passes above name, including one the inventory proposed that staging has not created yet. Revision status is read now, for the revision in service or else the newest stored one." %} {% trans "A revision waiting for validation has no verdict yet. A Valid one is what the activation pass can put into service after the cutover, and an Invalid one explains the problem on its page." %} {% trans "A Project is ready for the cutover once it serves a revision or holds any Valid one, even if the one shown is not Valid." %} {% trans "Migration guide" %}

{% for row in rows %} {% with revision=row.revision %} {% endwith %} {% endfor %}
{% trans "Script Project" %} {% trans "Revision" %} {% trans "Revision status" %} {% trans "Scripts" %}
{% if row.project %} {{ row.project }} {% else %} {{ row.name }} {% endif %} {% if revision %} {% firstof revision.short_digest _("Not stored") %} {% else %} {{ ''|placeholder }} {% endif %} {% if revision %} {{ revision.get_status_display }} {% elif row.project %} {% trans "No stored revision" %} {% elif row.project_exists %} {% trans "Not visible to you" %} {% else %} {% trans "Not staged" %} {% endif %} {% if revision %} {{ revision.discovered_scripts|length }} {% else %} {{ ''|placeholder }} {% endif %}
{% endif %} {% if cutover_interrupted and perms.netbox_scripts.migrate_scriptproject %} {% endif %}
{% comment %} The seven passes in the order they run, each numbered, with the one next_action names filled and the rest outlined. Verification is last despite sitting outside the destructive gate with the inventory: the gate says who may run a pass, not when it runs. {% endcomment %}
{% endblock content %}