Ben Baker's installed-software collection, software delivery (run_script and
update_app), agentless adoption tool and command-queue hardening, with his
authorship preserved.
Reviewed before promotion. Fixed: the endpoints plugin tests were never collected
by pytest, the SBOM snapshot table's key would exhaust on MySQL, ingest did not
truncate two columns strict MySQL would reject, and update_app's version branch
pinned a digest for a file that route never serves. Agent packaging moved off
require_role('admin') onto a new endpoints.agentpackage permission.
Contract 0.27.0. Full suite 2231, frontend 314.
47 lines
1.5 KiB
Python
47 lines
1.5 KiB
Python
"""Add appversions.sha256 and appversions.silentargs (installer delivery metadata)
|
|
|
|
The endpoint installer push resolves a specific AppVersion: sha256 pins the
|
|
exact bytes the agent must fetch, and silentargs carries this version's
|
|
unattended-install switches (homegrown EXEs vary by developer; MSI is uniform
|
|
via msiexec). Both nullable. Idempotent guards and real downgrade.
|
|
|
|
Revision ID: 7d35_appversion_delivery_metadata
|
|
Revises: 7d34_singular_relationship_types
|
|
Create Date: 2026-07-24
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = '7d35_appversion_delivery_metadata'
|
|
down_revision = '7d34_singular_relationship_types'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def _has_col(insp, name):
|
|
return any(c['name'] == name for c in insp.get_columns('appversions'))
|
|
|
|
|
|
def upgrade():
|
|
bind = op.get_bind()
|
|
insp = sa.inspect(bind)
|
|
if 'appversions' not in insp.get_table_names():
|
|
return
|
|
if not _has_col(insp, 'sha256'):
|
|
op.add_column('appversions', sa.Column('sha256', sa.String(length=64), nullable=True))
|
|
if not _has_col(insp, 'silentargs'):
|
|
op.add_column('appversions', sa.Column('silentargs', sa.String(length=255), nullable=True))
|
|
|
|
|
|
def downgrade():
|
|
bind = op.get_bind()
|
|
insp = sa.inspect(bind)
|
|
if 'appversions' not in insp.get_table_names():
|
|
return
|
|
if _has_col(insp, 'silentargs'):
|
|
op.drop_column('appversions', 'silentargs')
|
|
if _has_col(insp, 'sha256'):
|
|
op.drop_column('appversions', 'sha256')
|