def convert_alert_instance(instance):
    """
    convert from a CodeScanningAlertInstance to a dict suitable for reporting
    """
    converted = {
        "ref": instance.ref,
        "state": instance.state,
        "commit_sha": instance.commit_sha,
        "location": {
            "path": instance.location.path,
            "start_line": instance.location.start_line,
            "start_column": instance.location.start_column,
            "end_line": instance.location.start_line,
            "end_column": instance.location.start_column,
        },
        "analysis_key": instance.analysis_key,
        "message": instance.message.get('text')
    }
    return converted